covr.Docs

Program reference

Accounts

Every account a desk creates, pays for or reads. For each one: its PDA seeds, size, owner, and the fields you read, with their units. The put accounts added on 4 November 2026 are listed at the end, in Put accounts. Desks cannot quote puts yet.

Conventions

  • Offsets are byte offsets into the raw account data. Bytes 0 to 8 are the Anchor discriminator: the first 8 bytes of sha256("account:<Name>").
  • Integers are little-endian. u64 and i64 take 8 bytes. bool is 1 byte (0 or 1). A Pubkey is 32 bytes.
  • Seeds are listed in order. A string seed is its UTF-8 bytes. A Pubkey seed is its 32 bytes. "Quote key" means the 20 raw bytes of your 0x… quote key address. A nonce or salt seed is a u64 in 8 little-endian bytes.
  • USDC atoms: 1 USDC = 1,000,000. Collateral atoms: 1 token = 10^decimals atoms (JitoSOL: 10^9).
  • Times are unix seconds from the Solana clock (i64).
AccountDiscriminator (hex)Size (bytes)Owner
Maker1fffe83d261cbd93117program
MakerOriginV13f4f3531be414e4d179program
PremiumBudget681596bdc5d2df6490program
Exposuref84bcc155cfbc59389program
MintPolicyV1e4f567e0036bef4a342program
MintUsageV15cc6e5df9cc060ed261program
MarketV3f78670c82d5f1b88376program
PositionV3c2f7ab366adb6033652program
FlashExercisePolicyV14b99abbfa05c8012277program
FlashExerciseContextV1c6187712e99982c0464program. Exists only inside one flash exercise transaction.
USDC vault, position collateral vaultSPL token account165 for SPL Tokentoken program
MintPolicyV2 (puts)a15dfa85318ef176377program
MintUsageV2 (puts)88008abeff1a7500262program
MintPurchasePolicyV2 (puts)997fc53a1e4fae2a262program
MintPurchaseUsageV2 (puts)b86eef93185e9bf2222program
PaymentSpendLedgerV1 (puts)1777932a655e3778155program
PutExposureV1 (puts)39008cd2ea62cf7e89program
FlashPutPolicyV1 (puts)dbaa439982543a47277program
Put asset vault, put strike escrowSPL token account165 for SPL Tokentoken program

Maker

Your identity on chain. One per quote key. Created by register_maker_v3.

Seeds"maker", quote key (20 bytes)
Size117 bytes
Rent paid byyour authority
SDKderiveMaker(makerEthAddress).maker, decodeMaker
OffsetFieldTypeMeaning
8authorityPubkeyYour Solana authority. Set at registration. No instruction can change it.
40eth_address20 bytesYour quote key address. Every quote must recover to it.
60bumpu8PDA bump.
61operatorPubkeyOptional second key that may exercise. All zeros means none.
93min_nonceu64Your nonce floor. See The nonce floor.
101registration marker8 bytesASCII CVRFNC01.
109registration slotu64The slot register_maker_v3 ran in.

decodeMaker returns authority, ethAddress, bump, operator and minNonce, plus two fields that mirror bytes 101 to 117. For a Maker created by register_maker_v3 those two are always true and the registration slot.

The nonce floor

min_nonce is how you cancel quotes. Every instruction that checks a signature from your quote key also checks the signed nonce against it:

rust
nonce >= maker.min_nonce && nonce != u64::MAX   // otherwise InvalidOrder (6003)
InstructionNonce it checks
fill_v3, fill_restricted_v3The quote nonce
early_close_v3The early-close nonce
buy_position_v3The buying desk's sale nonce

Rules:

  • It only goes up. configure_maker refuses a lower value with InvalidTerms (6001).
  • Raising it cancels at once. Every signed quote, early-close quote and sale quote with a lower nonce stops working on chain. Positions already open are not touched.
  • Each quote nonce opens at most one position. The position address is derived from your quote key and the nonce, across all markets. A second fill with the same nonce fails because the account already exists.
  • u64::MAX retires this quote key forever. No nonce passes a floor of 18446744073709551615 (u64::MAX), the floor can never go down, and a quote key can never register again. Setting it is permanent.
  • It also gates rent cleanup. A customer can close a settled position account only once your min_nonce is above that position's nonce. This does not move any of your funds.
Caution

Setting min_nonce to u64::MAX retires this quote key forever: it can never register again. To cancel everything outstanding, raise min_nonce to the highest nonce you have signed plus 1. To stop all fills on a mint for a while, use pause_mint_policy_v1 instead: it is reversible. If your quote key leaked, u64::MAX is the right move: see If your quote key leaks.

MakerOriginV1

Your registration record. Created by register_maker_v3 and never changed. Every fill and bootstrap_mint_usage_v1 pass it as the origin account.

Seeds"maker-origin-v1", Maker
Size179 bytes
SDKderiveMaker(makerEthAddress).origin. No decoder.
OffsetFieldTypeMeaning
8versionu8Always 1.
9bumpu8PDA bump.
10makerPubkeyYour Maker.
42authorityPubkeyYour authority at registration.
74deployment_id32 bytesEquals DEPLOYMENT_ID.
106paymentPubkeyUSDC mint.
138payment_programPubkeySPL Token program.
170payment_decimalsu86.
171birth_slotu64Registration slot. Equals the Maker's registration slot.

USDC vault

Your USDC. One per Maker. Created by initialize_vault. It is a standard SPL token account, so any token decoder reads its balance.

Seeds"stable", Maker, USDC mint
OwnerSPL Token program. Its token authority is your Maker PDA, so only the program can move funds out.
SDKderiveVault(maker).vault
Indeposit (from your authority's USDC account), early_close_v3 (customer pays you)
Outfill_v3 (gross premium), exercise_v3 (strike), withdraw (to your authority's USDC account), buy_position_v3 (sale price), fund_restricted_exercise_v3 (restricted strike, into escrow)

The program never sets the strike aside. Your vault balance is the only thing that pays exercises. See Money rules.

The vault's seeds include the payment mint, so a Maker can have one vault per payment token. On a put market paid in USDC, this same USDC vault pays the put premium and receives the cash at put exercise or early close. See Put money rules.

PremiumBudget

An optional lifetime cap on what fills can spend from your vault. One per Maker and payment token, shared by every collateral mint and market paid in that token. Created by initialize_vault, disabled. The USDC one counts call fills and put fills paid in USDC.

Seeds"premium-budget", Maker, USDC mint
Size90 bytes
SDKderiveVault(maker).premiumBudget. No decoder.
OffsetFieldTypeMeaning
8makerPubkeyYour Maker.
40stablePubkeyUSDC mint.
72limitu64Cap on spent, in USDC atoms. Enforced only when enabled.
80spentu64Lifetime gross premium (fee included) of all your fills, plus the price of every position you bought, in USDC atoms. Never goes down.
88enabledboolfalse: no cap at all. true: a fill fails if spent + gross > limit.
89bumpu8PDA bump.
Note

A new vault has no premium cap. enabled is false until you call set_premium_budget.

Exposure

A cap on how much collateral you hold open on one mint, across all markets. One per Maker and collateral mint. Created by initialize_exposure_v3.

Seeds"exposure", Maker, collateral mint
Size89 bytes
SDKderiveExposure(maker, mint). No decoder.
OffsetFieldTypeMeaning
8makerPubkeyYour Maker.
40collateralPubkeyCollateral mint.
72limitu64Cap on active, in collateral atoms.
80activeu64Collateral atoms in your open positions on this mint. Up at fill. Down at exercise, release or early close.
88bumpu8PDA bump.

A fill fails with ExposureLimit (6006) if active + quantity > limit. Change limit with set_exposure_limit. This account counts covered calls only. Puts use a separate PutExposureV1.

MintPolicyV1

Your per-mint caps, and the exact market terms you accept on that mint. One per Maker and collateral mint. Created by initialize_mint_policy_v1.

Seeds"mint-policy", Maker, collateral mint
Size342 bytes
SDKderiveMintPolicy(maker, mint).policy, decodeMintPolicy(policyAddress, raw, { authority, maker, collateral: { mint, program, decimals } }). Build settings with mintPolicySettingsFor.
OffsetFieldTypeMeaning
8versionu8Always 1.
9bumpu8PDA bump.
10makerPubkeyYour Maker.
42authorityPubkeyYour authority.
74collateralPubkeyCollateral mint.
106collateral_programPubkeyToken program of that mint.
138collateral_decimalsu8Decimals of that mint.
139paymentPubkeyUSDC mint.
171payment_programPubkeySPL Token program.
203payment_decimalsu86.
204generationu64Starts at 1. Each update or pause adds 1. Both must name the current value.
212watcherPubkeyOptional key that may pause this policy. All zeros means none.
244enabledboolfalse: every new fill on this mint fails.
245terms_id32 bytesMust equal the market's terms_id. ORDINARY_TERMS_ID for ordinary markets.
277profile_hash32 bytesMust equal the market's profile_hash (a fingerprint of the collateral mint).
309max_order_atomsu64Largest single fill, in collateral atoms.
317max_reserved_atomsu64Cap on collateral atoms open on this mint.
325max_reserved_strike_usdcu64Cap on the total strike you owe on open positions on this mint, in USDC atoms.
333lifetime_premium_limit_enabledboolTurns the next field on.
334lifetime_premium_limit_usdcu64Cap on lifetime gross premium on this mint, in USDC atoms. Must be 0 when disabled.

decodeMintPolicy returns these fields with generation as a bigint and the settings under settings. It checks the PDA, bump, maker, authority and collateral identity, but not the account owner: read the account yourself and check owner === PROGRAM_ID first.

Every cap is checked at fill time, against the totals after the fill. A breach fails the fill with TokenLifecycleAccounting (8302). The policy is never read by exercise, release or early close, so pausing or tightening it never blocks an exit.

A policy holds one terms_id, so each mint is quoted either in ordinary markets or in restricted markets, never both. Restricted (tokenized-stock) markets stay covr-only for now, so a desk policy holds ORDINARY_TERMS_ID. Puts never read this account: they use a separate put policy, MintPolicyV2.

To stop every fill on a mint at once, pause the policy with pause_mint_policy_v1 (SDK: pauseMintPolicyV1). Your authority or the watcher key can sign it, and your authority can undo it with update_mint_policy_v1 (SDK: updateMintPolicyV1).

MintUsageV1

The running totals your mint policy is checked against. One per Maker and collateral mint. Created next to the policy, and unusable until bootstrap_mint_usage_v1 runs.

Seeds"mint-usage", Maker, collateral mint
Size261 bytes
SDKderiveMintPolicy(maker, mint).usage, decodeMintUsage(usageAddress, raw, { maker, collateral: { mint, program, decimals } })
OffsetFieldTypeMeaning
8versionu8Always 1.
9bumpu8PDA bump.
10makerPubkeyYour Maker.
42collateralPubkeyCollateral mint.
74collateral_programPubkeyToken program of that mint.
106collateral_decimalsu8Decimals of that mint.
107paymentPubkeyUSDC mint.
139payment_programPubkeySPL Token program.
171payment_decimalsu86.
172policyPubkeyYour MintPolicyV1 for this mint.
204bootstrappedboolfalse until bootstrap_mint_usage_v1. Fills on this mint fail while false.
205reserved_atomsu64Collateral atoms in open positions on this mint.
213reserved_strike_usdcu64Strike you owe if every open position on this mint is exercised, in USDC atoms.
221cumulative_premium_usdcu64Lifetime gross premium on this mint, in USDC atoms. Never goes down.
229open_claimsu64Open positions on this mint.
237pending_claimsu64Restricted positions funded but not yet delivered.
245total_fillsu64Lifetime fills on this mint.
253total_settledu64Positions settled. total_fills - total_settled = open_claims.
Tip

reserved_strike_usdc is the USDC you owe on that mint if every open position is exercised. Your vault is shared by all mints. Add this field across your mints and compare it with your vault balance.

MarketV3

One market's terms. Any wallet can create one. Every position on a market shares its expiry and exercise window.

Seeds"market-v3", creator, salt (u64 LE)
Size376 bytes
Rent paid bythe creator
SDKderiveMarket(creator, salt), decodeMarketV3
OffsetFieldTypeMeaning
8versionu8Always 3.
9bumpu8PDA bump.
10settlement_modeu80 = ordinary (atomic exercise). 1 = restricted (fund, then deliver). 2 = cash-secured put.
11collateral_decimalsu8Decimals of the collateral mint.
12payment_decimalsu86.
13creatorPubkeyThe wallet that created the market. It alone can pause it.
45collateralPubkeyCollateral mint.
77collateral_programPubkeyToken program of the collateral.
109paymentPubkeyUSDC mint. On a put market, that market's payment mint.
141payment_programPubkeySPL Token program.
173fee_ownerPubkeyOwner of the USDC account that receives the fee. Never zero.
205genesis_hashPubkeyMainnet genesis hash.
237deployment_id32 bytesEquals DEPLOYMENT_ID.
269terms_id32 bytesORDINARY_TERMS_ID or RESTRICTED_TERMS_ID. On a put market, the put terms id 0xd474a4f04d59f2d78a41ed2e5a392671a4f07c46c03c5457eda24d3b6842da78.
301profile_hash32 bytesFingerprint of the collateral mint at creation, including its mint and freeze authorities.
333saltu64Creator's salt.
341expiryi64Expiry time, unix seconds.
349windowu64Exercise window after expiry, in seconds. 60 to 3,600.
357strike_e8u64Strike in USD per whole token, times 10^8.
365max_quantity_atomsu64Largest single fill, in collateral atoms. Not a cap on the market's total.
373fee_bpsu16Fee taken from the gross premium, in basis points. At most 1,000.
375pausedbooltrue: new fills fail. Exits still work.

If the collateral mint changes after a market is created (for example a new mint authority), the stored profile_hash no longer matches and new fills on that market fail with MarketV3Identity (8201).

PositionV3

One filled quote. Created by fill_v3, which the customer signs and pays rent for. A put fill, fill_put_v3, creates the same 652-byte account at the same seeds, with the differences noted below.

Seeds"position", quote key (20 bytes), nonce (u64 LE)
Size652 bytes
SDKderivePosition(makerEthAddress, nonce, mint), decodePositionV3
OffsetFieldTypeMeaning
8versionu8Always 3.
9bumpu8PDA bump.
10collateral_vault_bumpu8Bump of the collateral vault.
11strike_escrow_bumpu8Bump of the strike escrow address.
12stateu80 open, 1 pending delivery, 2 exercised, 3 released, 4 early closed, 5 cancelled by both parties.
13timeout_anchoru80 ordinary, 1 restricted, 2 put.
14collateral_decimalsu8Decimals of the collateral.
15payment_decimalsu86.
16makerPubkeyYour Maker.
48maker_authorityPubkeyYour authority. Exercised collateral goes to a token account it owns.
80maker_eth_address20 bytesYour quote key.
100writerPubkeyThe current owner of the position: receives the strike at exercise, or the collateral at release. Starts as the customer who filled.
132terms_accountPubkeyThe MarketV3 address.
164terms_id32 bytesCopied from the market.
196profile_hash32 bytesCopied from the market.
228genesis_hashPubkeyMainnet genesis hash.
260deployment_id32 bytesEquals DEPLOYMENT_ID.
292collateral_mintPubkeyCollateral mint.
324collateral_programPubkeyToken program of the collateral.
356payment_mintPubkeyUSDC mint. On a put, the market's payment mint.
388payment_programPubkeySPL Token program.
420policyPubkeyYour MintPolicyV1 for this mint.
452usagePubkeyYour MintUsageV1 for this mint.
484collateral_vaultPubkeyToken account holding the locked collateral. On a put, the address is derived but never created.
516strike_escrowPubkeyStrike escrow address. Used by restricted positions and by puts, where it holds the customer's locked cash.
548nonceu64The quote nonce that opened it.
556admission_generationu64Your mint policy's generation at fill time.
564quantity_atomsu64Collateral locked, in collateral atoms.
572gross_premium_usdcu64Premium your vault paid, fee included, in USDC atoms.
580strike_usdcu64USDC your vault pays if you exercise, in USDC atoms. On a put: T, the cash the customer locked, in atoms of the payment token.
588opened_ati64Fill time.
596expiryi64Market expiry.
604exercise_window_secondsu64Market window.
612cancellation_timeout_secondsu640 for ordinary. 604800 for restricted.
620intent_generationu64Restricted only: 1 once funded.
628funded_ati64Restricted only: when the strike was escrowed.
636cancel_eligible_ati64Restricted only: funded_at + cancellation_timeout_seconds.
644funded_strike_usdcu64Restricted only: strike escrowed, in USDC atoms.

A put position uses states 0, 2, 3 and 4 only. SDK 0.1.1's decodePositionV3 throws PositionV3: timeout anchor on a put position.

Time rules for an ordinary position, with deadline = expiry + exercise_window_seconds:

ClockAllowed
opened_at <= now < expiryEarly close by the writer, transfer by the writer.
expiry <= now < deadlineexercise_v3 by your authority or operator.
now >= deadlinerelease_v3 by anyone.

decodePositionV3 also returns status (open, pending_delivery, exercised, released, early_closed, bilaterally_canceled), exerciseDeadline, and your Maker's makerOperator and makerMinNonce from the same read.

Position collateral vault

Holds the customer's collateral while the position is open. Created by fill_v3. Exercise, release and early close empty it and close it. Its rent goes to the writer's collateral token account.

Seeds"collateral", PositionV3
OwnerThe market's collateral token program. Its token authority is the PositionV3 PDA.
SDKderivePosition(...).collateralVault

Other accounts

AccountSeedsSizeCreated byNotes
Strike escrow"strike-escrow-v3", PositionV3token accountfund_restricted_exercise_v3, or fill_put_v3 for a putRestricted: holds the funded strike until delivery or cancellation. Put: holds the customer's locked cash (see Put accounts).
CloseReceipt"close-receipt", Maker, close nonce (u64 LE)121early_close_v3 (writer pays)Makes each early-close nonce single-use.
SaleReceipt"sale-receipt", buying Maker, nonce (u64 LE)153buy_position_v3 (seller pays)Makes each sale nonce single-use.
MintPurchasePolicyV1"mint-purchase-policy", Maker, mint261initialize_mint_purchase_policy_v1Caps for buying positions. Needed only for buy_position_v3.
MintPurchaseUsageV1"mint-purchase-usage", Maker, mint221initialize_mint_purchase_policy_v1Lifetime purchase totals.
FlashExercisePolicyV1"flash-policy-v1", Maker, collateral mint, USDC mint277initialize_flash_exercise_policy_v1Optional. Limits for flash exercise. Layout in Flash exercise.
Flash context, input, output"flash-context-v1", "flash-input-v1", "flash-output-v1", each with the PositionV3464, 165, 165begin_flash_exercise_v3Temporary. Closed by finish_flash_exercise_v3 in the same transaction.

Put accounts

The maker accounts that cash-secured puts use, added on 4 November 2026. Desks cannot quote puts yet, and @covrfun/maker-sdk 0.1.1 has no derivation or decoder for any of them. Each is keyed by your Maker plus the asset A, the payment token P, or both, so caps in one payment token never mix with another. The order in which you create them is in Put setup. Field-by-field layouts are on the Users page Accounts > Put accounts.

AccountSeedsSizeCreated byWhat it holds
Vault for P"stable", Maker, Ptoken accountinitialize_vault with mint PPays put premiums. Receives the cash at put exercise and early close. For USDC, this is your existing USDC vault.
PremiumBudget for P"premium-budget", Maker, P90initialize_vault with mint POptional lifetime cap on premium paid in P.
PaymentSpendLedgerV1"payment-spend-v1", Maker, P155init_payment_spend_ledger_v1Splits the budget's spent into what came before the ledger and call or put spending since. For P other than USDC, every put fill and purchase checks that the parts add up to spent.
PutExposureV1"put-exposure-v1", Maker, A89init_put_exposure_v1limit and active: asset atoms you owe on open puts, across every payment token. Same layout as Exposure.
MintPolicyV2"mint-policy-v2", Maker, A, P, kind byte 2377init_mint_policy_v2Your put caps and the put terms you accept, for one asset and payment token. Born disabled.
MintUsageV2"mint-usage-v2", Maker, A, P, kind byte 2262init_mint_policy_v2Running totals the put policy is checked against. Ready at creation, no bootstrap step.
Put asset vault"put-asset-v1", Maker, Atoken accountinit_put_asset_vault_v1The asset you deliver at a funded put exercise. Its token authority is your Maker. Only your authority can deposit or withdraw.
FlashPutPolicyV1"flash-put-policy-v1", Maker, A, P277init_flash_put_policy_v1Optional. Limits for flash put exercise. Born disabled.
MintPurchasePolicyV2, MintPurchaseUsageV2"mint-purchase-policy-v2", "mint-purchase-usage-v2", then Maker, A, P, kind byte 2262, 222init_mint_purchase_policy_v2Optional. Caps for buying put positions with buy_put_position_v3. Born disabled.
Put strike escrow"strike-escrow-v3", PositionV3token accountfill_put_v3 (the customer pays)The customer's locked cash T for one put. Its token authority is the position.

The PutExposureV1 fields sit at the same offsets as Exposure: maker at 8, collateral at 40, limit at 72, active at 80, bump at 88.

Example: read your Maker and vault

ts
import { createSolanaRpc } from '@solana/kit';
import { PROGRAM_ID, TOKEN_PROGRAM, deriveMaker, deriveVault, decodeMaker } from '@covrfun/maker-sdk';

const rpc = createSolanaRpc('https://<your rpc>');
const makerEth = '0x…'; // your quote key address
const { maker } = await deriveMaker(makerEth);
const { vault, premiumBudget } = await deriveVault(maker);

const { value } = await rpc
  .getMultipleAccounts([maker, vault, premiumBudget], { commitment: 'finalized', encoding: 'base64' })
  .send();
const [m, v, b] = value;
if (!m || m.owner !== PROGRAM_ID) throw Error('Maker missing or not owned by the program');
if (!v || v.owner !== TOKEN_PROGRAM) throw Error('USDC vault missing');
if (!b || b.owner !== PROGRAM_ID) throw Error('PremiumBudget missing');

const bytes = (a: { data: readonly [string, string] }) => Buffer.from(a.data[0], 'base64');
const decoded = await decodeMaker(maker, bytes(m), makerEth);
const vaultUsdc = bytes(v).readBigUInt64LE(64); // SPL token account amount
const budget = bytes(b);

console.log({
  minNonce: decoded.minNonce,
  operator: decoded.operator,
  vaultUsdc,
  budgetLimit: budget.readBigUInt64LE(72),
  budgetSpent: budget.readBigUInt64LE(80),
  budgetEnabled: budget[88] === 1,
});