

The venue abstraction: internal curve and AMM versus Meteora DBC.
Real reserves
Unlike the launch curve’s virtual reserves, the AMM holds real assets:amm_sol_reserve: lamports, held in the market’s SOL vaultamm_token_reserve: synth base units, held in the market’s pool token account
Swaps
amm_buy(sol_in, min_tokens_out) and amm_sell(tokens_in, min_sol_out) are standard constant-product swaps with a fee in bps taken on the SOL side:
fee_lamports (withdrawable by the admin, see Instructions). Buys transfer tokens out of the pool account; sells transfer them back in. AMM trading neither mints nor burns supply.
Spot and mark
The pool’s spot price, expressed in lamports per whole unit (the same scale as the index):mark_ema, a time-weighted EMA of spot updated on every swap and every funding crank:
What the mark does and does not touch
The mark’s only job is steering funding. Collateral and liquidation math never read the pool, so manipulating the AMM cannot force anyone’s liquidation. See Price Index and Liquidations.
Venues
Every market carries avenue field, and the internal AMM documented above is one of two shipped venues:
- Internal: the program’s own curve and AMM. Fixed supply preminted at creation with the mint authority revoked; the mark comes from the pool’s own swaps. Everything above applies.
- External: the token launched on Meteora Dynamic Bonding Curve and trades in a DAMM pool. The market attaches to the existing mint via
create_external_market, starts directlyLive, and the internal curve/AMM instructions reject withWrongVenue. Liquidity lives in Meteora’s audited, Jupiter-routed infrastructure; commas keeps the synthetic core (index, shorts, funding, liquidations).
- Mark is oracle-pushed. The program never parses external pool bytes on chain. The price feed (the relayer) computes the pool price from Meteora’s public API and pushes it via
push_mark; it lands in the samemark_emasmoothing above, and a bad push can only tilt the clamped funding flow, matching the trust already placed in the oracle key for the index. - Treasury reserve for CDP supply. Both venues run the same fixed-supply path:
open_shortdraws tokens from a program-held treasury (["treasury", market]) andrepay_burn/liquidatereturn them. The reserve balance is a physical open-interest ceiling (TreasuryDepleted), enforced by token balances rather than a parameter; internal markets premint it, external markets fund it at listing.


Price impact of a buy against the 100 SOL opening pool; impact halves as the pool deepens.

