Concepts
Signing and nonces
Your desk has two keys. Keep them apart.
| Key | Type | Signs | Lives in |
|---|---|---|---|
| Quote key | secp256k1 (0x… address) | Bid intents, quotes, the registration grant | Your quoting service, ideally a KMS or HSM |
| Authority | Solana ed25519 | Setup, deposits, configureMaker, exercise | Cold or well-guarded storage |
The quote key never touches SOL or USDC directly. The authority owns your accounts and your vault. You can also name an operator: a second Solana key that may exercise for you without holding the authority.
EIP-712, one domain per market
Every message is EIP-712 typed data. The domain is:
| Field | Value |
|---|---|
name | SOL Covered Calls |
version | 1 |
chainId | 2000000001 (CHAIN_ID) |
verifyingContract | Derived from the market's full terms (quoteDomain) |
The verifyingContract commits to every term of the market: program, deployment, collateral, strike, expiry, fee and more. So a bid or quote signed for one market can never be replayed on another. Always build the domain from the market account you read yourself:
import { decodeMarketV3, quoteDomain } from '@covrfun/maker-sdk';
const market = await decodeMarketV3(marketAddress, rawAccountBytes); // read at finalized, owner checked
const domain = quoteDomain(market);Low-s signatures only
The program rejects a signature whose s value is in the upper half of the curve order. signIntent, signQuote and signRegistrationGrant check this for you. If you sign another way, run assertCanonicalSignature on the result. Most libraries already produce low-s signatures.
Nonces
Every quote carries a nonce: an unsigned 64-bit integer you choose. The nonce names the position the quote can open. Your position account address is derived from your quote key and that nonce. So each nonce can open at most one position, ever, across all markets.
The program accepts a quote only when:
nonce >= min_nonce and nonce != 2^64 - 1min_nonce lives in your Maker account. Read it with decodeMaker.
Rules for a safe nonce journal
- Never reuse a nonce. Keep a counter that only goes up.
- Write before you sign. Before you sign a quote, durably record its nonce, its full terms and the cash it could cost. Use fsync or a database commit.
- Start at or above
min_nonce. On startup, read your Maker account and start at the larger of your journal andmin_nonce. - One writer per journal. Two processes on one journal will hand out the same nonce.
The example bot does all four. It keeps an append-only JSON-lines journal and takes a lock file. See Run the example bot.
Unknown outcomes
A quote request that times out may still have reached the gateway. The same holds for a socket that dies while sending it. The SDK reports these as OutcomeUnknownError, never as "not sent".
Treat that quote as live until one of these is true:
- your position account for that nonce exists (it filled), or
- its
validUntilhas passed and no fill landed.
Keep its cash held until then. The SDK also refuses any further request for that RFQ, so a late reply cannot be mistaken for a new one.
Cancelling signed quotes
The gateway has no withdrawal route for desks. You stop quotes on chain, two ways:
- Pause your mint policy. Every fill on that mint fails until you re-enable it. Your authority or a hot watcher key can do it.
- Raise
min_noncewithconfigureMaker. Every quote below the new floor can never fill. The floor never goes down.
configureMaker sets both operator and minNonce. Pass your current operator to keep it. See Cancel quotes.
A quote the gateway admits is valid for at most 60 seconds. The brakes matter when you must stop now: a bad price or a market move. A leaked quote key needs more: see Security.