Constants#
<!-- Generated by scripts/generate_docs_constants.mjs. Edit source declarations or scripts/docs_constants_notes.md, then regenerate. -->This page is generated from the Rust constant homes and canonical IDL in the
same checkout. Values are protocol defaults or hard bounds; consumers
must read the deployed config for governance-controlled settings. fee_cap_bps = 0
disables taker fees. See market economics.
Time Constants#
Unix timestamps and durations use seconds. A native market ID is the integer quotient of its window start timestamp and duration; its PDA also includes the feed and creator. Creation, expiration, and claim windows are distinct.
Market Timing#
For duration d and Unix time t, market_id = floor(t / d),
window_start = market_id * d, and window_end = window_start + d.
Use the market's stored end time for live lifecycle decisions; an ID alone
does not establish account identity or an external market's schedule.
Price Constants#
Prices use basis points of a complete binary payout. Quantities and settlement amounts use the settlement mint's base units. Multiplication must preserve integer precision and apply the program's rounding rules.
Fee Curve Parameters#
The default cap and decay rate appear in the fee constants table below.
For the fee's price input p, the integer rate is
min(fee_cap_bps, floor(decay_rate_bps * (P_MAX - p) / P_MAX)).
Allocation percentages apply to the collected fee, not trade notional.
Order Book Limits#
Capacity is selected per market, per side. See the deep orderbook contract for supported tiers and allocation formulas. Match limits bound iterations, including self-trade handling and stale-order cleanup, not just successful fills.
Rent Costs#
Query Solana RPC getMinimumBalanceForRentExemption with the complete account
allocation in bytes and the intended commitment. For a variable orderbook or
ledger, calculate the allocation for the selected capacity first. The returned
lamports cover rent exemption only; transaction fees and protocol reward
reserves are separate. Never use a fixed SOL estimate for all capacity tiers.
Oracle Constants#
Native markets consume authenticated Pyth Receiver updates. Compile-time oracle program identities and feed binding are documented in the oracle design. External markets have a separate proof-verification policy and timing contract.
External Resolver Constants#
Source-level Reclaim and external-market limits appear in the protocol table. Read external markets and Reclaim integration for the account and proof requirements.
Protocol constants#
| Constant | Value | Rust type | Source expression |
|---|---|---|---|
PROTOCOL_VERSION | 1 | u8 | 1 |
SETTLEMENT_MINT_DECIMALS | 6 | u8 | 6 |
SPL_TOKEN_ACCOUNT_SIZE | 165 | usize | 165 |
SPL_MINT_ACCOUNT_SIZE | 82 | usize | 82 |
P_MAX | 10000 | u16 | 10_000 |
BPS_DIVISOR | 10000 | u64 | 10_000 |
MAX_RECLAIM_CLAIM_FUTURE_SKEW_SECONDS | 30 | i64 | 30 |
RECLAIM_V1_BEGIN_HEAP_FRAME_BYTES | 65536 | u32 | 64 * 1024 |
RECLAIM_V1_TRANSITION_HEAP_FRAME_BYTES | 65536 | u32 | 64 * 1024 |
RECLAIM_V1_BEGIN_COMPUTE_UNIT_CEILING | 500000 | u64 | 500_000 |
RECLAIM_V1_PER_EXTRA_ATTESTOR_COMPUTE_UNITS | 30000 | u64 | 30_000 |
RECLAIM_V1_OPEN_COMPUTE_UNIT_CEILING | 175000 | u64 | 175_000 |
RECLAIM_V1_TRANSITION_COMPUTE_UNIT_CEILING | 400000 | u64 | 400_000 |
MAKER_BAND_BPS | 1000 | u16 | 1000 |
STATIC_MIN_BPS_FOR_BAND | 100 | u16 | 100 |
STATIC_MAX_BPS_FOR_BAND | 9900 | u16 | 9900 |
DEFAULT_MAX_ORDER_SIZE | 1000000000000 | u64 | 1_000_000_000_000 |
MAX_MATCH_LIMIT | 12 | u8 | 12 |
MIN_ORDER_TTL_SECONDS | 60 | u32 | 60 |
DEFAULT_MATCH_LIMIT | 12 | u8 | MAX_MATCH_LIMIT |
MAX_TAKER_FEE_BPS | 500 | u16 | 500 |
MAX_TICK_SIZE_BPS | 1000 | u16 | 1000 |
MIN_TICK_SIZE_BPS | 1 | u16 | 1 |
DEFAULT_MIN_RESTING_NOTIONAL | 2 | u64 | 2 |
PLACE_ORDER_HEAP_FRAME_BYTES | 65536 | u32 | 64 * 1024 |
MAX_HEAP_FRAME_BYTES | 262144 | u32 | 256 * 1024 |
HEAP_FRAME_GRANULARITY_BYTES | 1024 | u32 | 1024 |
PLACE_ORDER_HEAP_BYTES_PER_BATCHED_ORDER | 21504 | u32 | 21 * 1024 |
SECONDS_PER_DAY | 86400 | i64 | 86_400 |
MAX_PERMITTED_DATA_INCREASE | 10240 | usize | 10_240 |
DEFAULT_MARKET_DURATION | 900 | u64 | 900 |
MIN_MARKET_DURATION | 60 | u64 | 60 |
MAX_MARKET_DURATION | 604800 | u64 | 604_800 |
MAX_CREATION_WINDOW | 86400 | i64 | SECONDS_PER_DAY |
MARKET_EXPIRY_WINDOW | 604800 | i64 | 604_800 |
MAX_EXTERNAL_CLOSE_HORIZON_SECONDS | 31536000 | i64 | 365 * SECONDS_PER_DAY |
SUPPORTED_EXTERNAL_TEMPLATE_VERSION | 2 | u16 | 2 |
MIN_EXTERNAL_EXPIRATION_WINDOW_SECONDS | 2592000 | u64 | 30 * SECONDS_PER_DAY as u64 |
DEFAULT_CLOSER_REWARD_LAMPORTS | 200000 | u64 | 200_000 |
CLOSER_REWARDS_PER_MARKET | 5 | u64 | 5 |
REFERRAL_DURATION_SECONDS | 31536000 | i64 | 365 * 86_400 |
POSITION_REFERRAL_CACHE_VERSION | 1 | u8 | 1 |
POSITION_REFERRAL_FLAG_BOUND | 1 | u8 | 0x01 |
MAX_REFERRAL_ROLLUP_POSITIONS | 8 | usize | 8 |
REFERRAL_FORFEIT_GRACE_SECONDS | 604800 | i64 | 604_800 |
FEE_CONFIG_RATE_LIMIT_SECONDS | 3600 | i64 | 3_600 |
MAX_TREASURY_RECIPIENTS | 8 | usize | 8 |
REBALANCE_ALERT_RATIO | 4 | u64 | 4 |
TREASURY_UPDATE_RATE_LIMIT_SECONDS | 3600 | i64 | FEE_CONFIG_RATE_LIMIT_SECONDS |
OPERATIONAL_PARAMS_RATE_LIMIT_SECONDS | 3600 | i64 | FEE_CONFIG_RATE_LIMIT_SECONDS |
MICROSTRUCTURE_UPDATE_RATE_LIMIT_SECONDS | 3600 | i64 | FEE_CONFIG_RATE_LIMIT_SECONDS |
Source: program/src/constants.rs.
Fee constants#
| Constant | Value | Rust type | Source expression |
|---|---|---|---|
MAX_FEE_CAP_BPS | 500 | u16 | 500 |
MAX_DECAY_RATE_BPS | 1000 | u16 | 1_000 |
MIN_PROTOCOL_SHARE_BPS | 2000 | u16 | 2_000 |
MAX_PROTOCOL_SHARE_BPS | 5000 | u16 | 5_000 |
MIN_REFERRAL_SHARE_BPS_OF_FEE | 1 | u16 | 1 |
MAX_MAKER_REBATE_SHARE_BPS | 4000 | u16 | 4_000 |
MAX_MAKER_REBATE_MIN_REST_SECONDS | 3600 | u32 | 3_600 |
DEFAULT_FEE_CAP_BPS | 200 | u16 | 200 |
DEFAULT_DECAY_RATE_BPS | 400 | u16 | 400 |
Source: program/src/logic/fee.rs.
Configuration limits and defaults#
| Constant | Value | Rust type | Source expression |
|---|---|---|---|
CONFIG_ACCOUNT_SIZE | 576 | usize | 576 |
MAX_SPLINE_MID_JUMP_RESET_BPS | 9997 | u16 | crate::constants::P_MAX - 3 |
AUTHORITY_TIMELOCK_SECONDS | 172800 | i64 | 60 * 60 * 48 |
SIZE | 576 | usize | CONFIG_ACCOUNT_SIZE |
DEFAULT_SPLINE_MIN_COMMITMENT | 10000000 | u64 | 10_000_000 |
DEFAULT_MAKER_REBATE_MIN_REST_SECONDS | 10 | u32 | 10 |
MAX_TAKER_FEE_BPS | 500 | u16 | 500 |
MIN_TICK_SIZE_BPS | 1 | u16 | crate::constants::MIN_TICK_SIZE_BPS |
MAX_TICK_SIZE_BPS | 1000 | u16 | crate::constants::MAX_TICK_SIZE_BPS |
DEFAULT_MIN_MARKET_DURATION | 60 | u64 | 60 |
DEFAULT_MAX_MARKET_DURATION | 604800 | u64 | 604_800 |
MIN_REFERRAL_SHARE_BPS_OF_FEE | 1 | u16 | crate::logic::fee::MIN_REFERRAL_SHARE_BPS_OF_FEE |
MAX_MIN_RESTING_NOTIONAL | 100000000 | u64 | 100_000_000 |
MAX_CLOSER_REWARD_LAMPORTS | 1000000 | u64 | crate::constants::DEFAULT_CLOSER_REWARD_LAMPORTS * crate::constants::CLOSER_REWARDS_PER_MARKET |
MAX_PRICE_STALENESS_SECONDS | 3600 | u64 | 3_600 |
MAX_EXPIRATION_WINDOW_SECONDS | 2592000 | u64 | 30 * 86_400 |
MAX_CONFIGURABLE_MARKET_DURATION | 604800 | u64 | crate::constants::MAX_MARKET_DURATION |
MAX_CONFIGURABLE_ORDER_SIZE | 1000000000000 | u64 | crate::constants::DEFAULT_MAX_ORDER_SIZE |
Source: program/src/state/config.rs.
Four-Way Fee Split#
| Allocation | Basis points of collected fee |
|---|---|
protocol_bps | 5000 |
creator_bps | 500 |
referral_bps | 500 |
maker_bps | 4000 |
Account Sizes#
Size declarations below come directly from account source files. Unevaluated Rust layout expressions are shown explicitly. Variable accounts require their capacity-dependent tail; a header size is not their total allocation.
| Source | Constant | Bytes or Rust layout expression |
|---|---|---|
asset.rs | ASSET_STATE_SIZE | 128 |
asset.rs | SIZE | ASSET_STATE_SIZE |
config.rs | CONFIG_ACCOUNT_SIZE | 576 |
config.rs | SIZE | CONFIG_ACCOUNT_SIZE |
config.rs | MAX_CONFIGURABLE_ORDER_SIZE | crate::constants::DEFAULT_MAX_ORDER_SIZE |
deep_orderbook.rs | DEEP_ORDERBOOK_HEADER_SIZE | 128 |
deep_orderbook.rs | DEEP_ORDERBOOK_MAX_ACCOUNT_SIZE | DeepOrderbookCapacityTier::T4096.account_size() |
deep_orderbook.rs | SIZE | DEEP_ORDERBOOK_HEADER_SIZE |
deep_orderbook.rs | SIZE | 32 |
deep_orderbook.rs | SIZE | 32 |
external_market_policy.rs | EXTERNAL_MARKET_POLICY_V1_SIZE | 640 |
fee_accounts.rs | REFERRER_EARNINGS_ACCOUNT_SIZE | 72 |
fee_accounts.rs | SIZE | REFERRER_EARNINGS_ACCOUNT_SIZE |
fee_accounts.rs | REFERRAL_ACCOUNT_SIZE | 104 |
fee_accounts.rs | SIZE | REFERRAL_ACCOUNT_SIZE |
market.rs | MARKET_ACCOUNT_SIZE | 464 |
market.rs | SIZE | MARKET_ACCOUNT_SIZE |
market_meta.rs | MARKET_META_ACCOUNT_SIZE | 384 |
oracle_contest.rs | ORACLE_CONTEST_ACCOUNT_SIZE | 136 |
oracle_observation.rs | ORACLE_OBSERVATION_ACCOUNT_SIZE | 112 |
orderbook.rs | ORDER_SIZE | 96 |
orderbook.rs | SIZE | ORDER_SIZE |
position.rs | USER_POSITION_ACCOUNT_SIZE | 256 |
position.rs | SIZE | USER_POSITION_ACCOUNT_SIZE |
preallocation_receipt.rs | PREALLOCATION_RECEIPT_SIZE | 384 |
preallocation_receipt.rs | SIZE | PREALLOCATION_RECEIPT_SIZE |
resolver_registry.rs | RESOLVER_REGISTRY_ACCOUNT_SIZE | 1024 |
spline.rs | SPLINE_ACCOUNT_SIZE | 896 |
spline.rs | SIZE | SPLINE_ACCOUNT_SIZE |
trader_ledger.rs | SIZE | core::mem::size_of::<Self>() |
trader_ledger.rs | TRADER_LEDGER_V2_HEADER_SIZE | core::mem::size_of::<TraderLedgerHeader>() |
trader_ledger.rs | SIZE | TRADER_LEDGER_V2_HEADER_SIZE |
IDL fixed headers#
| Account | Fixed header bytes |
|---|---|
SplineAccount | 896 |
ExternalMarketPolicyV1 | 640 |
OracleObservationAccount | 112 |
OracleContestAccount | 136 |
See account layouts for complete layouts.
Instruction Discriminators#
Public instructions span 0x00..=0x5A (77 instructions). Internal recorder instruction: LOG = 0xFF. Reserved holes and permanent tombstones are not callable public instructions.
Discriminator Values#
INITIALIZE_CONFIG: 0x00
UPDATE_AUTHORITY: 0x01
CLAIM_AUTHORITY: 0x02
CREATE_MARKET: 0x03
SNAPSHOT_END: 0x04
RESOLVE_MARKET: 0x05
EXPIRE_MARKET: 0x06
MINT_SHARES: 0x07
DEPOSIT_FUNDS: 0x08
WITHDRAW_FUNDS: 0x09
WITHDRAW_SHARES: 0x0A
PLACE_ORDER: 0x0B
PLACE_MULTIPLE_POST_ONLY_ORDERS: 0x0C
SWAP_WITH_FREE_FUNDS: 0x0D
PLACE_LIMIT_ORDER_WITH_FREE_FUNDS: 0x0E
PLACE_MULTIPLE_POST_ONLY_ORDERS_WITH_FREE_FUNDS: 0x0F
CANCEL_ORDER: 0x10
CANCEL_MULTIPLE_ORDERS_BY_ID: 0x11
CANCEL_ALL_ORDERS: 0x12
CANCEL_UP_TO: 0x13
REDUCE_ORDER: 0x14
CANCEL_MULTIPLE_ORDERS_BY_ID_WITH_FREE_FUNDS: 0x15
CANCEL_ALL_ORDERS_WITH_FREE_FUNDS: 0x16
CANCEL_UP_TO_WITH_FREE_FUNDS: 0x17
REDUCE_ORDER_WITH_FREE_FUNDS: 0x18
RECLAIM_EXPIRED_ORDER: 0x19
REDEEM: 0x1A
FORCE_CLOSE: 0x1B
MARK_POSITION_SETTLED: 0x1C
CLOSE_POSITION: 0x1D
CLOSE_MARKET: 0x1E
UPDATE_FEE_CONFIG: 0x1F
UPDATE_TREASURY_RECIPIENTS: 0x20
SET_REFERRER: 0x21
INIT_REFERRER_EARNINGS_ACCOUNT: 0x22
CLAIM_CREATOR_FEES: 0x23
CLAIM_REFERRER_EARNINGS: 0x24
PAUSE: 0x25
UNPAUSE: 0x26
ENABLE_POST_ONLY_MODE: 0x27
DISABLE_POST_ONLY_MODE: 0x28
UPDATE_TICK_SIZE: 0x29
UPDATE_MIN_RESTING_NOTIONAL: 0x2A
UPDATE_MARKET_CAP: 0x2B
SET_MARKET_EMERGENCY_STATUS: 0x2C
FORCE_CANCEL_MARKET_ORDERS: 0x2D
ENSURE_TRADER_LEDGER_SPACE: 0x2E
UPDATE_OPERATIONAL_PARAMS: 0x2F
RECOVER_SPLINE: 0x30
ENSURE_DEEP_ORDERBOOK_SPACE: 0x33
SET_PAUSER: 0x34
TOP_UP_CLOSER_REWARDS: 0x35
ROLLUP_REFERRAL_FEES: 0x36
INITIALIZE_REFERRER_TREASURY_SHARD: 0x37
INIT_SPLINE: 0x40
UPDATE_SPLINE_SHAPE: 0x41
UPDATE_SPLINE_MID: 0x42
ATTACH_SPLINE: 0x43
SETTLE_SPLINE: 0x44
DEPOSIT_SPLINE_VAULT: 0x45
WITHDRAW_SPLINE_VAULT: 0x46
CLOSE_SPLINE: 0x47
INIT_RESOLVER_REGISTRY: 0x48
UPDATE_RESOLVER_REGISTRY: 0x49
EXPIRE_EXTERNAL_MARKET: 0x4D
SHRINK_PREALLOCATED_CHILD: 0x4E
RECLAIM_EXTERNAL_MARKET_PREALLOCATION: 0x50
TOP_UP_EXTERNAL_PROGRESS_RESERVE: 0x51
BEGIN_RECLAIM_EXTERNAL_MARKET_V1: 0x52
OPEN_RECLAIM_EXTERNAL_MARKET_V1: 0x53
RESOLVE_EXTERNAL_MARKET_WITH_RECLAIM_V1: 0x54
HALT_EXTERNAL_MARKET_WITH_RECLAIM_V1: 0x55
EXTEND_EXTERNAL_CLOSE_WITH_RECLAIM_V1: 0x56
RECORD_ORACLE_OBSERVATION: 0x57
SUBMIT_ORACLE_OBSERVATION: 0x58
FINALIZE_ORACLE_OBSERVATION: 0x59
CLOSE_ORACLE_OBSERVATION: 0x5A
Frozen legacy Reclaim tombstones#
These wire values reject with FrozenLegacyReclaim before parsing or account access.
RECLAIM_RESOLVE: 0x38
RECLAIM_HALT: 0x39
RECLAIM_BEGIN_PREALLOCATION: 0x3A
RECLAIM_CREATE_MIRROR: 0x3B
UPDATE_RECLAIM_WITNESS_EPOCH: 0x3C
UPDATE_EXTERNAL_CLOSE_TIME: 0x3D
VERIFY_RECLAIM_CLAIM: 0x3E
CLOSE_RECLAIM_CLAIM: 0x3F
OPEN_EXTERNAL_MARKET: 0x4A
SUBMIT_RESOLUTION: 0x4B
HALT_MARKET: 0x4C
BEGIN_EXTERNAL_MARKET_PREALLOCATION: 0x4F
Internal LOG is 0xFF; it is authenticated recorder plumbing, not a user instruction. Reserved holes: 0x31, 0x32.
PDA Seeds#
See PDA derivation for complete seed tuples, integer encoding, and bump checks.
Compute Budget#
The protocol table includes source-defined heap requests and CU ceilings. These bounds are not measured execution estimates or evidence of staging capacity. Simulate the actual transaction and consult the relevant release evidence.
Network Constants#
Read the selected deployment configuration for the program address, settlement mint, RPC endpoint, and authorities. A compile-time default does not prove a deployment uses it.