Skip to main content

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.
FieldTypePurpose
authorityPubkeyAdmin signer for update_market
fee_recipientPubkeyReceives mint/redeem fees (cUSDC ATA)
asset_symbolstringMarket ticker (e.g., "QQQ")
oracle_addressPubkeyPointer to OracleConfig PDA
oracle_typeenumPyth / Hermes / Switchboard / Manual
long_mintPubkeyL SPL mint
short_mintPubkeyS SPL mint
collateral_mintPubkeycUSDC mint
collateral_vaultPubkeyToken account holding all backing cUSDC
multi_collateral_enabledboolIf true, multiple collateral types accepted
mint_fee_bps / redeem_fee_bpsu16Fees in basis points (10 = 0.10%)
total_l_supply / total_s_supplyu64Outstanding supply (6 decimals)
total_collateralu64Vault balance (6 decimals)
is_activeboolIf false, all mint/redeem reject
risk_stateenumNormal / ProxyMode / Stress / Recovery
risk_state_updated_ati64Last mirror update unix-ts
user_twap_priceu64Source of L_NAV (6 decimals)
twap_updated_ati64Last TWAP write unix-ts
oracle_confidenceu64Last published confidence (6 decimals)
keeper_authorityPubkeyPrivileged signer for fee-free single-sided ops
dev_tax_pctu8Slice of fee routed to fee_recipient
yield_ceiling_bps / deployed_to_yield / yield_enabled / total_yield_harvestedvariousYield-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.
FieldTypePurpose
ownerPubkeyPosition owner
marketPubkeyBound market
long_amount / short_amountu64Outstanding L+S held by this position
collateral_typeenumWhich collateral was used
collateral_mintPubkeyWhich mint
collateral_amountu64Total 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.
FieldTypePurpose
donorPubkeyWaiver owner
marketPubkeyBound market
waiver_end_ati64Expiry unix-ts
total_donatedu64Cumulative donation
total_gap_closed_bpsu64Cumulative 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 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.
ArgumentEffect
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.
ArgumentTypeNotes
asset_symbolString≤ 16 chars
oracle_typeenumPyth / Hermes / Switchboard / Manual
initial_l_price / initial_s_priceu646-decimal cUSDC. Constant-product anchor
mint_fee_bps / redeem_fee_bpsu16Max 1000 (10%)
keeper_authorityPubkeyInitial 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_worst_case_quoting(enabled, normal_mult, proxy_mult, stress_mult)

Configure per-state confidence multipliers used in mint pricing markup.

configure_risk_fees

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

CodeNameCause
6000MarketNotActiveis_active = false
6001InvalidAmountZero or negative
6002InsufficientCollateralVault can’t cover redeem
6003InvalidOracleOracle account mismatch
6004UnsupportedOracleTypeBad oracle_type value
6005OraclePriceUnavailableOracle paused or missing
6006MathOverflowShould be unreachable
6007SymbolTooLongSymbol > 16 chars
6008FeeTooHighFee bps > 1000 (10%)
6009MintNotAllowedInStressRisk state is Stress
6010RedeemNotAllowedInStressReserved (redeem in Stress is currently allowed)
6011ExceedsStressMintCapRisk state is ProxyMode/Recovery and amount > throttled cap
6012TwapNotAvailableTWAP buffer not yet populated
6013AlreadyEnabledMulti-collateral already on
6014MultiCollateralNotEnabledTried to add collateral type without enabling
6015MaxCollateralTypesExceededMore than 5 collateral types
6016InvalidWeightMulti-collateral weight not in [1, 10000] bps
6017CollateralAlreadyExistsDuplicate collateral mint
6018CollateralNotFoundUnknown collateral type
6019BelowMinimumMint < 10 cUSDC
6020UnauthorizedKeeperSigner ≠ market.keeper_authority
6021UnauthorizedSigner ≠ market.authority
6022InsufficientLiquidCollateralYield deployed; recall first
6023ExceedsYieldCeilingDeployment > yield_ceiling_bps
6024YieldManagementDisabledyield_enabled = false
6025RecallExceedsDeployedRecall > 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.