Skip to content
ReferenceAPI reference

Reference

API reference

All amounts are raw base units. All per-asset vectors follow the pool's asset order, quote mint (USDC) first.

InstructionArgumentsSignerDoes
publishPublishArgs { id, weights_bps, gamma_bps, covenant, glide }authorcreates the pool, its LP mint and vaults; status OPENING
seedamounts: Vec<u64>authorfirst liquidity, each amount at least 1,000; locks 1,000 shares; status ACTIVE
depositshares, max_amountsholderpays ceil(x_i * shares / S) of every asset, mints shares
withdrawshares, min_amountsholderburns shares, pays floor(x_i * shares / S) of every asset
withdraw_deferringshares, min_amounts, skip_maskholderas withdraw, leaving masked assets as a DeferredClaim
claim_deferredindex: u8holdercollects one deferred asset once it can move
updatedeltas: Vec<i64>traderthe trade; accepted only if Definition 3 holds
reviseto_bps, end, gamma_bpsauthornew target inside the covenant, glided to by end; fee step inside bounds
claim_royaltynoneauthormints the author's owed shares
claim_protocolnoneanyonemints the treasury's owed shares to the configured treasury

Types

pub struct Covenant {
    pub caps_bps: Vec<u16>,     // one per asset, 100..=10000
    pub cash_floor_bps: u16,    // minimum weight of the quote asset, <= its cap
    pub gamma_min_bps: u16,     // fee bounds, inside 10..=2000
    pub gamma_max_bps: u16,
    pub royalty_bps: u16,       // <= 2000, share of fee growth
}

pub struct Glide { pub to_bps: Vec<u16>, pub start: i64, pub end: i64 }

Constants

NameValueMeaning
MAX_ASSETS / MIN_ASSETS8 / 2assets per fund
MIN_WEIGHT_BPS1001% floor on any weight
GAMMA_FLOOR_BPS / GAMMA_CEIL_BPS10 / 2,000program-wide fee bounds
MAX_GAMMA_STEP_BPS25largest fee change per revision
GAMMA_STEP_COOLDOWN86,400 sbetween fee changes
MAX_ROYALTY_BPS2,000royalty ceiling
PROTOCOL_FEE_BPS1,000protocol share of fee growth
MAX_DRIFT_WAD_PER_DAY0.02 WAD2 points a day
INDEX_EMA_SECONDS86,400index smoothing
LOCKED_SHARES1,000shares locked at seed
INVARIANT_MARGIN1e-14 (in WAD)margin every update must clear