covr.Docs

Concepts

Capital and settlement

Your desk holds USDC in one vault on chain. The program takes the premium from it when an order fills. It takes the strike from it only if you exercise with exercise_v3. With a flash policy you can exercise without holding the strike: see Flash exercise. Nothing is escrowed per position.

Money flow of one position

WhenWho signsWhat moves
FillCustomerGross premium leaves your vault. The customer receives it minus the market fee. The fee goes to the market's fee owner. The customer's JitoSOL is locked in a position account.
Exercise (optional)You (authority or operator)Inside the exercise window: the strike leaves your vault and goes to the customer. The locked JitoSOL goes to your authority's token account.
Flash exercise (optional, instead of exercise)You (authority or operator), plus a temporary delegate keyInside the exercise window, in one transaction: the JitoSOL is sold by your swap, the customer receives the strike from the proceeds, and the rest goes to your vault. Needs a flash policy.
ReleaseAnyoneAfter the window, if you did not exercise: the JitoSOL goes back to the customer. Your exposure and usage are freed.

The formulas

All amounts are integers in atoms, a token's smallest unit. USDC has 6 decimals (1 USDC = 10^6 atoms). JitoSOL has 9 (1 JitoSOL = 10^9 atoms).

AmountFormulaSDK
Gross premiumatoms × priceE18 / 10^(decimals + 12)grossPremium
Feefloor(gross × feeBps / 10000), feeBps at most 1,000fee
Customer receivesgross − feewriterPremium
Strike paymentatoms × strikeE8 / 10^(decimals + 2)strikePayment

priceE18 is USDC per one whole token, scaled by 10^18. strikeE8 is USD per token, scaled by 10^8. Gross premium and strike payment must both come out as whole USDC atoms. If they don't, the program refuses the fill. Use exactPriceAtOrBelow to round your price down to one that pays exactly.

Worked example

A customer sells 1 JitoSOL at a $180 strike. You bid 3.40 USDC per token. The market fee is 10% (feeBps = 1000).

ts
import { grossPremium, fee, writerPremium, strikePayment } from '@covrfun/maker-sdk';

const atoms = 1_000_000_000n;                 // 1 JitoSOL
const priceE18 = 3_400_000_000_000_000_000n;  // 3.40 USDC per token
const strikeE8 = 18_000_000_000n;             // $180

const gross = grossPremium(atoms, priceE18, 9); // 3_400_000n   = 3.40 USDC leaves your vault at fill
fee(gross, 1000);                               // 340_000n     = 0.34 USDC to the fee owner
writerPremium(gross, 1000);                     // 3_060_000n   = 3.06 USDC to the customer
strikePayment(atoms, strikeE8, 9);              // 180_000_000n = 180 USDC if you exercise
console.log(gross, fee(gross, 1000), writerPremium(gross, 1000), strikePayment(atoms, strikeE8, 9));
JitoSOL at expiryYour choiceYour result
$170Do not exercise−3.40 USDC (the premium)
$183.40ExercisePay 180 USDC for JitoSOL worth 183.40: +3.40, so you break even
$200ExercisePay 180 USDC for JitoSOL worth 200: +20, so +16.60 net

Break-even is strike plus premium per token. The most you can lose on a position is the premium.

What your vault must hold

MomentMinimum in the vault
Each fillThat fill's gross premium. Otherwise the fill fails.
Each exercise_v3That position's strike payment. Otherwise the exercise fails.
Each flash exerciseNothing. The strike comes from selling the position's JitoSOL in the same transaction.

The program does not set the strike aside when a position opens. You decide how much strike to cover:

  • Fully funded. Keep every open strike in the vault. Simple and safe.
  • Just in time. Keep premiums in the vault and top it up before you exercise. Positions on one market all expire together, and the exercise window is 60 to 3,600 seconds, so plan the top-up ahead.
  • Flash. Keep no strike. Create a flash policy and, at expiry, exercise with a swap in the same transaction. The swap must return at least your floor, or the transaction fails and nothing moves. You need your own swap route: the SDK has no flash builders yet. See Flash exercise.

Without a flash policy, the vault must hold the strike. That is the default for every desk.

Warning

If the vault cannot pay the strike, exercise_v3 fails. A flash exercise fails if your swap returns less than your floor. If you still have not exercised when the window closes, anyone can release the JitoSOL back to the customer. You lose the premium and the position's value.

Withdrawals

Your authority can withdraw USDC from the vault at any time. A withdrawal is not checked against anything you owe: the program reserves nothing for open strikes or for quotes you signed. Withdraw too much and those exercises and fills fail.

Before you withdraw, stop quoting and wait for your outstanding quotes to expire. Then leave at least the strikes you may still pay. The package's example script does this check for you: see Withdraw USDC.

Limits you set on yourself

Six on-chain limits cap your risk. You set all of them with your authority.

LimitScopeSet with
ExposureOpen JitoSOL atoms across all marketsinitializeExposureV3
Max order sizeJitoSOL atoms in one fillinitializeMintPolicyV1 (maxOrderAtoms)
Reserved collateralOpen JitoSOL atoms under this policyinitializeMintPolicyV1 (maxReservedAtoms)
Reserved strikeOpen strike obligations, in USDC atomsinitializeMintPolicyV1 (maxReservedStrikeUsdc)
Mint lifetime premiumLifetime premium paid on this mint, in USDC atoms. Optional.mintPolicySettingsFor (lifetimePremiumLimitUsdc)
Premium budgetLifetime gross premium paid across all mints, in USDC atoms. Optional. Disabled means no cap. It never resets.setPremiumBudget

A fill that would break any limit fails on chain. Change the exposure limit later with setExposureLimit, and the mint policy with updateMintPolicyV1.

The program adds one limit of its own: one JitoSOL order can be worth at most 50 SOL of stake-pool value. It was 2 SOL until the program upgrade of 4 November 2026. The limit is counted in SOL, so in JitoSOL it shrinks slowly as JitoSOL earns staking yield. Larger fills fail with JitoSolOrderLimit (6008), so a quote for more can never fill.

A market's own maximum does not raise this limit. covr's customer app and server also apply their own per-order limits, which can be lower; their current values are to confirm with covr.

Next