Constants

Defined in state.rs and used throughout the account math: All prices per underlying unit (index, mark) are in lamports per whole NFT/card, so the target price per token base unit is index / 1e12.

Global

Singleton at ["global"]. Created once by init_global.

MarketParams

Embedded in both Global (defaults) and each Market (active values). Updatable post-creation via update_market_params, except the curve virtual reserves. See Parameters for tuning guidance.

Market

One per underlying at ["market", collection].

Identity and status

Oracle index

Curve state

AMM state

Funding and CDP aggregates

Vault accounting and bumps

Helper math (on-chain)

ItemRegistration

One per (market, item mint) at ["item", market, item_mint]. Created by register_item; its existence is what makes a specific on-chain copy (a vaulted-card NFT, a collection NFT) depositable via item swaps.

ShortPosition

One per (market, owner) at ["short", market, owner]. Created lazily by open_short, closed by close_position.

Funding-scaled debt

Debt is not stored as a token amount. It is stored divided by the market’s funding_index at the moment it was incurred, in FUNDING_ONE fixed point:
Because every position’s current debt is a multiplication by the same global funding_index, a single funding crank reprices every short in the market with one account write. When the mark trades above the index the funding index falls and every short’s debt shrinks; below the index it grows.