# Security

How covr is built and tested, and how to report a problem.

Testing lowers risk. It does not remove it. Read [Risks](https://docs.covr.markets/users/risk/overview.md) as well.

## How the program is tested

### Unit and on-chain test suites

- **Unit tests** run inside the program's own code: amount arithmetic, account layouts, time rules, signature digests and the flash-exercise transaction checks.
- **On-chain suites** build the real program binary and run it in a local Solana runtime, with the real SPL Token programs. They open, exercise, release and close positions and check the token balances after each step.
- The suites also attack the program on purpose: swapped or substituted accounts, forged and replayed signatures, arithmetic at the limits, compute limits, and every token program variant the program accepts.
- A **seeded random tester** drives long random sequences of every position action against a model of what should happen, and tries account substitutions along the way. Any difference from the model fails the run.

### Deliberate-fault testing

A test that never fails proves nothing. So covr plants faults on purpose (mutation testing): each fault removes or weakens exactly one check, and the tests that should catch it must fail. A fault the tests miss shows a gap in the tests.

### Upgrade rehearsals against the live program

Before an upgrade, covr rehearses it in a local runtime against the live program's bytes:

- the live program's bytes are read from mainnet, read-only, and kept;
- the live build is rebuilt from source and must match those bytes exactly;
- test positions are opened on the live bytes, the upgrade is applied with the real upgrade loader, and every exit is run on both versions and compared, along with the account state it leaves;
- account layouts, addresses, signed-message formats and error codes are checked for changes.

The test positions, tokens and stake pool are synthetic local fixtures. They are not copies of user positions.

### Review of every change

Every change is independently reviewed before it ships.

### The app checks too

A correctly delivered app build does not trust covr's own servers. Before your wallet sees a transaction, the page rebuilds it from the quote you selected, recovers the maker's signature itself, and checks the program, the market creator, the fee account and the quote signer against values compiled into the page. If any byte differs, it does not ask you to sign. These checks reject bad replies from covr's gateway or API. They cannot protect you if the app build you load has itself been tampered with, or if you sign a transaction outside the app.

## Automated security scanning

covr has run three automated scanners over the program source:

- an AI-based code scanner;
- Trail of Bits' static-analysis tooling for Solana programs;
- Radar, a static analyser for Solana programs.

Scanners look for known patterns of bugs. Their findings are checked by hand against the code. A scanner cannot show that a program is free of bugs, so scanning adds to the testing above and does not replace it.

## How the off-chain services protect keys

covr's maker and services use separate keys for separate jobs. The program limits what each one can do, so one leaked key cannot do everything.

| Key | What it can do | What it cannot do |
| --- | --- | --- |
| Quote key | Sign quotes, off chain. | Sign any Solana transaction or move tokens directly. Every quote it signs is still checked against the maker's on-chain limits. |
| Maker authority | Change the maker's settings, deposit to and withdraw from its own vault, exercise. | Touch your locked tokens outside the exercise rules. |
| Exercise operator | Exercise inside the window. | Withdraw from the maker's vault or change settings. |
| Watcher | Pause the maker's trading on one asset. | Anything else. |
| Market creation key | Create covr's markets and pause new trades on them. Its public address is on [Addresses](https://docs.covr.markets/users/ref/addresses.md#covrs-market-creators-and-fee-account). | Change a market's terms or touch open positions. |

Keys that covr's services use live on covr's own hosts, in files only the service's user can read. A service refuses to start if its key file is readable by anyone else or is a link. Key-loading code checks keys only with fixed-text errors, so key material cannot leak into an error message. The key that lists covr's markets automatically was generated on its host and has never left it.

Each quote carries a nonce. The program refuses a nonce that has opened a position before, and the maker can cancel every outstanding quote at once by raising its nonce floor. The maker can also pause its trading on an asset at once.

Your own keys never leave your wallet. covr's app asks your wallet to sign transactions only. It never asks you to sign a message.

## Reporting a vulnerability

If you find a security problem, tell us privately: **DM [@covrdotfun on X](https://x.com/covrdotfun)**. Do not post it publicly first.

**Include:**

- what you found, and what you think an attacker could do with it;
- the instruction, account or transaction signature involved, if any;
- steps to reproduce, ideally on a local validator rather than on mainnet;
- how we can reach you.

**Please do not** move or lock anyone else's funds, run tests against mainnet positions that are not yours, or share the details until we have fixed the problem.

**What to expect:** we will reply on X, ask any follow-up questions there, and tell you when a fix is live. Please give us reasonable time to fix the issue before you disclose it.

---

Source: https://docs.covr.markets/users/risk/security · Part of covr Docs, https://docs.covr.markets/llms.txt
