Documentation Index Fetch the complete documentation index at: https://continuum-ec12e897.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The user-facing entry to Continuum. Holds the Market PDA, mints L+S SPL tokens, and exposes the privileged keeper-only single-sided ixns used inside arb cycles.
Devnet ID: 5MBjhNUUguLTPNR5WG6YBUUw7vUcxQ14ARw3NsS3rKu4
Accounts
Market PDA
seeds = [b"market", asset_symbol_bytes]
The central account for one synthetic asset.
Field Type Purpose authorityPubkey Admin signer for update_market fee_recipientPubkey Receives mint/redeem fees (cUSDC ATA) asset_symbolstring Market ticker (e.g., "QQQ") oracle_addressPubkey Pointer to OracleConfig PDA oracle_typeenum Pyth / Hermes / Switchboard / Manuallong_mintPubkey L SPL mint short_mintPubkey S SPL mint collateral_mintPubkey cUSDC mint collateral_vaultPubkey Token account holding all backing cUSDC multi_collateral_enabledbool If true, multiple collateral types accepted mint_fee_bps / redeem_fee_bpsu16 Fees in basis points (10 = 0.10%) total_l_supply / total_s_supplyu64 Outstanding supply (6 decimals) total_collateralu64 Vault balance (6 decimals) is_activebool If false, all mint/redeem reject risk_stateenum Normal / ProxyMode / Stress / Recoveryrisk_state_updated_ati64 Last mirror update unix-ts user_twap_priceu64 Source of L_NAV (6 decimals) twap_updated_ati64 Last TWAP write unix-ts oracle_confidenceu64 Last published confidence (6 decimals) keeper_authorityPubkey Privileged signer for fee-free single-sided ops dev_tax_pctu8 Slice of fee routed to fee_recipient yield_ceiling_bps / deployed_to_yield / yield_enabled / total_yield_harvestedvarious Yield-deployment scaffolding (off by default)
UserCollateralPosition PDA
seeds = [b"user_collateral", owner, market]
Lazy account for users who opt into multi-collateral mode (where the market accepts more than one collateral type, weighted). Most markets don’t use this.
Field Type Purpose ownerPubkey Position owner marketPubkey Bound market long_amount / short_amountu64 Outstanding L+S held by this position collateral_typeenum Which collateral was used collateral_mintPubkey Which mint collateral_amountu64 Total cUSDC-equivalent deposited
FeeWaiver PDA
seeds = [b"fee_waiver", donor, market]
A grant created by donate_to_vault that lets the donor mint/redeem fee-free for some duration.
Field Type Purpose donorPubkey Waiver owner marketPubkey Bound market waiver_end_ati64 Expiry unix-ts total_donatedu64 Cumulative donation total_gap_closed_bpsu64 Cumulative fee-equivalent saved
Instructions
User-facing (anyone can call)
mint_paired(collateral_amount: u64)
Deposits collateral_amount cUSDC, mints matched L and S to the user’s ATAs. Fee collateral_amount × mint_fee_bps / 10_000 goes to dev_token_account.
→ Full mint flow
redeem_paired(l_amount: u64, s_amount: u64)
Burns L and S in independent quantities, returns l_amount × L_NAV + s_amount × S_NAV - fee cUSDC.
→ Full redeem flow
mint_paired_with_waiver(collateral_amount: u64) / redeem_paired_with_waiver(l_amount: u64, s_amount: u64)
Same as the above but consume an active FeeWaiver to skip the fee. Requires the market vault to be over-collateralized (≥102%) for the waiver to apply.
donate_to_vault(amount: u64)
Donate cUSDC into the market’s collateral vault. Creates or extends a FeeWaiver for the donor. Used by power users to earn fee-free mint/redeem in exchange for boosting vault collateralization.
permissionless_burn
Burns excess L or S in the donor wallet without redemption. Used when token supply needs to drop without affecting the vault - niche flow, used rarely.
Keeper-privileged (signer = market.keeper_authority)
keeper_mint_single(is_long: bool, collateral_amount: u64)
Fee-free, single-sided mint at NAV. Deposits collateral_amount cUSDC, mints only the chosen side’s tokens at NAV. Used inside arb cycles.
Argument Effect is_long = trueReceive collateral_amount / L_NAV long tokens is_long = falseReceive collateral_amount / S_NAV short tokens
No mint fee, no worst-case quoting markup, no q-imbalance check. Solvency is preserved across the arb cycle, not within this single instruction - see Solvency invariants .
keeper_redeem_single(is_long: bool, token_amount: u64)
Fee-free, single-sided redeem at NAV. Burns token_amount of the chosen side, returns token_amount × NAV cUSDC.
keeper_burn_single
Burn only - no cUSDC transfer. Used for residue cleanup in edge cases.
update_risk_state(new_state: RiskState)
Mirrors oracle health into the market’s risk_state field. Called by the keeper every cycle when the derived state differs.
withdraw_excess_to_clp
Sweeps excess vault balance (above 1.02 × NAV-weighted supply) to the CLP. Used during over-donation cleanup.
Admin (signer = market.authority)
initialize_market(asset_symbol, oracle_type, initial_l_price, initial_s_price, mint_fee_bps, redeem_fee_bps, keeper_authority)
Create a new market. Allocates Market PDA, creates L and S SPL mints (mint authority = market PDA), creates the collateral vault.
Argument Type Notes asset_symbolString ≤ 16 chars oracle_typeenum Pyth / Hermes / Switchboard / Manualinitial_l_price / initial_s_priceu64 6-decimal cUSDC. Constant-product anchor mint_fee_bps / redeem_fee_bpsu16 Max 1000 (10%) keeper_authorityPubkey Initial keeper signer pubkey
update_market(...) / update_keeper_authority(new_keeper) / update_market_oracle
Admin updates to fee, oracle pointer, keeper authority. Bound to market.authority.
Configure per-state confidence multipliers used in mint pricing markup.
Per-state fee adjustments (rare; defaults are usually fine).
enable_multi_collateral, add_collateral_vault, update_collateral_vault
Multi-collateral mode (accept multiple stablecoin/equity tokens as collateral with weights). Off for most markets; enabled per-market by admin if needed.
Errors
Code Name Cause 6000 MarketNotActiveis_active = false6001 InvalidAmountZero or negative 6002 InsufficientCollateralVault can’t cover redeem 6003 InvalidOracleOracle account mismatch 6004 UnsupportedOracleTypeBad oracle_type value 6005 OraclePriceUnavailableOracle paused or missing 6006 MathOverflowShould be unreachable 6007 SymbolTooLongSymbol > 16 chars 6008 FeeTooHighFee bps > 1000 (10%) 6009 MintNotAllowedInStressRisk state is Stress 6010 RedeemNotAllowedInStressReserved (redeem in Stress is currently allowed) 6011 ExceedsStressMintCapRisk state is ProxyMode/Recovery and amount > throttled cap 6012 TwapNotAvailableTWAP buffer not yet populated 6013 AlreadyEnabledMulti-collateral already on 6014 MultiCollateralNotEnabledTried to add collateral type without enabling 6015 MaxCollateralTypesExceededMore than 5 collateral types 6016 InvalidWeightMulti-collateral weight not in [1, 10000] bps 6017 CollateralAlreadyExistsDuplicate collateral mint 6018 CollateralNotFoundUnknown collateral type 6019 BelowMinimumMint < 10 cUSDC 6020 UnauthorizedKeeperSigner ≠ market.keeper_authority 6021 UnauthorizedSigner ≠ market.authority 6022 InsufficientLiquidCollateralYield deployed; recall first 6023 ExceedsYieldCeilingDeployment > yield_ceiling_bps 6024 YieldManagementDisabledyield_enabled = false6025 RecallExceedsDeployedRecall > deployed balance
→ Full error catalog
TypeScript
import { Program , BN } from "@coral-xyz/anchor" ;
import { PublicKey } from "@solana/web3.js" ;
import idl from "./mint_redeem.json" ;
const program = new Program ( idl , provider );
const [ marketPDA ] = PublicKey . findProgramAddressSync (
[ Buffer . from ( "market" ), Buffer . from ( "QQQ" )],
program . programId ,
);
const market = await program . account . market . fetch ( marketPDA );
console . log ( "L mint:" , market . longMint . toBase58 ());
console . log ( "Risk:" , Object . keys ( market . riskState )[ 0 ]);
→ Full mint+redeem example
See also
Mint flow Step-by-step mint_paired walkthrough.
Redeem flow Step-by-step redeem_paired walkthrough.