covr.Docs

Users: contract design

Instructions

Every instruction that opens, changes or settles a user's position, for covered calls and for cash-secured puts. For each one: who signs, the accounts in order, every check the program runs, exactly which tokens move, the state change and the errors.

How to read this page

  • You are the writer: the wallet that sold the option and owns the position.
  • Accounts are listed in the exact order the instruction expects. w means writable. s means it must sign.
  • Anchor checks run first. Before any handler code runs, the framework checks each account's type, address seeds, owner and the constraints listed in the tables. Then the handler runs the checks in the order shown. The first check that fails decides the error you see.
  • One transaction, all or nothing. If any check or any token transfer fails, the transaction fails and Solana rolls back its effects: no token moves and no account state changes. A failed transaction that was submitted and processed can still charge its SOL network fee to the fee payer.
  • Error codes are covr's program codes unless marked otherwise. The error table at the end lists them all.

Symbols

SymbolMeaningUnit
QQuantity of the asset in the position (quantity_atoms)asset atoms
TStrike amount (strike_usdc)payment-token atoms (6 decimals)
GGross premium the maker payspayment-token atoms
FMarket fee taken from Gpayment-token atoms
dDecimals of the asset mint (9 for JitoSOL)

How amounts are computed

The same formulas apply to every product. T and G must each come out as a whole number of atoms above zero, or the fill is refused with InvalidAmount (6002). T and G are never rounded. The fee rounds down to a whole atom of the payment token, so any fraction stays with you. The only other rounding is the flash exercise floor, which rounds up and protects the maker (see begin_flash_exercise_v3).

AmountFormula
TQ × strike_e8 / 10^(d+2), exact
GQ × price_e18 / 10^(d+12), exact
Ffloor(G × fee_bps / 10,000), rounded down to a whole atom, with fee_bps at most 1,000
Paid to you at fillG − F

Example, with round illustrative numbers only. A market on JitoSOL (d = 9) with a $220 strike stores strike_e8 = 22,000,000,000. A maker quotes 2 USDC per JitoSOL, so price_e18 = 2 × 10^18. The market fee is 1,000 bps in this example.

Q = 1,000,000,000 (1 JitoSOL)Q = 1,000,000,001
T220,000,000 atoms (220 USDC)220,000,000.22: not whole, refused
G2,000,000 atoms (2 USDC)2,000,000.002: not whole, refused
F200,000 atoms (0.2 USDC)
Paid to you1,800,000 atoms (1.8 USDC)Nothing. The fill fails with 6002 and no tokens move.

Summary

InstructionProductWho signsWhen
fill_v3Covered callYouBefore expiry
exercise_v3Covered callThe makerInside the exercise window
begin_flash_exercise_v3 and finish_flash_exercise_v3Covered callThe makerInside the exercise window
release_v3Covered callAnyoneAfter the exercise window
early_close_v3Covered callYouBefore expiry
transfer_position_v3Covered callYouBefore expiry
buy_position_v3Covered callYouBefore expiry
close_position_v3Covered callYouAfter settlement
fill_put_v3Cash-secured putYouBefore expiry
exercise_put_v3Cash-secured putThe makerInside the exercise window
begin_flash_put_v3 and finish_flash_put_v3Cash-secured putThe makerInside the exercise window
release_put_v3Cash-secured putAnyoneAfter the exercise window
early_close_put_v3Cash-secured putYouBefore expiry
transfer_position_v3xCash-secured putYouBefore expiry
buy_put_position_v3Cash-secured putYouBefore expiry
close_position_v3xCash-secured putYouAfter settlement
Tokenized-stock instructionsCovered call on a tokenized stockYou, the maker, anyone, or bothSee that section

Puts are part of the same program as calls. They use their own instructions, their own record mode and their own signing domain.

Note

covr's app prepares fill_v3 to open a covered call and release_v3 to unlock it, and fill_put_v3 and release_put_v3 for a cash-secured put. You sign each one in your wallet. A release needs no signature from you: you can send it, or anyone else can, and it pays only the position's writer. covr's app does not offer early close, transfer or sale for current positions, and covr's quote service does not collect early-close or sale quotes for them. The program still accepts these instructions from your own wallet, with a maker's signed quote where one is needed.

This page covers positions opened by fill_v3, fill_restricted_v3 and fill_put_v3. Positions in the program's original 130-byte format have their own instructions, listed in Position lifecycle. On 21 October 2026 none of them was open.

Covered calls

You lock Q of the asset. The maker pays you the premium now. At expiry the maker may buy your asset for T.

fill_v3

Opens a covered call from a maker's signed quote. You sign and send it. covr's server prepares it for you.

SignerYou. You pay the rent for the position account (652 bytes) and its collateral vault.
Argumentsauction_id: [u8; 32], nonce: u64, quantity_atoms: u64 (Q), price_e18: u128, valid_until: i64, signature: [u8; 65]
Discriminator07aeccf9e765bb35
#AccountwsWhy
0writerwsYou. Pays rent and is the source of the asset.
1marketThe market. Its terms set strike, expiry, window, fee and limits.
2makerThe quoting maker's account.
3positionwCreated. Address: seeds "position", maker quote-key address, nonce.
4collateral_vaultwCreated. Token account for the asset at seeds "collateral", position. Its owner is the position address, not covr.
5collateralAsset mint. Must equal the market's asset (Anchor 2012).
6paymentUSDC mint. Pinned address (Anchor 2012).
7writer_collateralwYour asset account. Debited Q. Must be yours and of the asset mint (Anchor 2015, 2014).
8writer_paymentwYour USDC account. Receives G − F. Must be yours (Anchor 2015).
9fee_tokenswUSDC account owned by the market's fee owner. Receives F (8300 otherwise).
10payment_vaultwThe maker's USDC vault, seeds "stable", maker, USDC. Pays G.
11collateral programMust equal the market's token program (Anchor 2012).
12payment programSPL Token (Anchor 2012).
13system program
14exposurewThe maker's exposure counter for this asset.
15premium_budgetwThe maker's premium budget.
16policyThe maker's mint policy for this asset.
17usagewThe maker's usage counters for this asset.
18originThe maker's registration or migration record.
extraJito stake poolJitoSOL fills only, required, read-only. A maker that migrated from older records may add one read-only holds record after it.

Checks, in order.

  1. auction_id is not zero. Else InvalidOrder (6003).
  2. The market is a canonical covered-call market: owned by the program, 376 bytes, at its own address, USDC payment, valid terms. Else 8200, 8201, 8202 or 8203.
  3. The asset mint still has the profile the market recorded at creation: a plain 82-byte mint, no freeze authority, same fingerprint and decimals. Else MarketV3Identity (8201) or MarketV3Unsupported (8203).
  4. The maker account is canonical (7600, 7602) and its origin record belongs to it and to this deployment (8700, 8701). The extra accounts match the rule above (8800). On JitoSOL: the pool account is the Jito stake pool, read-only, and updated this epoch (InvalidJitoPool 6009), and the fill is worth at most 50 SOL of pool value (JitoSolOrderLimit 6008).
  5. The USDC mint is a plain 6-decimal SPL Token mint. Else 8300.
  6. The market is not paused, now < expiry, now < valid_until <= expiry, nonce >= maker.min_nonce, nonce != u64::MAX, and 0 < Q <= max_quantity_atoms. Else InvalidOrder (6003).
  7. The maker's exposure, budget, policy and usage accounts are current and at their canonical addresses (8300), and the policy and usage belong to this maker, its owner key and this asset (6010, 6011, 6012, 6014, 8300).
  8. T and G are exact and above zero. Else InvalidAmount (6002).
  9. The maker's quote signature recovers to the maker's quote key over QuoteV2, in this market's signing domain, bound to this auction_id and to your wallet. Else BadSignature (6000).
  10. The maker's own policy accepts the fill: enabled, same terms and asset fingerprint as the market, and every cap still holds after the fill. Else TokenLifecycleAccounting (8302) or MakerMigrationLimit (8704).
  11. exposure.active + Q <= exposure.limit. Else ExposureLimit (6006).
  12. If the maker's premium budget is on, spent + G <= limit. Else PremiumBudgetExceeded (6007).
  13. The new position record is valid. Else 8301.

Token movements. Each transfer is checked before it runs: the destination must belong to the intended party, have no delegate and no close authority other than its owner, and not be frozen. The source must hold enough.

AmountFromToSigned by
Q assetyour writer_collateralthe position's collateral_vaultyou
G − F USDCthe maker's payment_vaultyour writer_paymentthe program, for the maker vault
F USDC, if above zerothe maker's payment_vaultfee_tokensthe program, for the maker vault

State change. A new position in state OPEN (0). It records you as writer, the maker, the market, the asset and payment mints, Q, G, T, opened_at = now, and the market's expiry and window. The maker's usage, exposure and budget counters go up by Q, T and G. See Accounts for every field.

Errors. 6000, 6002, 6003, 6006, 6007, 6008, 6009, 6010 to 6014, 7400 to 7406, 7600, 7602, 8200 to 8203, 8300, 8301, 8302, 8700, 8701, 8704, 8800. If the maker's vault holds less than G, or your account holds less than Q, the fill fails with CustodyInvalidAmount (7405). If that maker already used this nonce, the position address exists and the System program refuses to create it again.

exercise_v3

The maker buys your asset at the strike. Ordinary covered-call markets only.

SignerThe maker's owner key or its registered operator. You do not sign.
Argumentsnone
Discriminator1512034972d6645f
#AccountwsWhy
0authoritysMaker owner key or operator. Else 8304.
1marketThe position's market.
2makerThe position's maker.
3positionwState changes to exercised.
4collateral_vaultwPays Q, then is closed.
5writerMust equal the position's current writer. Not a signer.
6collateralAsset mint.
7writer_collateralwYour asset account. Receives any extra asset in the vault and the vault's rent. Must be yours (Anchor 2015).
8collateral program
9exposurewMaker counter, reduced by Q.
10usagewMaker counters, reduced.
11paymentUSDC mint (Anchor 2012).
12payment_vaultwThe maker's USDC vault. Pays T.
13writer_paymentwA USDC account owned by you. Receives T. Else 8300.
14maker_collateralwAn asset account owned by the maker's owner key (also when the operator signs). Receives Q. Else 8300.
15payment programSPL Token.

Checks, in order.

  1. No extra accounts. Else 8300.
  2. The market is canonical (8200 to 8203). The position is the canonical record of this maker (else Solana's InvalidAccountData). Every stored term matches the market and the accounts passed: covered-call mode, terms, mints, programs, decimals, expiry, window and writer (8300). The maker's exposure and usage accounts are current (8300). writer_collateral has no delegate and no close authority other than you (CustodyUnsafeRecipient 7403). The position is open (6003).
  3. The signer is the maker's owner key or its current operator. Else TokenLifecycleAuthority (8304).
  4. expiry <= now < expiry + window. Else InvalidOrder (6003).
  5. The USDC mint is a plain 6-decimal mint. Else 8300.
  6. The vault holds at least Q. Else CustodyInvalidAmount (7405).
  7. The maker's usage counters accept the close-out. Else 8302.

Token movements.

AmountFromTo
T USDCthe maker's payment_vaultyour writer_payment
Q assetthe position's collateral_vaultthe maker owner's maker_collateral
any asset above Q in the vaultcollateral_vaultyour writer_collateral
the vault's rent (SOL)collateral_vault, closedyour writer_collateral

The vault must be empty before it closes. Else TokenLifecycleTransfer (8303).

State change. OPEN to EXERCISED (2). The maker's exposure goes down by Q and its usage by Q and T.

Errors. 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 8303, 8304, InvalidAccountData. If the maker's vault holds less than T, exercise fails with 7405 and no tokens move. The maker can top up and retry while the window is open. There is no partial exercise. No price oracle is read: exercising is the maker's choice, at the fixed strike.

Flash exercise of a covered call

A flash exercise settles a covered call without the maker paying the strike up front. In one transaction, the maker borrows your locked asset from the position, sells it through any swap route, pays you exactly T from the proceeds, and keeps the rest. Two instructions bracket the swap: begin_flash_exercise_v3 and finish_flash_exercise_v3. Your result is the same as an ordinary exercise: T in USDC and any extra asset back.

The atomicity rule

  • begin_flash_exercise_v3 and finish_flash_exercise_v3 must be in the same transaction, called directly (not from another program). Else FlashNotTopLevel (9100).
  • finish must be the last instruction of the transaction. begin must come before it. Both carry their own positions in the transaction (begin_index, finish_index) and each checks them. Else FlashPairing (9102).
  • Both instructions check each other's exact data and full account list, and the Instructions sysvar must be the real one (9101). A missing, moved, duplicated or altered finish makes begin fail.
  • The transaction holds exactly one covr pair. No other instruction may call covr or even list covr's program as an account. Else 9102.
  • No instruction between them may touch a protected account, as program, signer, writable or read-only: your wallet, your token accounts, the position, its vault, the market, the maker, its vault, its counters, its policy, the flash context, the maker's owner key or operator, or covr's program. Else FlashProtectedAccount (9103).
  • During the transaction the position is in a transient FLASH state. Every other instruction refuses that state. The state can never be saved: if any step fails, Solana rolls back every effect of the transaction, including the lock, the collateral moved by begin, the approval and every token transfer. Your asset is back in its vault and the position is open. A failed transaction that was processed still charges its SOL network fee to whoever sent it.

begin_flash_exercise_v3

SignersThe maker's owner key or operator (pays the temporary rent), and a temporary delegate key.
Argumentsbegin_index: u16, finish_index: u16, expected_policy_generation: u64, min_payment_atoms: u64
Discriminator21607f587d0e3628 (instruction data is 28 bytes)
#AccountwsWhy
0authoritywsMaker owner key or operator. Pays, and later gets back, all temporary rent.
1delegatesTemporary key allowed to spend exactly Q of the isolated asset.
2 to 11market, maker, position (w), collateral_vault (w), writer, collateral, writer_collateral (w), collateral program, exposure (w), usage (w)Same as exercise_v3 accounts 1 to 10.
12payment_mintUSDC (Anchor 2012).
13maker_payment_vaultwThe maker's USDC vault.
14writer_paymentwYour USDC account. Receives T at finish.
15maker_collateralwAsset account of the maker's owner key.
16policyThe maker's flash policy for this asset and USDC.
17contextwCreated. Seeds "flash-context-v1", position. 464 bytes.
18inputwCreated. Temporary asset account, seeds "flash-input-v1", position.
19outputwCreated. Temporary USDC account, seeds "flash-output-v1", position.
20payment programSPL Token.
21system program
22instructionsThe Instructions sysvar.

Checks, in order.

  1. The pairing rules above (9100 to 9103).
  2. The same position checks as exercise_v3 step 2.
  3. The signer is the maker's owner key or current operator (8304).
  4. expiry <= now < expiry + window and the position is open (6003).
  5. The USDC mint is plain with 6 decimals (8300).
  6. The maker's flash policy: at its canonical address (FlashPolicySchema 9104), set by the current owner key (FlashPolicyOwner 9105), enabled (FlashPolicyDisabled 9106), at the expected generation (FlashPolicyGeneration 9107), for an admitted pair that matches the position (FlashPairUnsupported 9110), within the policy's size caps (FlashPolicyLimit 9109). The only admitted pair is JitoSOL with USDC.
  7. min_payment_atoms is at least the policy floor max(T + A, ceil(Q × R / 10^d)), where A and R are the maker's minimum surplus and minimum price settings (FlashFloorBelowPolicy 9112, FlashFloorArithmetic 9111). The price term rounds up. R is a price bound the maker configures, not an oracle, and it does not decide whether to exercise. This floor only protects the maker. You get T whatever the swap pays.
  8. Your writer_payment is a USDC account you own, not frozen, not native, with no delegate and no close authority other than you. maker_collateral is an asset account of the maker's owner key. Else FlashRecipient (9116).
  9. The delegate signed and is none of the protected keys, the input or the output. Else FlashDelegate (9114).
  10. The vault holds at least Q (7405).

Token movements.

AmountFromTo
Q assetthe position's collateral_vaultthe temporary input, owned by the flash context
(approval)the delegate may spend at most Q from input, and nothing else

State change. OPEN to FLASH (6), only inside this transaction. The context records the position's exact bytes, the bound accounts, T, Q, the floor and the starting balances.

Between begin and finish

The maker's swap instructions run here. They can use the delegate to spend up to Q of the asset from input, and must put USDC into output. What they spend can go to outside accounts, such as swap pools: the program fixes only the final recipients that finish pays. They cannot touch any protected account.

finish_flash_exercise_v3

SignerNone required by the program. The rent payer must be the key that signed begin.
Argumentsbegin_index: u16, finish_index: u16
Discriminator0f8709e6f3c10a17 (instruction data is 12 bytes)
#AccountwsWhy
0rent_payerwThe begin signer. Gets back all temporary rent.
1 to 10market, maker, position (w), collateral_vault (w), writer, collateral, writer_collateral (w), collateral program, exposure (w), usage (w)As in begin.
11payment_mintUSDC.
12maker_payment_vaultwReceives the maker's share.
13writer_paymentwYour USDC account. Receives T.
14maker_collateralwReceives any asset the swap did not use.
15contextwClosed.
16inputwClosed.
17outputwClosed.
18payment programSPL Token.
19instructionsThe Instructions sysvar.
20event authorityFor the settlement receipt event.
21covr programFor the settlement receipt event.

Checks, in order.

  1. The pairing rules (9100 to 9103), with begin's data rebuilt from the context.
  2. The context is the canonical one for this position, and every account equals what begin bound: rent payer, writer, your two accounts, the maker's accounts, input and output (FlashContext 9117).
  3. The position is in FLASH and its bytes, read as open, equal what begin saw. So no term, account or writer changed in between (FlashPositionState 9118).
  4. Input and output are still owned by the context, with the right mints and no close authority. The output has no delegate (FlashEndpoint 9115).
  5. New USDC in output (D) is at least the floor set at begin. Else FlashPaymentBelowFloor (9113).

Token movements.

AmountFromTo
exactly T USDCoutputyour writer_payment
D − T USDC, plus any USDC that was in output beforeoutputthe maker's maker_payment_vault
any asset left in inputinputmaker_collateral
any asset left in the position vaultcollateral_vaultyour writer_collateral
the vault's rent (SOL)collateral_vault, closedyour writer_collateral
rent of input, output and context (SOL)closedthe rent payer

State change. FLASH to EXERCISED (2). The maker's exposure and usage change exactly as for exercise_v3. The program logs a PositionExercised event and a FlashExerciseSettled receipt.

Errors. 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 8303, 8304, 9100 to 9118, InvalidAccountData.

release_v3

Returns your asset after the exercise window if the maker did not exercise.

SignerNone required. Anyone can send it and pay the fee, including you. covr's app prepares it for you to sign, and covr's keeper can send it on its own when covr turns its auto-release on (to confirm with covr). Whoever sends it, the asset can only go to the position's current writer.
Argumentsnone
Discriminator819397b4f29f4897

Accounts: the ten accounts exercise_v3 lists at positions 1 to 10, in the same order: market, maker, position (w), collateral_vault (w), writer, collateral, writer_collateral (w), collateral program, exposure (w), usage (w).

Checks, in order.

  1. No extra accounts (8300).
  2. The same position checks as exercise_v3 step 2, including a clean writer_collateral owned by the current writer (Anchor 2015, 7403).
  3. The position is open and now >= expiry + window. Else InvalidOrder (6003).
  4. The vault holds at least Q (7405).
  5. The maker's usage counters accept the close-out (8302).

Token movements.

AmountFromTo
everything in the vault (Q, plus any extra)collateral_vaultyour writer_collateral
the vault's rent (SOL)collateral_vault, closedyour writer_collateral

No USDC moves. You keep the premium.

State change. OPEN to RELEASED (3). Release reads no pause flag, no maker policy and no budget, so maker settings cannot block it.

Errors. 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 8303, Anchor 2014 and 2015, InvalidAccountData.

early_close_v3

Lets you end an open covered call before expiry. You pay the maker a buyback price it signed, and get your asset back.

SignerYou, the current writer. You pay rent for a small close receipt (121 bytes).
Argumentsclose_nonce: u64, amount_usdc: u64, valid_until: i64, signature: [u8; 65]
Discriminator12c6def3250a3149
#AccountwsWhy
0writerwsYou. Pays amount_usdc and the receipt rent.
1 to 10market, maker, position (w), collateral_vault (w), writer, collateral, writer_collateral (w), collateral program, exposure (w), usage (w)As in release_v3.
11paymentUSDC (Anchor 2012).
12writer_paymentwYour USDC account. Pays amount_usdc (Anchor 2015).
13payment_vaultwThe original maker's USDC vault. Receives amount_usdc.
14close_receiptwCreated at seeds "close-receipt", maker, close_nonce. Never closed, so a close nonce works once.
15payment programSPL Token.
16system program

Checks, in order.

  1. No extra accounts (8300).
  2. The same position checks as exercise_v3 step 2.
  3. The signer is the position's current writer. Else TokenLifecycleAuthority (8304).
  4. The position is open and opened_at <= now < expiry. Else InvalidOrder (6003).
  5. amount_usdc > 0. Else InvalidAmount (6002).
  6. now < valid_until <= expiry, close_nonce >= maker.min_nonce, close_nonce != u64::MAX. Else 6003.
  7. The USDC mint is plain with 6 decimals (8300).
  8. The original maker's quote key signed EarlyClose(position, owner, maker, nonce, amount, validUntil, usd) in this market's domain, with you as owner. Else BadSignature (6000).
  9. The vault holds at least Q (7405).
  10. The maker's usage counters accept the close-out (8302).

Token movements.

AmountFromToSigned by
amount_usdcyour writer_paymentthe maker's payment_vaultyou
everything in the vaultcollateral_vaultyour writer_collateralthe program
the vault's rent (SOL)collateral_vault, closedyour writer_collateralthe program

State change. OPEN to EARLY_CLOSED (4). A permanent close receipt records the maker, position, you, the nonce and the amount. You keep the premium you were paid.

Errors. 6000, 6002, 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 8303, 8304, InvalidAccountData. A reused close nonce fails because its receipt already exists.

transfer_position_v3

Hands an open covered call to another wallet. Everything the position later pays goes to the new writer.

SignerYou, the current writer. The recipient does not sign.
Argumentsnone
Discriminator5f31db262b67749a
#AccountwsWhy
0writersYou.
1makerThe position's maker.
2positionwIts writer field changes.
3recipientA plain system wallet: owned by the System program (Anchor 3011), not executable, no data (6004).

Checks, in order.

  1. No extra accounts (8300).
  2. The position is the canonical record of this maker (InvalidAccountData).
  3. It is a covered-call record with the ordinary terms. Else TokenLifecycleTerms (8301).
  4. The signer is the current writer. Else Unauthorized (6004).
  5. The position is open, opened_at <= now < expiry, and the recipient is not zero and not you. Else InvalidOrder (6003).

Token movements. None.

State change. The position's writer becomes the recipient. Nothing else changes: maker, amounts, terms, vault and counters stay as they were. Early-close and sale quotes signed for you no longer work, because they name you.

Errors. 6003, 6004, 8300, 8301, Anchor 3011, InvalidAccountData.

buy_position_v3

Sells your open covered call to a maker's desk for a price that desk signed. The buying desk's owner key becomes the writer. The original maker's obligations do not change.

SignerYou, the seller and current writer. You pay rent for a sale receipt (153 bytes).
Argumentsnonce: u64, amount: u64, valid_until: i64, auction_id: [u8; 32], signature: [u8; 65]
Discriminatora3e54011892f7b92
#AccountwsWhy
0sellerwsYou.
1market
2original_makerThe maker that sold you the premium.
3positionwIts writer changes.
4buyer_makerThe buying desk.
5buyer_originThe buying desk's registration record.
6recipientMust be the buying desk's owner key (Anchor 2012), a plain wallet (6004).
7collateralAsset mint.
8paymentUSDC.
9seller_paymentwYour USDC account. Receives amount (Anchor 2015).
10buyer_payment_vaultwThe buying desk's USDC vault. Pays amount.
11buyer_budgetwThe buying desk's premium budget.
12buyer_mint_policyThe buying desk's mint policy.
13purchase_policyThe buying desk's purchase policy.
14purchase_usagewThe buying desk's purchase counters.
15sale_receiptwCreated at seeds "sale-receipt", buyer maker, nonce. Never closed.
16payment programSPL Token.
17system program

Checks, in order.

  1. No extra accounts (8300).
  2. The market is canonical and its asset mint unchanged (8200 to 8203).
  3. The position is the canonical record of the original maker (InvalidAccountData).
  4. The buying desk's registration is valid (7600, 7602, 8002, 8700, 8701), and its purchase accounts are its own, current and canonical (6010 to 6013, 8302).
  5. The position is an ordinary covered call whose terms match the market, and its T still equals the strike formula. Else TokenLifecycleTerms (8301).
  6. You are the current writer. Else Unauthorized (6004).
  7. The position is open, opened_at <= now < expiry, and the recipient is not zero and not you. Else 6003.
  8. amount > 0. Else 6002.
  9. The market is not paused, auction_id is not zero, now < valid_until <= expiry + window, nonce >= buyer.min_nonce and nonce != u64::MAX. Else 6003.
  10. The USDC mint is plain with 6 decimals, and the buyer's budget is current (8300). If the buyer's budget is on, spent + amount <= limit (6007).
  11. The buying desk's quote key signed PositionSale(auctionId, position, seller, recipient, maker, nonce, amount, validUntil, usd) in this market's domain. Else 6000.
  12. The buying desk's purchase policy accepts the amount (8302, 8704).

Token movements.

AmountFromTo
amount USDCthe buying desk's buyer_payment_vaultyour seller_payment

State change. The position's writer becomes the buying desk's owner key. Your asset stays in the vault, now owed to the new writer. You keep the premium and the sale price.

Errors. 6000, 6002, 6003, 6004, 6007, 6010 to 6013, 7400 to 7406, 7600, 7602, 8002, 8200 to 8203, 8300, 8301, 8302, 8700, 8701, 8704, Anchor 2012 and 2015, InvalidAccountData.

close_position_v3

Deletes a settled position account and returns its rent to a wallet you choose. Optional. It never moves tokens.

SignerYou, the current writer.
Argumentssnapshot: Vec<u8>: the position account's exact current 652 bytes.
Discriminatore3674bd89d761355
#AccountwsWhy
0writersYou.
1makerThe position's maker.
2positionwClosed.
3refundwA plain system wallet you choose. Receives the position's rent. Not executable, no data (6004).

Checks, in order.

  1. No extra accounts (8300).
  2. Called directly by the transaction, not from another program. Else 6003.
  3. The position is the canonical record of this maker (InvalidAccountData). The signer is its writer (Solana MissingRequiredSignature).
  4. The position is settled, and the maker's nonce floor is strictly above the position's nonce. Else InvalidAccountData.
  5. It is an ordinary covered call in state exercised, released or early-closed. Else 8301.
  6. snapshot is 652 bytes and equals the account's current bytes. Else InvalidTerms (6001).

Token movements. None. Only the position account's SOL rent moves, to refund.

State change. The position account is deleted. Its exact bytes stay in the transaction record through snapshot. The nonce cannot be used again: a new fill needs nonce >= min_nonce, and the floor is already above it.

You can close only after the maker raises its nonce floor past your position's nonce. The program does not do that for you, and covr's maker does not do it yet, so today the position's rent stays in the account.

Errors. 6001, 6003, 6004, 8300, 8301, Anchor 3011, InvalidAccountData, MissingRequiredSignature.

Cash-secured puts

You lock T of a stablecoin. The maker pays you the premium now. At expiry the maker may sell you Q of the asset for your T.

Each put market fixes one payment token: a plain 6-decimal SPL Token mint, not native SOL, not the asset itself. Freeze and mint authorities on the payment token are allowed. The premium, the fee and T are all in that token.

fill_put_v3

Opens a cash-secured put from a maker's signed quote. You sign and send it.

SignerYou. You pay rent for the position account (652 bytes) and its strike escrow.
Argumentsauction_id: [u8; 32], nonce: u64, quantity_atoms: u64 (Q), price_e18: u128, valid_until: i64, signature: [u8; 65]
Discriminator7f01bf82e91395ff
#AccountwsWhy
0writerwsYou. Pays T and the rent.
1marketThe put market.
2makerThe quoting maker.
3positionwCreated at seeds "position", maker quote-key address, nonce.
4strike_escrowwCreated. Payment-token account at seeds "strike-escrow-v3", position. Owned by the position address.
5collateralThe asset mint. Must equal the market's asset (Anchor 2012).
6paymentThe market's payment token (Anchor 2012).
7writer_paymentwYour payment-token account. Pays T and receives G − F (Anchor 2015).
8fee_tokenswPayment-token account of the market's fee owner. Receives F (8300 otherwise).
9payment_vaultwThe maker's vault for this payment token. Pays G.
10payment programSPL Token.
11system program
12put_exposurewThe maker's put exposure for this asset.
13premium_budgetwThe maker's budget for this payment token.
14ledgerwThe maker's spend ledger for this payment token.
15policyThe maker's put policy for this asset and payment token.
16usagewThe maker's put usage counters.
17originThe maker's registration record.
extraJito stake poolJitoSOL only, required, read-only. No other extra account is allowed.

Checks, in order.

  1. Exactly one extra account on JitoSOL, none otherwise (8300). auction_id is not zero (6003).
  2. The market is a canonical put market (PositionKind 9200, AccountingVersion 9201, KindNotEnabled 9202, PaymentProfile 9204, 8200 to 8203). The asset mint still matches its recorded profile (8201, 8203). The payment mint is a plain 6-decimal mint (9204).
  3. The maker's registration is valid (7600, 7602, 8700, 8701). On JitoSOL: the pool is read-only (6009), canonical and updated this epoch (6009), and the size cap holds (6008).
  4. The market is not paused, now < expiry, now < valid_until <= expiry, the nonce is at or above the maker's floor and not u64::MAX, and 0 < Q <= max_quantity_atoms. Else 6003.
  5. The maker's put exposure, budget, ledger, policy and usage are current and canonical (8300).
  6. The policy is a put policy of this maker and owner key, for this exact asset and payment token, and its recorded payment-token fingerprint still matches the mint (6010, 6011, 6012, 6014, 9200, 9204, 9207).
  7. The maker's spend ledger is its own and balanced with its budget (PaymentSpendLedger 9211, PaymentSpendBalance 9212).
  8. T and G are exact and above zero (6002).
  9. The maker's quote signature is valid in this put market's domain, bound to auction_id and your wallet (6000). Put quotes use their own domain and set isPut to true, so a call quote can never open a put.
  10. The maker's policy accepts the fill (8302).
  11. Exposure, budget and ledger limits (6006, 6007, 9212).
  12. The new record is a valid put record (8301).

Token movements. Your T moves first.

AmountFromToSigned by
T payment tokenyour writer_paymentthe position's strike_escrowyou
G − Fthe maker's payment_vaultyour writer_paymentthe program, for the maker vault
F, if above zerothe maker's payment_vaultfee_tokensthe program, for the maker vault

After the first leg the escrow must hold exactly T. Else PutEscrow (9209).

State change. A new put position in state OPEN (0), with record mode 2 (put). It records the same fields as a covered call, with T held in the escrow. The maker's put exposure, budget, ledger and usage go up.

Errors. 6000, 6002, 6003, 6006 to 6014, 7400 to 7406, 7600, 7602, 8200 to 8203, 8300, 8301, 8302, 8700, 8701, 9200 to 9212.

exercise_put_v3

The maker sells you Q of the asset for your T.

SignerThe maker's owner key or operator. You do not sign.
Argumentsnone
Discriminator8cad659b89ebc94c
#AccountwsWhy
0authoritysMaker owner key or operator (8304).
1market
2maker
3positionw
4strike_escrowwPays T, then is closed.
5writerMust equal the current writer.
6payment_mint
7writer_paymentwYour payment-token account. Gets any extra in the escrow and the escrow's rent (Anchor 2014, 2015).
8payment programSPL Token.
9put_exposurewMaker counter.
10usagewMaker counters.
11maker_payment_vaultwThe maker's vault for this payment token. Receives T.
12collateral_mintThe asset mint.
13put_asset_vaultwThe maker's asset vault, seeds "put-asset-v1", maker, asset. Pays Q.
14writer_collateralwYour asset account. Receives Q.
15collateral program

Checks, in order.

  1. No extra accounts (8300).
  2. Shared put exit checks: canonical put market (9200 and 82xx), canonical put record of this maker (InvalidAccountData, 9201 to 9206), every stored term matches the market and accounts (8300), exposure and usage current and canonical (8300), your payment account clean (7403), the escrow holds at least T (9209), the position is open (6003).
  3. The signer is the maker's owner key or current operator (8304).
  4. expiry <= now < expiry + window (6003).
  5. The asset mint and program match the record (8300).
  6. put_asset_vault is the maker's canonical asset vault for this asset (PutAssetSource 9210) and holds at least Q (7405).
  7. writer_collateral is an asset account you own (8300).
  8. The maker's usage counters accept the close-out (8302).

Token movements.

AmountFromTo
Tstrike_escrowthe maker's maker_payment_vault
Q assetthe maker's put_asset_vaultyour writer_collateral
any payment token above T in the escrowstrike_escrowyour writer_payment
the escrow's rent (SOL)strike_escrow, closedyour writer_payment

State change. OPEN to EXERCISED (2). If the maker's asset vault is short, exercise fails and no tokens move. After the window, release_put_v3 can return your T. No price oracle is read: exercising is the maker's choice, at the fixed strike.

Errors. 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 8304, 9200 to 9206, 9209, 9210, InvalidAccountData.

Flash exercise of a put

A flash put exercise lets the maker settle without holding the asset first. In one transaction it takes your escrowed T, buys the asset through any swap route, gives you exactly Q, and keeps what is left. The pair begin_flash_put_v3 and finish_flash_put_v3 follows the same atomicity rule as a covered call: one transaction, called directly, finish last, one covr pair, protected accounts untouched by the swap, and a transient FLASH state that can never be saved.

begin_flash_put_v3

SignersThe maker's owner key or operator (pays temporary rent), and a temporary delegate key.
Argumentsbegin_index: u16, finish_index: u16, expected_policy_generation: u64, min_asset_atoms: u64
Discriminatord5fa8381e189dfd2
#AccountwsWhy
0authoritywsMaker owner key or operator.
1delegatesMay spend exactly T of the isolated payment token.
2 to 11market, maker, position (w), strike_escrow (w), writer, payment_mint, writer_payment (w), payment program, put_exposure (w), usage (w)Same as exercise_put_v3 accounts 1 to 10.
12collateral_mintAsset mint.
13maker_payment_vaultwThe maker's payment-token vault.
14writer_collateralwYour asset account. Receives Q at finish.
15put_asset_vaultwThe maker's asset vault.
16policyThe maker's flash put policy.
17contextwCreated, seeds "flash-context-v1", position.
18inputwCreated. Temporary payment-token account.
19outputwCreated. Temporary asset account.
20collateral program
21system program
22instructionsThe Instructions sysvar.

Checks, in order. Pairing (9100 to 9103). Shared put exit checks. Signer is the owner key or operator (8304). Exercise window and open state (6003). The flash put policy is canonical (FlashPutPolicySchema 9214), set by the current owner key (9215), enabled (9216), at the expected generation (9217), for an admitted pair matching the record (FlashPutPairUnsupported 9220), within caps (9219). min_asset_atoms is at least max(Q + A, ceil(T × 10^d / R)), where A is the maker's minimum asset surplus and R its maximum price (9222, 9221). The price term rounds up, and R is the maker's own bound, not an oracle. The asset mint and program match (8300). Your writer_collateral is an asset account you own, not frozen, not native, no delegate, no foreign close authority (FlashPutRecipient 9225). put_asset_vault is the maker's canonical asset vault (9225). The delegate signed and aliases nothing protected (9114). The escrow holds at least T (9209). Admitted pairs: JitoSOL with USDC, and JitoSOL with USDT.

Token movements. Exactly T from strike_escrow to the temporary input. The delegate is approved for at most T on input. The swap route may send what it spends to outside accounts; finish fixes the final recipients. State change: OPEN to FLASH, only inside this transaction.

finish_flash_put_v3

SignerNone required. The rent payer must be the begin signer.
Argumentsbegin_index: u16, finish_index: u16
Discriminatorcb9240382921972b

Accounts, in order: rent_payer (w), the ten put delivery accounts, collateral_mint, maker_payment_vault (w), writer_collateral (w), put_asset_vault (w), context (w, closed), input (w, closed), output (w, closed), collateral program, instructions sysvar, event authority, covr program.

Checks, in order. Pairing (9100 to 9103). Context and every bound account (FlashPutContext 9226). The record is in FLASH and unchanged since begin (9118). Temporary accounts still owned by the context, right mints, no close authority (FlashPutEndpoint 9224). New asset in output (D) is at least the floor. Else FlashPutAssetBelowFloor (9223).

Token movements.

AmountFromTo
exactly Q assetoutputyour writer_collateral
D − Q asset, plus any asset in output beforeoutputthe maker's put_asset_vault
payment token left in inputinputthe maker's maker_payment_vault
any payment token left in the escrowstrike_escrowyour writer_payment
the escrow's rent (SOL)strike_escrow, closedyour writer_payment
rent of input, output and contextclosedthe rent payer

State change. FLASH to EXERCISED (2), with the same accounting as exercise_put_v3.

Errors (both). 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 8304, 9100 to 9103, 9114, 9118, 9200 to 9206, 9209, 9214 to 9226, InvalidAccountData.

release_put_v3

Returns your T after the exercise window if the maker did not exercise.

SignerNone required. Anyone can send it, including you. covr's app prepares it for you to sign. The escrow can only go to the position's current writer.
Argumentsnone
Discriminatord66549ed3717d52f

Accounts, in order: market, maker, position (w), strike_escrow (w), writer, payment_mint, writer_payment (w), payment program, put_exposure (w), usage (w).

Checks, in order. No extra accounts (8300). Shared put exit checks, including a clean payment account owned by the current writer (Anchor 2015, 7403) and an escrow holding at least T (9209). The position is open and now >= expiry + window (6003). Usage counters (8302).

Token movements. Everything in the escrow goes to your writer_payment. The escrow is closed and its rent goes to your writer_payment. You keep the premium.

The escrow is the source of this transfer. If the payment token's issuer has frozen it, the program refuses the transfer (7400) and release fails until the issuer thaws the escrow. Choosing a different writer_payment does not help.

State change. OPEN to RELEASED (3). Release reads no pause, policy, budget or ledger.

Errors. 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 9200 to 9206, 9209, Anchor 2014 and 2015, InvalidAccountData.

early_close_put_v3

Lets you end an open put before expiry for a buyback price the maker signed. The price comes out of your escrow. You pay nothing in.

SignerYou, the current writer. You pay rent for the close receipt.
Argumentsclose_nonce: u64, amount_payment_atoms: u64 (A), valid_until: i64, signature: [u8; 65]
Discriminator105f11beb59f3f9a

Accounts, in order: writer (w, s), the ten put delivery accounts, maker_payment_vault (w), close_receipt (w, created at seeds "close-receipt", maker, close_nonce), system program.

Checks, in order.

  1. No extra accounts (8300). Shared put exit checks.
  2. The signer is the current writer (8304).
  3. The position is open and opened_at <= now < expiry (6003).
  4. 0 < A <= T. Else InvalidAmount (6002).
  5. now < valid_until <= expiry, close_nonce >= maker.min_nonce, not u64::MAX (6003).
  6. The original maker's quote key signed EarlyClose in this put market's domain, with you as owner (6000).
  7. Usage counters (8302).

Token movements.

AmountFromTo
Astrike_escrowthe maker's maker_payment_vault
the rest of the escrowstrike_escrowyour writer_payment
the escrow's rent (SOL)strike_escrow, closedyour writer_payment

State change. OPEN to EARLY_CLOSED (4). A permanent close receipt. You keep the premium.

Errors. 6000, 6002, 6003, 7400 to 7406, 8200 to 8203, 8300, 8302, 8304, 9200 to 9206, 9209, InvalidAccountData.

transfer_position_v3x

Hands an open put to another wallet. Same accounts, signer and timing as transfer_position_v3: writer (s), maker, position (w), recipient.

Checks, in order. No extra accounts (8300). Canonical put record (InvalidAccountData, 9201 to 9206). The signer is the current writer (6004). Open, opened_at <= now < expiry, recipient not zero and not you (6003). Recipient a plain wallet (Anchor 3011, 6004).

Effect. The writer changes. The escrow, amounts and maker counters do not. Discriminator 08d70c994e0913e8.

buy_put_position_v3

Sells your open put to a maker's desk for a price it signed. Like buy_position_v3, with the put market's payment token and the buyer's put accounts.

Accounts, in order: seller (w, s), market, original_maker, position (w), buyer_maker, buyer_origin, recipient (the buyer's owner key, a plain wallet), collateral, payment, seller_payment (w), buyer_payment_vault (w), buyer_budget (w), buyer_ledger (w), buyer_mint_policy, purchase_policy, purchase_usage (w), sale_receipt (w, created), payment program, system program. Arguments: nonce, amount, valid_until, auction_id, signature. Discriminator 2407be4b3786b19e.

Checks, in order. No extra accounts (8300). Canonical put market, unchanged asset, plain payment token (9200, 9204, 82xx). Canonical put record (InvalidAccountData). Buyer registration (7600, 7602, 8700, 8701). Buyer purchase accounts its own, for this asset, payment token and put kind (PurchasePolicyForeign 9208, 6010 to 6013). Record terms match the market and strike formula (8301). You are the writer (6004). Open, before expiry, recipient not you (6003). amount > 0 (6002). Market not paused, auction id set, now < valid_until <= expiry + window, nonce at or above the buyer's floor (6003). Buyer budget (8300, 6007) and ledger (9211, 9212). PositionSale signature in the put domain (6000). Buyer purchase policy (8302).

Token movements. amount from the buyer's vault to your seller_payment. State change. The writer becomes the buyer's owner key. The escrow and the original maker's obligation do not change.

close_position_v3x

Deletes a settled put position account and returns its rent. Same accounts, argument and rules as close_position_v3: top level only, signer is the writer, state exercised, released or early-closed, maker nonce floor strictly above the position's nonce, exact 652-byte snapshot. Discriminator 85ad600c71c38c32.

Tokenized-stock calls

Covered calls on tokenized stocks use restricted settlement: the maker first moves the full strike into an escrow, then delivery completes. If delivery stays blocked, both sides can cancel together after seven days. These positions cannot be closed early, transferred, sold or flash-exercised.

covr may list tokenized-stock markets. Their rules are below.

The asset may be a plain 82-byte mint with a freeze authority, or a Token-2022 stock mint with one fixed set of extensions that includes a permanent delegate and a pause switch held by the issuer. The issuer can therefore move or freeze tokens in the position's vault. The program then returns whatever is left and reports the shortfall.

InstructionSignerWhenEffect
fill_restricted_v3 (2e41135430d467ed)YouBefore expirySame accounts and checks as fill_v3, on a restricted market, plus the argument cancellation_timeout_seconds, which must be 604,800 and match the market's terms (RestrictedTerms 8400). Uses the restricted signing domain. Position opens in mode 1.
fund_restricted_exercise_v3 (177b5118031c80c9)Maker owner key or operatorInside the exercise windowMoves exactly T from the maker's vault into a new escrow at seeds "strike-escrow-v3", position. State OPEN to PENDING (1). Sets funded_at = now and cancel_eligible_at = now + 604,800.
complete_pending_delivery_v3 (e95dfae6a23e6f1c)AnyoneAny time after funding, until a cancelThe whole escrow to you, Q asset to the maker's owner key, any extra asset and the vault rent to you, escrow rent to the maker's owner key. State EXERCISED (2).
cancel_pending_delivery_v3 (d42e1cc0f772a695)Both: the maker's owner key and youAfter cancel_eligible_atThe whole escrow back to the maker, the whole vault back to you. You keep the premium. State BILATERALLY_CANCELED (5).
release_restricted_v3 (b98bfe918774a47e)AnyoneAfter the exercise window, only if never fundedWhatever the vault holds goes to you. State RELEASED (3).
close_restricted_position_v3 (3f470697ff5ea278)YouAfter settlementAs close_position_v3, for states exercised, released or canceled.

fund_restricted_exercise_v3

Accounts, in order: authority (w, s, pays the escrow rent), market, maker, position (w), collateral_vault, collateral, collateral program, payment (USDC), payment_vault (w), strike_escrow (w, created), usage (w), payment program, system program. No arguments.

Checks, in order. No extra accounts (8300). Restricted market and record, timeout matches the market (8200 to 8203, 8400, 8300, InvalidAccountData). Signer is the maker's owner key or operator (8304). USDC plain (8300). Vault address matches the record (8300). Position open and unfunded (RestrictedState 8401). expiry <= now < expiry + window (RestrictedTime 8402). Vault still holds at least Q (RestrictedImpaired 8404). Escrow empty and at its canonical address (RestrictedEscrow 8405). Usage counters (8302). After the transfer, the escrow holds exactly T (8405).

Token movements. T USDC from the maker's vault to the escrow. Once funded, the position can no longer be released: only completion or a joint cancel can end it.

complete_pending_delivery_v3

Accounts, in order: caller (s), the ten accounts of release_v3, payment (USDC), strike_escrow (w), writer_payment (w, USDC owned by you, else 8300), maker_collateral (w, owned by the maker's owner key, else 8300), maker_authority (w, the maker's owner key, receives the escrow rent, else 8300), payment program. No arguments.

Checks, in order. No extra accounts (8300). Restricted record and market (82xx, 8400, 8300), writer matches (8300), exposure canonical (8300), writer_collateral clean (7403). USDC plain and escrow address (8300). State PENDING (8401). now >= funded_at (8402). Escrow holds at least T (8405). Vault holds at least Q (8404). Usage counters (8302).

Token movements.

AmountFromTo
everything in the escrow (T plus any extra)strike_escrowyour writer_payment
escrow rent (SOL)escrow, closedthe maker's owner key
Q assetcollateral_vaultmaker_collateral
any asset above Q, then the vault rentcollateral_vault, closedyour writer_collateral

Full delivery only. If any leg is blocked, for example by a frozen account, the whole transaction fails and can be retried later.

cancel_pending_delivery_v3

The bilateral cancel. Both of you must sign the same transaction.

Accounts, in order: maker_signer (w, s, the maker's owner key, never the operator; receives the escrow rent), writer_signer (s, you), the ten accounts of release_v3, payment (USDC), strike_escrow (w), maker_payment (w, a USDC account of the maker's owner key, else 8300), payment program.

The argument is a 288-byte CancellationRequestV1: genesis_hash, program, terms_id, position, maker, writer, intent_generation, refund_strike_usdc, return_collateral_atoms, payment_destination, collateral_destination, valid_until.

Checks, in order.

  1. No extra accounts (8300). Restricted record and market checks, and a clean writer_collateral (7403).
  2. The two signers are the position's maker owner key and its current writer. Else Solana MissingRequiredSignature.
  3. USDC plain and escrow address (8300).
  4. State PENDING (8401) and now >= cancel_eligible_at (8402).
  5. The request names this program, network, terms, position, maker and writer, the current funding round, a refund equal to T, a valid_until in the future, two different non-zero destinations that are not protected accounts, and a return_collateral_atoms no higher than what the vault holds. Else RestrictedApproval (8403).
  6. The escrow holds at least T (8405).
  7. The signers and destinations equal the request, and the destinations are owned by the maker's owner key and by you. Else 8403.
  8. Usage counters (8302).

Token movements. The whole escrow to maker_payment, escrow rent to the maker signer. The whole current vault to your writer_collateral, vault rent too. You keep the premium.

release_restricted_v3

Same accounts as release_v3. Checks: restricted record and market, clean writer_collateral, state OPEN (never funded), now >= expiry + window (8401, 8402). It returns whatever the vault holds, even if an issuer action left less than Q, and closes the vault.

Maker and market settings that touch your position

You never sign these, but they decide whether a fill or a sale can happen. The market pause, mint policies, exposure limit and premium budget never block an exercise, a release, an early close, a transfer or a close. Two settings do reach other paths. The nonce floor cancels early-close and sale quotes signed below it, and a settled position's account can be closed only once the floor is above its nonce. The flash policy decides whether flash exercise can run; ordinary exercise and release do not read it. See Admin and upgrade powers.

SettingWhoWhat it blocks
Market pause (set_market_v3_pause, set_restricted_market_v3_pause, set_market_v3x_pause)The market's creatorNew fills and sales to a desk on that market
Mint policy pause or updateThe maker's owner key, or its watcher for a pauseNew fills by that maker on that asset
Nonce floor (configure_maker)The maker's owner keyEvery quote, early-close quote and sale quote that maker signed below the new floor. Until it is raised above a settled position's nonce, closing that position's account.
Exposure limit, premium budgetThe maker's owner keyNew fills by that maker
Flash policy (update_flash_exercise_policy_v1, disable_flash_exercise_policy_v1, update_flash_put_policy_v1, disable_flash_put_policy_v1)The maker's owner keyFlash exercise of that maker's positions. Not ordinary exercise or release.

Errors

The program has one error list. Anchor numbers covr's errors from 6000. A failed transaction shows the code in hex in its last log line, for example custom program error: 0x1773 for 6003, and the name in an Anchor log line. Some errors add a reason line just above it, starting COVR_TOKEN_ACCOUNTING:, COVR_TOKEN_CUSTODY:, COVR_RESTRICTED: or COVR_MINT_PURCHASE:.

Quote, order and limits

CodeHexNameWhat it means for you
60000x1770BadSignatureThe maker's signature does not match this market, your wallet, the auction, the amounts or the nonce.
60010x1771InvalidTermsA close snapshot is not the account's exact current bytes.
60020x1772InvalidAmountA premium or strike is not a whole number of atoms, or an amount is zero, or a put buyback exceeds T.
60030x1773InvalidOrderWrong time or state: market paused, past expiry, quote expired, nonce below the maker's floor, size out of range, outside the exercise window, release before the deadline, or the position is not open.
60040x1774UnauthorizedYou are not the current writer, or a recipient or refund wallet is not a plain wallet.
60060x1776ExposureLimitThe maker's exposure limit for this asset is full.
60070x1777PremiumBudgetExceededThe maker's premium budget is spent.
60080x1778JitoSolOrderLimitOne JitoSOL fill is worth more than 50 SOL of stake-pool value.
60090x1779InvalidJitoPoolThe Jito stake pool account is wrong, writable, or not yet updated this epoch.
60100x177aMintPolicyIdentityA maker policy or usage account does not belong to this maker, asset or payment token.
60110x177bMintPolicySchemaA maker policy or usage account has the wrong size or version.
60120x177cMintPolicyGenerationA maker policy generation is zero or stale.
60130x177dMintPolicyUnauthorizedA maker policy was signed by the wrong key.
60140x177eMintPolicySettingsA maker policy has invalid settings.

Token custody

Every token movement runs a check first. If the check fails, the transaction fails and no tokens move.

CodeHexNameWhat it means for you
74000x1ce8CustodyInvalidAccountA token account is frozen, not initialized, or has the wrong mint or owner.
74010x1ce9CustodyUnsupportedCapabilityA token account uses a feature the program does not support, such as wrapped SOL.
74020x1ceaCustodyUnauthorizedThe transfer authority is not the expected signer or program address.
74030x1cebCustodyUnsafeRecipientA receiving account has a delegate, or a close authority other than its owner. Use a clean account.
74040x1cecCustodyUnsafeSourceA program-held source account has a delegate or a foreign close authority.
74050x1cedCustodyInvalidAmountA source holds too little (you at fill, the maker at fill or exercise), or an amount is zero.
74060x1ceeCustodyPostTransferMismatchA transfer did not change the balances by exactly the amount.

Maker identity

CodeHexNameWhat it means for you
76000x1db0MakerFenceSchemaThe maker account is malformed.
76020x1db2MakerFenceUnauthorizedThe maker account is not at its canonical address.
80020x1f42MakerOriginStateThe buying desk is not set up for purchases.
87000x21fcMakerMigrationSchemaThe maker's origin record is the wrong kind of account.
87010x21fdMakerMigrationIdentityThe maker's origin record belongs to another maker or deployment.
87030x21ffMakerMigrationTotalsA maker counter would overflow.
87040x2200MakerMigrationLimitA maker cap, counting the maker's earlier history, would be exceeded.
88000x2260MakerMigrationHoldsSchemaWrong number of extra accounts on a covered-call fill, for example a JitoSOL fill without the stake pool.

Markets and positions

CodeHexNameWhat it means for you
82000x2008MarketV3SchemaThe market account is not a market of the expected kind.
82010x2009MarketV3IdentityThe market is not at its own address, or its asset mint changed since creation. New fills on it stay closed.
82020x200aMarketV3TermsThe market's terms are invalid.
82030x200bMarketV3UnsupportedThe asset mint is of a kind the market type does not accept.
83000x206cTokenLifecycleIdentityAn account does not match the position or market: wrong writer, mint, token program, vault, counter, or an extra account.
83010x206dTokenLifecycleTermsThe position's kind or terms do not allow this action.
83020x206eTokenLifecycleAccountingThe maker's policy refused a fill or purchase (reason: Unbootstrapped, Paused, Terms or Limit), or a counter is inconsistent.
83030x206fTokenLifecycleTransferA vault was not empty when it was about to close.
83040x2070TokenLifecycleAuthorityThe signer is not the maker's owner key or operator (exercise), or not the current writer (early close).

Tokenized-stock settlement

CodeHexNameWhat it means for you
84000x20d0RestrictedTermsThe cancellation timeout or terms do not match the market.
84010x20d1RestrictedStateThe position's state does not allow this step.
84020x20d2RestrictedTimeOutside the funding window, or before the cancel date.
84030x20d3RestrictedApprovalThe cancel request does not bind both of you to the exact current amounts and accounts.
84040x20d4RestrictedImpairedThe vault holds less than Q, so funding or delivery is refused.
84050x20d5RestrictedEscrowThe strike escrow is not exactly funded or not where it should be.

Flash exercise

CodeHexNameWhat it means for you
91000x238cFlashNotTopLevelA flash instruction was called from another program.
91010x238dFlashInstructionsSysvarThe Instructions sysvar is not the real one.
91020x238eFlashPairingBegin and finish are not one exact pair with finish last, or another covr instruction is present.
91030x238fFlashProtectedAccountA swap instruction touched a protected account.
91040x2390FlashPolicySchemaThe maker's flash policy is not at its canonical address.
91050x2391FlashPolicyOwnerThe flash policy was not set by the maker's current owner key.
91060x2392FlashPolicyDisabledThe maker turned flash exercise off.
91070x2393FlashPolicyGenerationThe flash policy changed since the maker read it.
91080x2394FlashPolicySettingsInvalid flash policy settings.
91090x2395FlashPolicyLimitQ or T is above the maker's flash caps.
91100x2396FlashPairUnsupportedThe asset and payment pair is not admitted for flash exercise.
91110x2397FlashFloorArithmeticThe floor calculation overflowed.
91120x2398FlashFloorBelowPolicyThe maker's attempt floor is below its own policy floor.
91130x2399FlashPaymentBelowFloorThe swap paid less than the floor. The transaction fails and its instruction effects roll back.
91140x239aFlashDelegateThe temporary key did not sign or reuses a protected key.
91150x239bFlashEndpointA temporary account was changed in a forbidden way.
91160x239cFlashRecipientYour USDC account, or the maker's asset account, is not a clean account of the right owner.
91170x239dFlashContextFinish does not match what begin recorded.
91180x239eFlashPositionStateThe position is not in its flash state, or its bytes changed since begin.

Puts

CodeHexNameWhat it means for you
92000x23f0PositionKindThe market, record or policy is not the kind this instruction accepts.
92010x23f1AccountingVersionA covered-call USDC record or market was sent to a put instruction.
92020x23f2KindNotEnabledCalls are not enabled on the put-style instructions.
92030x23f3KindInvalidThe kind byte is not call or put.
92040x23f4PaymentProfileThe payment token is not a plain 6-decimal token, or it changed since the maker set its policy.
92050x23f5PutFundingA put record carries funding fields it must not have.
92060x23f6PutStateA put record is in a state puts never use.
92070x23f7PutBackingThe maker's put policy has an invalid backing setting.
92080x23f8PurchasePolicyForeignA buyer's purchase accounts are for another desk, asset, payment token or kind.
92090x23f9PutEscrowThe strike escrow does not hold exactly T at fill, or holds less than T at an exit.
92100x23faPutAssetSourceThe asset source is not the maker's put asset vault.
92110x23fbPaymentSpendLedgerThe maker's spend ledger is missing, foreign or malformed.
92120x23fcPaymentSpendBalanceThe maker's budget and ledger disagree, or a ledger counter would overflow.
92130x23fdOriginRequiredA call opening in a non-USDC token needs a newly registered maker.
92140x23feFlashPutPolicySchemaThe maker's flash put policy is not at its canonical address.
92150x23ffFlashPutPolicyOwnerThe flash put policy was not set by the maker's current owner key.
92160x2400FlashPutPolicyDisabledThe maker turned flash put exercise off.
92170x2401FlashPutPolicyGenerationThe flash put policy changed since the maker read it.
92180x2402FlashPutPolicySettingsInvalid flash put policy settings.
92190x2403FlashPutPolicyLimitQ or T is above the maker's flash put caps.
92200x2404FlashPutPairUnsupportedThe pair is not admitted for flash put exercise.
92210x2405FlashPutFloorArithmeticThe floor calculation overflowed.
92220x2406FlashPutFloorBelowPolicyThe maker's attempt floor is below its own policy floor.
92230x2407FlashPutAssetBelowFloorThe swap delivered less asset than the floor. The transaction fails and its instruction effects roll back.
92240x2408FlashPutEndpointA temporary account was changed in a forbidden way.
92250x2409FlashPutRecipientYour asset account, or the maker's asset vault, is not a clean account of the right owner.
92260x240aFlashPutContextFinish does not match what begin recorded.

Errors from Solana, Anchor and the token program

CodeFromWhat it means for you
InvalidAccountDataSolanaThe position is not the canonical, valid record of this maker; or, for a close, it is not settled or the maker's nonce floor is not yet above its nonce.
MissingRequiredSignatureSolanaA close was signed by someone other than the writer, or a bilateral cancel lacks one of the two parties.
0, "already in use"System programAn account the instruction creates already exists: that maker nonce, close nonce or sale nonce was used.
2012Anchor ConstraintAddressA mint, program or recipient is not the one required.
2014, 2015Anchor ConstraintTokenMint, ConstraintTokenOwnerA token account has the wrong mint, or is not owned by the right wallet.
3011Anchor AccountNotSystemOwnedA recipient or refund account is not a plain wallet.
3012Anchor AccountNotInitializedAn account the instruction reads does not exist yet.

Discriminators

The first 8 bytes of instruction data, sha256("global:<name>")[0..8]. Use them to recognise covr instructions in an explorer.

InstructionDiscriminator (hex)
fill_v307aeccf9e765bb35
exercise_v31512034972d6645f
begin_flash_exercise_v321607f587d0e3628
finish_flash_exercise_v30f8709e6f3c10a17
release_v3819397b4f29f4897
early_close_v312c6def3250a3149
transfer_position_v35f31db262b67749a
buy_position_v3a3e54011892f7b92
close_position_v3e3674bd89d761355
fill_put_v37f01bf82e91395ff
exercise_put_v38cad659b89ebc94c
begin_flash_put_v3d5fa8381e189dfd2
finish_flash_put_v3cb9240382921972b
release_put_v3d66549ed3717d52f
early_close_put_v3105f11beb59f3f9a
transfer_position_v3x08d70c994e0913e8
buy_put_position_v32407be4b3786b19e
close_position_v3x85ad600c71c38c32
fill_restricted_v32e41135430d467ed
fund_restricted_exercise_v3177b5118031c80c9
complete_pending_delivery_v3e95dfae6a23e6f1c
cancel_pending_delivery_v3d42e1cc0f772a695
release_restricted_v3b98bfe918774a47e
close_restricted_position_v33f470697ff5ea278