Lineagei
Frameworki
What's Anchor?
Batteries-included Rust framework. Ships account-validation codegen, 8-byte instruction discriminators, and an on-chain IDL — the program describes itself.
Bigger binary and higher rent in exchange for safety rails, introspection, and dev speed. The choice of a team optimizing for correctness over on-chain footprint.
Originally Coral (Armani Ferrante); now community-maintained.
What it is
The de facto standard. Rust macros (#[program], #[derive(Accounts)]) eliminate boilerplate: it auto-generates 8-byte account and instruction discriminators — SHA256("account:<Name>")[..8] and SHA256("global:<ix>")[..8] — handles Borsh (de)serialization, enforces account constraints declaratively (mut, has_one, seeds, init), and emits a JSON IDL that client libraries consume directly. The cost: Borsh copies data on every deserialize (not zero-copy), and the macro machinery adds binary bloat and compute overhead — irrelevant for ~99% of programs.
When to pick it
Building a new protocol, moving fast, or wanting maximum ecosystem compatibility. It's the beginner default and stays the right call for most production programs.
How it looks on-chain
The most recognizable framework. Every account it owns begins with an 8-byte discriminator, and the IDL is often published on-chain at a PDA derived from the program id. Both are strong, reliable fingerprints — this is the only framework we can label with confidence.
Others in the wild: Steel (Ore team — near-native performance on solana-program), Seahorse (Python → Anchor), and Poseidon & Quasar (TypeScript → Rust). Transpilers inherit their lowering target's fingerprint: a Quasar or Poseidon program that compiles down to Anchor will look like Anchor on-chain — discriminators and all.
Anchor docsFootprinti
Recovered architecturei
Reachi
Controli
What's upgrade authority?
The upgrade authority is the account allowed to replace a program's code after it's deployed.
If it's set (mutable), that key can push new bytecode at any time — including malicious code, the classic "rug" vector. If it's null (immutable / frozen), the code can never change; what 's on-chain is final. A Squads multisig sits in between — upgrades are possible but need M-of-N signers, not one hot wallet. So mutable + single hot-wallet = highest risk; immutable or multisig = stronger guarantees.
What's a verified build?
A verified build proves the program running on-chain was compiled from the public source you can read — nothing hidden.
Someone re-compiles the source in a deterministic (Docker) environment and checks the resulting bytecode is byte-for-byte identical to what's deployed; tools like solana-verify do this and record it with a verification service. "Not verified" isn't a red flag by itself — most programs simply never submit one. It just means you're trusting the deployed bytecode as-is, with no source cross-check.
Convictioni
Interface — the on-chain IDLi
3 of 202 instructions used · 199 never called in this window
Instructions 202
add_insurance_fund_stake
- state
- spot_marketwritable
- insurance_fund_stakewritable
- user_statswritable
- authoritysigner
- spot_market_vaultwritable
- insurance_fund_vaultwritable
- velocity_signer
- user_token_accountwritable
- token_program
- market_indexu16
- amountu64
add_market_to_amm_cache
- adminsignerwritable
- state
- amm_cachewritable
- perp_market
- rent
- system_program
admin_deposit
- state
- userwritable
- adminsignerwritable
- spot_market_vaultwritable
- admin_token_accountwritable
- token_program
- market_indexu16
- amountu64
admin_update_user_stats_paused_operations
- adminsigner
- state
- user_statswritable
- paused_operationsu8
begin_swap
- state
- userwritable
- user_statswritable
- authoritysigner
- out_spot_market_vaultwritable
- in_spot_market_vaultwritable
- out_token_accountwritable
- in_token_accountwritable
- token_program
- velocity_signer
- instructions
- in_market_indexu16
- out_market_indexu16
- amount_inu64
cancel_order
- state
- userwritable
- authoritysigner
- order_idOption<u32>
cancel_order_by_user_id
- state
- userwritable
- authoritysigner
- user_order_idu8
cancel_orders
- state
- userwritable
- authoritysigner
- market_typeOption<MarketType>
- market_indexOption<u16>
- directionOption<PositionDirection>
cancel_orders_by_ids
- state
- userwritable
- authoritysigner
- order_idsVec<u32>
cancel_request_remove_insurance_fund_stake
- spot_marketwritable
- insurance_fund_stakewritable
- user_statswritable
- authoritysigner
- insurance_fund_vaultwritable
- market_indexu16
change_approved_builder
- escrowwritable
- authoritysigner
- payersignerwritable
- system_program
- builderpubkey
- max_fee_bpsu16
- addbool
change_signed_msg_ws_delegate_status
- signed_msg_ws_delegateswritable
- authoritysignerwritable
- system_program
- delegatepubkey
- addbool
delete_amm_cache
- adminsignerwritable
- state
- amm_cachewritable
delete_initialized_perp_market
- adminsignerwritable
- statewritable
- perp_marketwritable
- market_indexu16
delete_initialized_spot_market
- adminsignerwritable
- statewritable
- spot_marketwritable
- spot_market_vaultwritable
- insurance_fund_vaultwritable
- velocity_signer
- token_program
- market_indexu16
delete_prelaunch_oracle
- adminsignerwritable
- prelaunch_oraclewritable
- perp_market
- state
- perp_market_indexu16
delete_signed_msg_user_orders
- signed_msg_user_orderswritable
- statewritable
- authoritysigner
delete_user
- userwritable
- user_statswritable
- statewritable
- authoritysignerwritable
deposit
- state
- userwritable
- user_statswritable
- authoritysigner
- spot_market_vaultwritable
- user_token_accountwritable
- token_program
- market_indexu16
- amountu64
- reduce_onlybool
deposit_into_perp_market_fee_pool
- statewritable
- perp_marketwritable
- adminsigner
- source_vaultwritable
- velocity_signer
- quote_spot_marketwritable
- spot_market_vaultwritable
- token_program
- amountu64
deposit_into_spot_market_revenue_pool
- state
- spot_marketwritable
- authoritysignerwritable
- spot_market_vaultwritable
- user_token_accountwritable
- token_program
- amountu64
deposit_into_spot_market_vault
- state
- spot_marketwritable
- adminsigner
- source_vaultwritable
- spot_market_vaultwritable
- token_program
- amountu64
end_swap
- state
- userwritable
- user_statswritable
- authoritysigner
- out_spot_market_vaultwritable
- in_spot_market_vaultwritable
- out_token_accountwritable
- in_token_accountwritable
- token_program
- velocity_signer
- instructions
- in_market_indexu16
- out_market_indexu16
- limit_priceOption<u64>
- reduce_onlyOption<SwapReduceOnly>
fill_perp_order
- state
- authoritysigner
- fillerwritable
- filler_statswritable
- userwritable
- user_statswritable
- order_idOption<u32>
- _maker_order_idOption<u32>
force_cancel_orders
- state
- authoritysigner
- fillerwritable
- userwritable
force_delete_user
- userwritable
- user_statswritable
- statewritable
- authoritywritable
- keepersignerwritable
- velocity_signer
initialize
- adminsignerwritable
- statewritable
- quote_asset_mint
- velocity_signer
- rent
- system_program
- token_program
initialize_amm_cache
- adminsignerwritable
- state
- amm_cachewritable
- rent
- system_program
initialize_insurance_fund_stake
- spot_market
- insurance_fund_stakewritable
- user_statswritable
- state
- authoritysigner
- payersignerwritable
- rent
- system_program
- market_indexu16
initialize_perp_market
- adminsignerwritable
- statewritable
- perp_marketwritable
- oracle
- rent
- system_program
- market_indexu16
- amm_base_asset_reserveu128
- amm_quote_asset_reserveu128
- amm_periodicityi64
- amm_peg_multiplieru128
- oracle_sourceOracleSource
- contract_tierContractTier
- margin_ratio_initialu32
- margin_ratio_maintenanceu32
- liquidator_feeu32
- if_liquidation_feeu32
- imf_factoru32
- active_statusbool
- base_spreadu32
- max_spreadu32
- max_open_interestu128
- max_revenue_withdraw_per_periodu64
- quote_max_insuranceu64
- order_step_sizeu64
- order_tick_sizeu64
- min_order_sizeu64
- concentration_coef_scaleu128
- curve_update_intensityu8
- amm_jit_intensityu8
- name[u8; 32]
- lp_pool_idu8
- funding_clamp_thresholdu32
- funding_ramp_slopeu32
initialize_prelaunch_oracle
- adminsignerwritable
- prelaunch_oraclewritable
- state
- rent
- system_program
- paramsPrelaunchOracleParams
initialize_pyth_lazer_oracle
- adminsignerwritable
- lazer_oraclewritable
- state
- rent
- system_program
- feed_idu32
initialize_referrer_name
- referrer_namewritable
- userwritable
- user_statswritable
- authoritysigner
- payersignerwritable
- rent
- system_program
- name[u8; 32]
initialize_revenue_share
- revenue_sharewritable
- authority
- payersignerwritable
- rent
- system_program
initialize_revenue_share_escrow
- escrowwritable
- authority
- user_statswritable
- state
- payersignerwritable
- rent
- system_program
- num_ordersu16
initialize_signed_msg_user_orders
- signed_msg_user_orderswritable
- authority
- payersignerwritable
- rent
- system_program
- num_ordersu16
initialize_signed_msg_ws_delegates
- signed_msg_ws_delegateswritable
- authoritysignerwritable
- rent
- system_program
- delegatesVec<pubkey>
initialize_spot_market
- spot_marketwritable
- spot_market_mint
- spot_market_vaultwritable
- insurance_fund_vaultwritable
- velocity_signer
- statewritable
- oracle
- adminsignerwritable
- rent
- system_program
- token_program
- optimal_utilizationu32
- optimal_borrow_rateu32
- max_borrow_rateu32
- oracle_sourceOracleSource
- initial_asset_weightu32
- maintenance_asset_weightu32
- initial_liability_weightu32
- maintenance_liability_weightu32
- imf_factoru32
- liquidator_feeu32
- if_liquidation_feeu32
- active_statusbool
- asset_tierAssetTier
- scale_initial_asset_weight_startu64
- withdraw_guard_thresholdu64
- order_tick_sizeu64
- order_step_sizeu64
- if_total_factoru32
- name[u8; 32]
initialize_user
- userwritable
- user_statswritable
- statewritable
- authority
- payersignerwritable
- rent
- system_program
- sub_account_idu16
- name[u8; 32]
initialize_user_stats
- user_statswritable
- statewritable
- authority
- payersignerwritable
- rent
- system_program
liquidate_borrow_for_perp_pnl
- state
- authoritysigner
- liquidatorwritable
- liquidator_statswritable
- userwritable
- user_statswritable
- perp_market_indexu16
- spot_market_indexu16
- liquidator_max_liability_transferu128
- limit_priceOption<u64>
liquidate_perp
- state
- authoritysigner
- liquidatorwritable
- liquidator_statswritable
- userwritable
- user_statswritable
- market_indexu16
- liquidator_max_base_asset_amountu64
- limit_priceOption<u64>
liquidate_perp_pnl_for_deposit
- state
- authoritysigner
- liquidatorwritable
- liquidator_statswritable
- userwritable
- user_statswritable
- perp_market_indexu16
- spot_market_indexu16
- liquidator_max_pnl_transferu128
- limit_priceOption<u64>
liquidate_perp_with_fill
- state
- authoritysigner
- liquidatorwritable
- liquidator_statswritable
- userwritable
- user_statswritable
- market_indexu16
liquidate_spot
- state
- authoritysigner
- liquidatorwritable
- userwritable
- asset_market_indexu16
- liability_market_indexu16
- liquidator_max_liability_transferu128
- limit_priceOption<u64>
liquidate_spot_with_swap_begin
- state
- authoritysigner
- liquidatorwritable
- userwritable
- liability_spot_market_vaultwritable
- asset_spot_market_vaultwritable
- liability_token_accountwritable
- asset_token_accountwritable
- token_program
- velocity_signer
- instructions
- asset_market_indexu16
- liability_market_indexu16
- swap_amountu64
liquidate_spot_with_swap_end
- state
- authoritysigner
- liquidatorwritable
- userwritable
- liability_spot_market_vaultwritable
- asset_spot_market_vaultwritable
- liability_token_accountwritable
- asset_token_accountwritable
- token_program
- velocity_signer
- instructions
- asset_market_indexu16
- liability_market_indexu16
log_user_balances
- state
- authoritysigner
- userwritable
modify_order
- state
- userwritable
- authoritysigner
- order_idOption<u32>
- modify_order_paramsModifyOrderParams
modify_order_by_user_id
- state
- userwritable
- authoritysigner
- user_order_idu8
- modify_order_paramsModifyOrderParams
move_amm_price
- adminsigner
- state
- perp_marketwritable
- base_asset_reserveu128
- quote_asset_reserveu128
- sqrt_ku128
override_amm_cache_info
- statewritable
- adminsigner
- amm_cachewritable
- market_indexu16
- override_paramsOverrideAmmCacheParams
pause_spot_market_deposit_withdraw
- state
- keepersigner
- spot_marketwritable
- spot_market_vault
place_and_make_perp_order
- state
- userwritable
- user_statswritable
- takerwritable
- taker_statswritable
- authoritysigner
- paramsOrderParams
- taker_order_idu32
place_and_make_signed_msg_perp_order
- state
- userwritable
- user_statswritable
- takerwritable
- taker_statswritable
- taker_signed_msg_user_orders
- authoritysigner
- paramsOrderParams
- signed_msg_order_uuid[u8; 8]
place_and_take_perp_order
- state
- userwritable
- user_statswritable
- authoritysigner
- paramsOrderParams
- success_conditionOption<u32>
place_orders
- state
- userwritable
- authoritysigner
- paramsVec<OrderParams>
place_perp_order
- state
- userwritable
- authoritysigner
- paramsOrderParams
place_scale_orders
- state
- userwritable
- authoritysigner
- paramsScaleOrderParams
place_signed_msg_taker_order
- state
- userwritable
- user_statswritable
- signed_msg_user_orderswritable
- authoritysigner
- ix_sysvar
- signed_msg_order_params_message_bytesbytes
- is_delegate_signerbool
post_pyth_lazer_oracle_update
- keepersignerwritable
- pyth_lazer_storage
- ix_sysvar
- pyth_messagebytes
recenter_perp_market_amm
- adminsigner
- state
- perp_marketwritable
- peg_multiplieru128
- sqrt_ku128
recenter_perp_market_amm_crank
- adminsigner
- state
- perp_marketwritable
- spot_market
- oracle
- depthOption<u128>
reclaim_rent
- userwritable
- user_statswritable
- state
- authoritysigner
- rent
remove_insurance_fund_stake
- state
- spot_marketwritable
- insurance_fund_stakewritable
- user_statswritable
- authoritysigner
- insurance_fund_vaultwritable
- velocity_signer
- user_token_accountwritable
- token_program
- market_indexu16
repeg_amm_curve
- state
- perp_marketwritable
- oracle
- adminsigner
- new_peg_candidateu128
request_remove_insurance_fund_stake
- spot_marketwritable
- insurance_fund_stakewritable
- user_statswritable
- authoritysigner
- insurance_fund_vaultwritable
- market_indexu16
- amountu64
reset_equity_floor_breaker
- adminsigner
- state
- user_statswritable
reset_perp_market_amm_oracle_twap
- state
- perp_marketwritable
- oracle
- adminsigner
resize_revenue_share_escrow_orders
- escrowwritable
- authority
- payersignerwritable
- system_program
- num_ordersu16
resize_signed_msg_user_orders
- signed_msg_user_orderswritable
- authority
- user
- payersignerwritable
- system_program
- num_ordersu16
resolve_perp_bankruptcy
- state
- authoritysigner
- liquidatorwritable
- liquidator_statswritable
- userwritable
- user_statswritable
- spot_market_vaultwritable
- insurance_fund_vaultwritable
- velocity_signer
- token_program
- quote_spot_market_indexu16
- market_indexu16
resolve_perp_pnl_deficit
- state
- authoritysigner
- spot_market_vaultwritable
- insurance_fund_vaultwritable
- velocity_signer
- token_program
- spot_market_indexu16
- perp_market_indexu16
resolve_spot_bankruptcy
- state
- authoritysigner
- liquidatorwritable
- liquidator_statswritable
- userwritable
- user_statswritable
- spot_market_vaultwritable
- insurance_fund_vaultwritable
- velocity_signer
- token_program
- market_indexu16
revert_fill
- state
- authoritysigner
- fillerwritable
- filler_statswritable
set_user_status_to_being_liquidated
- state
- userwritable
- authoritysigner
settle_expired_market
- adminsigner
- state
- perp_marketwritable
- market_indexu16
settle_expired_market_pools_to_revenue_pool
- state
- adminsigner
- spot_marketwritable
- perp_marketwritable
settle_funding_payment
- state
- userwritable
settle_multiple_pnls
- state
- userwritable
- authoritysigner
- spot_market_vault
- market_indexesVec<u16>
- modeSettlePnlMode
settle_pnl
- state
- userwritable
- authoritysigner
- spot_market_vault
- market_indexu16
settle_revenue_to_insurance_fund
- state
- spot_marketwritable
- spot_market_vaultwritable
- velocity_signer
- insurance_fund_vaultwritable
- token_program
- spot_market_indexu16
special_transfer_perp_position_to_vamm
- userwritable
- authoritysigner
- state
- market_indexu16
- amountOption<i64>
sweep_perp_market_fees
- state
- perp_marketwritable
- spot_marketwritable
- oracle
- perp_market_indexu16
transfer_deposit
- from_userwritable
- to_userwritable
- user_statswritable
- authoritysigner
- state
- spot_market_vault
- market_indexu16
- amountu64
transfer_deposit_by_delegate
- from_userwritable
- to_userwritable
- user_stats
- delegatesigner
- state
- spot_market_vault
- market_indexu16
- amountu64
- equity_floor_deltau64
transfer_fee_and_pnl_pool
- state
- adminsigner
- perp_market_with_fee_poolwritable
- perp_market_with_pnl_poolwritable
- spot_marketwritable
- spot_market_vaultwritable
- amountu64
- directionTransferFeeAndPnlPoolDirection
transfer_perp_position
- from_userwritable
- to_userwritable
- user_statswritable
- authoritysigner
- state
- market_indexu16
- amountOption<i64>
transfer_pools
- from_userwritable
- to_userwritable
- user_statswritable
- authoritysigner
- state
- deposit_from_spot_market_vaultwritable
- deposit_to_spot_market_vaultwritable
- borrow_from_spot_market_vaultwritable
- borrow_to_spot_market_vaultwritable
- velocity_signer
- deposit_from_market_indexu16
- deposit_to_market_indexu16
- borrow_from_market_indexu16
- borrow_to_market_indexu16
- deposit_amountOption<u64>
- borrow_amountOption<u64>
trigger_order
- state
- authoritysigner
- fillerwritable
- userwritable
- order_idu32
trip_equity_floor_breaker
- state
- keepersigner
- user
- user_statswritable
update_admin
- statewritable
- adminsigner
- adminpubkey
update_amm_cache
- keepersignerwritable
- state
- amm_cachewritable
- quote_market
update_amm_jit_intensity
- adminsigner
- state
- perp_marketwritable
- amm_jit_intensityu8
update_amms
- state
- authoritysigner
- market_indexesVec<u16>
update_discount_mint
- adminsigner
- statewritable
- discount_mintpubkey
update_exchange_status
- adminsigner
- statewritable
- exchange_statusu8
update_feature_bit_flags_builder_codes
- adminsigner
- statewritable
- enablebool
update_feature_bit_flags_median_trigger_price
- adminsigner
- statewritable
- enablebool
update_feature_bit_flags_mint_redeem_lp_pool
- adminsigner
- statewritable
- enablebool
update_feature_bit_flags_mm_oracle
- adminsigner
- statewritable
- enablebool
update_feature_bit_flags_settle_lp_pool
- adminsigner
- statewritable
- enablebool
update_feature_bit_flags_swap_lp_pool
- adminsigner
- statewritable
- enablebool
update_funding_rate
- state
- perp_marketwritable
- oracle
- market_indexu16
update_hot_admin
- statewritable
- adminsigner
- roleHotRole
- new_pubkeypubkey
update_initial_amm_cache_info
- statewritable
- adminsigner
- amm_cachewritable
update_initial_pct_to_liquidate
- adminsigner
- statewritable
- initial_pct_to_liquidateu16
update_insurance_fund_unstaking_period
- adminsigner
- state
- spot_marketwritable
- insurance_fund_unstaking_periodi64
update_k
- adminsigner
- state
- perp_marketwritable
- oracle
- sqrt_ku128
update_liquidation_duration
- adminsigner
- statewritable
- liquidation_durationu8
update_liquidation_margin_buffer_ratio
- adminsigner
- statewritable
- liquidation_margin_buffer_ratiou32
update_oracle_guard_rails
- adminsigner
- statewritable
- oracle_guard_railsOracleGuardRails
update_pause_admin
- statewritable
- adminsigner
- new_pause_adminpubkey
update_perp_auction_duration
- adminsigner
- statewritable
- min_perp_auction_durationu8
update_perp_bid_ask_twap
- state
- perp_marketwritable
- oracle
- keeper_stats
- authoritysigner
update_perp_fee_structure
- adminsigner
- statewritable
- fee_structureFeeStructure
update_perp_market_amm_oracle_twap
- state
- perp_marketwritable
- oracle
- adminsigner
update_perp_market_amm_spread_adjustment
- adminsigner
- state
- perp_marketwritable
- amm_spread_adjustmenti8
- amm_inventory_spread_adjustmenti8
- reference_price_offseti32
update_perp_market_amm_summary_stats
- adminsigner
- state
- perp_marketwritable
- spot_market
- oracle
- paramsUpdatePerpMarketSummaryStatsParams
update_perp_market_bankruptcy_if_floor_pct
- adminsigner
- state
- perp_marketwritable
- bankruptcy_if_floor_pctu32
update_perp_market_base_spread
- adminsigner
- state
- perp_marketwritable
- base_spreadu32
update_perp_market_concentration_coef
- adminsigner
- state
- perp_marketwritable
- concentration_scaleu128
update_perp_market_config
- adminsigner
- state
- perp_marketwritable
- market_configu8
update_perp_market_contract_tier
- adminsigner
- state
- perp_marketwritable
- contract_tierContractTier
update_perp_market_curve_update_intensity
- adminsigner
- state
- perp_marketwritable
- curve_update_intensityu8
update_perp_market_expiry
- adminsigner
- state
- perp_marketwritable
- expiry_tsi64
update_perp_market_fee_adjustment
- adminsigner
- state
- perp_marketwritable
- fee_adjustmenti16
update_perp_market_fee_pool_buffer_target
- adminsigner
- state
- perp_marketwritable
- fee_pool_buffer_targetu64
update_perp_market_funding_bias_sensitivity
- adminsigner
- state
- perp_marketwritable
- funding_bias_sensitivityu8
update_perp_market_funding_dead_zone
- adminsigner
- state
- perp_marketwritable
- funding_clamp_thresholdu32
- funding_ramp_slopeu32
update_perp_market_funding_period
- adminsigner
- state
- perp_marketwritable
- funding_periodi64
update_perp_market_imf_factor
- adminsigner
- state
- perp_marketwritable
- imf_factoru32
- unrealized_pnl_imf_factoru32
update_perp_market_liquidation_fee
- adminsigner
- state
- perp_marketwritable
- liquidator_feeu32
- if_liquidation_feeu32
- protocol_liquidation_feeu32
update_perp_market_lp_pool_id
- adminsigner
- state
- perp_marketwritable
- lp_pool_idu8
update_perp_market_lp_pool_paused_operations
- adminsigner
- state
- perp_marketwritable
- lp_paused_operationsu8
update_perp_market_margin_ratio
- adminsigner
- state
- perp_marketwritable
- margin_ratio_initialu32
- margin_ratio_maintenanceu32
update_perp_market_max_fill_reserve_fraction
- adminsigner
- state
- perp_marketwritable
- max_fill_reserve_fractionu16
update_perp_market_max_imbalances
- adminsigner
- state
- perp_marketwritable
- unrealized_max_imbalanceu64
- max_revenue_withdraw_per_periodu64
- quote_max_insuranceu64
update_perp_market_max_open_interest
- adminsigner
- state
- perp_marketwritable
- max_open_interestu128
update_perp_market_max_slippage_ratio
- adminsigner
- state
- perp_marketwritable
- max_slippage_ratiou16
update_perp_market_max_spread
- adminsigner
- state
- perp_marketwritable
- max_spreadu32
update_perp_market_min_order_size
- adminsigner
- state
- perp_marketwritable
- order_sizeu64
update_perp_market_name
- adminsigner
- state
- perp_marketwritable
- name[u8; 32]
update_perp_market_number_of_users
- adminsigner
- state
- perp_marketwritable
- number_of_usersOption<u32>
- number_of_users_with_baseOption<u32>
update_perp_market_oracle
- adminsigner
- state
- perp_marketwritable
- oracle
- old_oracle
- amm_cachewritable
- oraclepubkey
- oracle_sourceOracleSource
- skip_invariant_checkbool
update_perp_market_oracle_low_risk_slot_delay_override
- adminsigner
- state
- perp_marketwritable
- oracle_low_risk_slot_delay_overridei8
update_perp_market_oracle_slot_delay_override
- adminsigner
- state
- perp_marketwritable
- oracle_slot_delay_overridei8
update_perp_market_paused_operations
- adminsigner
- state
- perp_marketwritable
- paused_operationsu8
update_perp_market_pnl_pool
- state
- adminsigner
- spot_marketwritable
- spot_market_vaultwritable
- perp_marketwritable
- amountu64
update_perp_market_reference_price_offset_deadband_pct
- adminsigner
- state
- perp_marketwritable
- reference_price_offset_deadband_pctu8
update_perp_market_status
- adminsigner
- state
- perp_marketwritable
- statusMarketStatus
update_perp_market_step_size_and_tick_size
- adminsigner
- state
- perp_marketwritable
- step_sizeu64
- tick_sizeu64
update_perp_market_unrealized_asset_weight
- adminsigner
- state
- perp_marketwritable
- unrealized_initial_asset_weightu32
- unrealized_maintenance_asset_weightu32
update_prelaunch_oracle
- state
- perp_market
- oraclewritable
update_prelaunch_oracle_params
- adminsignerwritable
- prelaunch_oraclewritable
- perp_marketwritable
- state
- paramsPrelaunchOracleParams
update_protocol_fee_recipient
Cold-only: set the treasury protocol fees may be withdrawn to. Perp (quote) and spot (per-market token) recipients are configured independently via `market_type`.
- statewritable
- adminsigner
- protocol_fee_recipientpubkey
- market_typeMarketType
update_solvency_status
- statewritable
- adminsigner
- solvency_statusu8
update_special_user_status
- adminsigner
- state
- userwritable
- statusu8
update_spot_auction_duration
- adminsigner
- statewritable
- default_spot_auction_durationu8
update_spot_fee_structure
- adminsigner
- statewritable
- fee_structureFeeStructure
update_spot_market_asset_tier
- adminsigner
- state
- spot_marketwritable
- asset_tierAssetTier
update_spot_market_borrow_rate
- adminsigner
- state
- spot_marketwritable
- optimal_utilizationu32
- optimal_borrow_rateu32
- max_borrow_rateu32
- min_borrow_rateOption<u8>
update_spot_market_cumulative_interest
- state
- spot_marketwritable
- oracle
- spot_market_vault
update_spot_market_expiry
- adminsigner
- state
- spot_marketwritable
- expiry_tsi64
update_spot_market_fee_adjustment
- adminsigner
- state
- spot_marketwritable
- fee_adjustmenti16
update_spot_market_if_factor
- adminsigner
- state
- spot_marketwritable
- spot_market_indexu16
- if_fee_factoru32
- protocol_fee_factoru32
update_spot_market_if_paused_operations
- adminsigner
- state
- spot_marketwritable
- paused_operationsu8
update_spot_market_liquidation_fee
- adminsigner
- state
- spot_marketwritable
- liquidator_feeu32
- if_liquidation_feeu32
- protocol_liquidation_feeu32
update_spot_market_margin_weights
- adminsigner
- state
- spot_marketwritable
- initial_asset_weightu32
- maintenance_asset_weightu32
- initial_liability_weightu32
- maintenance_liability_weightu32
- imf_factoru32
update_spot_market_max_token_borrows
- adminsigner
- state
- spot_marketwritable
- max_token_borrows_fractionu16
update_spot_market_max_token_deposits
- adminsigner
- state
- spot_marketwritable
- max_token_depositsu64
update_spot_market_min_order_size
- adminsigner
- state
- spot_marketwritable
- order_sizeu64
update_spot_market_name
- adminsigner
- state
- spot_marketwritable
- name[u8; 32]
update_spot_market_oracle
- adminsigner
- state
- spot_marketwritable
- oracle
- old_oracle
- oraclepubkey
- oracle_sourceOracleSource
- skip_invariant_checkbool
update_spot_market_orders_enabled
- adminsigner
- state
- spot_marketwritable
- orders_enabledbool
update_spot_market_paused_operations
- adminsigner
- state
- spot_marketwritable
- paused_operationsu8
update_spot_market_pool_id
- adminsigner
- state
- spot_marketwritable
- pool_idu8
update_spot_market_revenue_settle_period
- adminsigner
- state
- spot_marketwritable
- revenue_settle_periodi64
update_spot_market_scale_initial_asset_weight_start
- adminsigner
- state
- spot_marketwritable
- scale_initial_asset_weight_startu64
update_spot_market_status
- adminsigner
- state
- spot_marketwritable
- statusMarketStatus
update_spot_market_step_size_and_tick_size
- adminsigner
- state
- spot_marketwritable
- step_sizeu64
- tick_sizeu64
update_state_max_initialize_user_fee
- adminsigner
- statewritable
- max_initialize_user_feeu16
update_state_max_number_of_sub_accounts
- adminsigner
- statewritable
- max_number_of_sub_accountsu16
update_state_settlement_duration
- adminsigner
- statewritable
- settlement_durationu16
update_user_allow_delegate_transfer
- user_statswritable
- authoritysigner
- allow_delegate_transferbool
update_user_custom_margin_ratio
- userwritable
- authoritysigner
- _sub_account_idu16
- margin_ratiou32
update_user_delegate
- userwritable
- authoritysigner
- _sub_account_idu16
- delegatepubkey
update_user_equity_floor
- adminsigner
- state
- userwritable
- equity_flooru64
update_user_idle
- state
- authoritysigner
- fillerwritable
- userwritable
update_user_margin_trading_enabled
- userwritable
- authoritysigner
- _sub_account_idu16
- margin_trading_enabledbool
update_user_name
- userwritable
- authoritysigner
- _sub_account_idu16
- name[u8; 32]
update_user_perp_position_custom_margin_ratio
- userwritable
- authoritysigner
- _sub_account_idu16
- perp_market_indexu16
- margin_ratiou16
update_user_pool_id
- userwritable
- authoritysigner
- _sub_account_idu16
- pool_idu8
update_user_quote_asset_insurance_stake
- state
- spot_marketwritable
- insurance_fund_stakewritable
- user_statswritable
- signersigner
- insurance_fund_vaultwritable
update_user_reduce_only
- userwritable
- authoritysigner
- _sub_account_idu16
- reduce_onlybool
update_user_stats_referrer_status
- state
- authoritysigner
- user_statswritable
update_warm_admin
- statewritable
- adminsigner
- new_warm_adminpubkey
update_withdraw_guard_threshold
- adminsigner
- state
- spot_marketwritable
- oracle
- withdraw_guard_thresholdu64
withdraw
- state
- userwritable
- user_statswritable
- authoritysigner
- spot_market_vaultwritable
- velocity_signer
- user_token_accountwritable
- token_program
- market_indexu16
- amountu64
- reduce_onlybool
withdraw_protocol_fees_perp
Withdraw a perp market's accrued protocol fees (from the quote spot vault) to `protocol_fee_recipient_perp` (auth: `FeeWithdraw` hot key).
- state
- payersignerwritable
- authoritysigner
- perp_marketwritable
- quote_spot_marketwritable
- spot_market_vaultwritable
- mint
- recipient
- recipient_token_accountwritable
- token_program
- velocity_signer
- system_program
- associated_token_program
- market_indexu16
- amountu64
withdraw_protocol_fees_spot
Withdraw a spot market's accrued protocol fees to `protocol_fee_recipient_spot` (auth: `FeeWithdraw` hot key).
- state
- payersignerwritable
- authoritysigner
- spot_marketwritable
- spot_market_vaultwritable
- mint
- recipient
- recipient_token_accountwritable
- token_program
- velocity_signer
- system_program
- associated_token_program
- market_indexu16
- amountu64
zero_mm_oracle_fields
- adminsigner
- state
- perp_marketwritable
Accounts 14
AmmCache
no fields
InsuranceFundStake
no fields
PerpMarket
no fields
PrelaunchOracle
no fields
PythLazerOracle
no fields
ReferrerName
no fields
RevenueShare
no fields
RevenueShareEscrow
no fields
SignedMsgUserOrders
no fields
SignedMsgWsDelegates
no fields
SpotMarket
no fields
State
no fields
User
no fields
UserStats
no fields
Types 104
AMMstruct
- fee_poolPoolBalancepartition of fees from perp market trading moved from pnl settlements
- base_asset_reserveu128`x` reserves for constant product mm formula (x * y = k) precision: AMM_RESERVE_PRECISION
- quote_asset_reserveu128`y` reserves for constant product mm formula (x * y = k) precision: AMM_RESERVE_PRECISION
- concentration_coefu128determines how close the min/max base asset reserve sit vs base reserves allow for decreasing slippage without increasing liquidity and v.v. precision: PERCENTAGE_PRECISION
- min_base_asset_reserveu128minimum base_asset_reserve allowed before AMM is unavailable precision: AMM_RESERVE_PRECISION
- max_base_asset_reserveu128maximum base_asset_reserve allowed before AMM is unavailable precision: AMM_RESERVE_PRECISION
- sqrt_ku128`sqrt(k)` in constant product mm formula (x * y = k). stored to avoid velocity caused by integer math issues precision: AMM_RESERVE_PRECISION
- peg_multiplieru128normalizing numerical factor for y, its use offers lowest slippage in cp-curve when market is balanced precision: PEG_PRECISION
- terminal_quote_asset_reserveu128y when market is balanced. stored to save computation precision: AMM_RESERVE_PRECISION
- base_asset_amount_with_ammi128tracks net position (longs-shorts) in market with AMM as counterparty precision: BASE_PRECISION
- total_feei128Lifetime fee-derived income booked to the AMM ITSELF (analytics): its fee provision (the `amm_fee` cut of trade-fee remainders) plus spread surplus. NOT the market's gross fees — those live in `PerpMarket.fee_ledger.total_exchange_fee`. Adjusted in lockstep with `total_fee_minus_distributions` by admin summary-stats corrections. precision: QUOTE_PRECISION
- total_mm_feei128Spread-capture component of `total_fee` (analytics): the gap between the curve price and the execution price on AMM fills. Trading profit, not a fee anyone explicitly pays. precision: QUOTE_PRECISION
- total_fee_minus_distributionsi128The AMM's equity ledger (retained earnings) — broader than the name suggests: fee income (`apply_fill_fees`) + funding and other P&L (`record_amm_pnl`) + external credits (`record_credit`), minus curve-adjustment costs (`apply_cost`) and bankruptcy clawbacks. Contains ONLY the AMM's own money (protocol/IF carveouts never enter it). Drives `is_underwater`, the drawdown breaker, and curve-cost budgets; reconciled against pool balances by `calculate_perp_market_amm_summary_stats`. precision: QUOTE_PRECISION
- total_fee_withdrawnu128@deprecated frozen analytics counter from the pre-isolation design (sum of fees withdrawn from the fee pool to the revenue pool). The sweep no longer touches the AMM's pools, so nothing writes this. precision: QUOTE_PRECISION
- ask_base_asset_reserveu128Cached spread-adjusted reserves for the ask (long-take) side, derived from `long_spread` + `reference_price_offset`. Refreshed by [`crate::vlp::amm::math::spread::update_amm_quote_state`] on every AMM crank / fill `setup`; quote/fill paths read these directly instead of recomputing per quote. Also surfaced to dashboards/tracking. precision: AMM_RESERVE_PRECISION
- ask_quote_asset_reserveu128precision: AMM_RESERVE_PRECISION
- bid_base_asset_reserveu128Cached spread-adjusted reserves for the bid (short-take) side. precision: AMM_RESERVE_PRECISION
- bid_quote_asset_reserveu128precision: AMM_RESERVE_PRECISION
- last_update_slotu64the last blockchain slot the amm was updated
- net_revenue_since_last_fundingi64the total_fee_minus_distribution change since the last funding update precision: QUOTE_PRECISION
- last_cumulative_funding_rate_longi64AMM's last-seen cumulative funding rates. Mirrors `PerpPosition::last_cumulative_funding_rate` on user positions — the AMM settles its own funding payment from `(market.cumulative_funding_rate_* − own_last) × counterparty_position`, same math shape user positions use. The AMM is the counterparty for the net imbalance, so the relevant cum rate is the LONG one when the AMM is net long (base_asset_amount_with_amm < 0, i.e. users net short) and the SHORT one when the AMM is net short.
- last_cumulative_funding_rate_shorti64
- last_oracle_reserve_price_spread_pcti64Cached oracle-vs-reserve price spread (signed, BID_ASK_SPREAD_PRECISION), the spread input that seeds `calculate_spread`. Refreshed alongside the other cached spread fields by `update_amm_quote_state`.
- last_spread_update_slotu64Blockchain slot at which the cached spread state (`long_spread`, `short_spread`, `reference_price_offset`, the ask/bid reserves, and `last_oracle_reserve_price_spread_pct`) was last refreshed. Lets quote paths skip recompute within a slot and lets dashboards reason about cache staleness independently of `last_update_slot`.
- base_spreadu32the minimum spread the AMM can quote. also used as step size for some spread logic increases.
- max_spreadu32the maximum spread the AMM can quote
- long_spreadu32Cached spread applied to the ask (long-take) side, in BID_ASK_SPREAD_PRECISION. Refreshed by `update_amm_quote_state`.
- short_spreadu32Cached spread applied to the bid (short-take) side, in BID_ASK_SPREAD_PRECISION. Refreshed by `update_amm_quote_state`.
- reference_price_offseti32Cached reference-price offset (signed, PRICE_PRECISION) applied to both sides' quotes. Refreshed by `update_amm_quote_state`.
- max_fill_reserve_fractionu16the fraction of total available liquidity a single fill on the AMM can consume
- max_slippage_ratiou16the maximum slippage a single fill on the AMM can push
- curve_update_intensityu8the update intensity of AMM formulaic updates (adjusting k). 0-100
- amm_jit_intensityu8the jit intensity of AMM. larger intensity means larger participation in jit. 0 means no jit participation. (0, 100] is intensity for protocol-owned AMM.
- amm_spread_adjustmenti8signed scale amm_spread similar to fee_adjustment logic (-100 = 0, 100 = double)
- amm_inventory_spread_adjustmenti8signed scale amm_spread similar to fee_adjustment logic (-100 = 0, 100 = double)
- reference_price_offset_deadband_pctu8
- funding_bias_sensitivityu8s in the funding bias β(f) = 1 + s * ρ(f): how much the paying-side spread widens while the vAMM pays funding on its inventory. s is stored in hundredths (s = value / 100), so at full ramp (ρ = 1) the multiplier is 1 + value/100: 50 => 1.5x, 100 => 2x, u8 caps s at 2.55. Same convention as `amm_spread_adjustment` (100 = double). 0 disables the bias.
- padding_post_amm[u8; 2]
AddAmmConstituentMappingDatumstruct
- constituent_indexu16
- perp_market_indexu16
- weighti64
AmmCachestruct
- bumpu8
- _padding[u8; 3]
- cacheVec<CacheInfo>
AmmCurveChangedstruct
- tsi64
- market_indexu16
- peg_multiplier_beforeu128
- base_asset_reserve_beforeu128
- quote_asset_reserve_beforeu128
- sqrt_k_beforeu128
- peg_multiplier_afteru128
- base_asset_reserve_afteru128
- quote_asset_reserve_afteru128
- sqrt_k_afteru128
- adjustment_costi128precision: QUOTE_PRECISION
- total_fee_minus_distributions_afteri128precision: QUOTE_PRECISION — AMM's TFMD after the change.
- oracle_pricei64precision: PRICE_PRECISION
AssetTierenum
- Collateral
- Protected
- Cross
- Isolated
- Unlisted
BuilderInfostruct
- authoritypubkey
- max_fee_tenth_bpsu16
- padding[u8; 6]
CacheInfostruct
- oraclepubkey
- last_fee_pool_token_amountu128
- last_net_pnl_pool_token_amounti128
- last_exchange_feesu128
- last_settle_amm_ex_feesu128
- last_settle_amm_pnli128
- positioni64BASE PRECISION
- slotu64
- last_settle_amountu64
- last_settle_slotu64
- last_settle_tsi64
- quote_owed_from_lp_pooli64
- amm_inventory_limiti64
- oracle_pricei64
- oracle_slotu64
- market_indexu16
- oracle_sourceu8
- oracle_validityu8
- lp_status_for_perp_marketu8
- amm_position_scalaru8
- _padding[u8; 34]
ConstituentParamsstruct
- max_weight_deviationOption<i64>
- swap_fee_minOption<i64>
- swap_fee_maxOption<i64>
- max_borrow_token_amountOption<u64>
- oracle_staleness_thresholdOption<u64>
- cost_to_trade_bpsOption<i32>
- constituent_derivative_indexOption<i16>
- derivative_weightOption<u64>
- volatilityOption<u64>
- gamma_executionOption<u8>
- gamma_inventoryOption<u8>
- xiOption<u8>
ContractTierenum
- A
- B
- C
- Speculative
- HighlySpeculative
- Isolated
ContractTypeenum
- Perpetual
- DeprecatedFuture
- DeprecatedPrediction
DeleteUserRecordstruct
- tsi64unix_timestamp of action
- user_authoritypubkey
- userpubkey
- sub_account_idu16
- keeperOption<pubkey>
DepositDirectionenum
- Deposit
- Withdraw
DepositExplanationenum
- None
- Transfer
- Borrow
- RepayBorrow
- Reward
DepositRecordstruct
- tsi64unix_timestamp of action
- user_authoritypubkey
- userpubkeyuser account public key
- directionDepositDirection
- deposit_record_idu64
- amountu64precision: token mint precision
- market_indexu16spot market index
- oracle_pricei64precision: PRICE_PRECISION
- market_deposit_balanceu128precision: SPOT_BALANCE_PRECISION
- market_withdraw_balanceu128precision: SPOT_BALANCE_PRECISION
- market_cumulative_deposit_interestu128precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- market_cumulative_borrow_interestu128precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- total_deposits_afteru64precision: QUOTE_PRECISION
- total_withdraws_afteru64precision: QUOTE_PRECISION
- explanationDepositExplanation
- transfer_userOption<pubkey>
- signerOption<pubkey>
- user_token_amount_afteri128precision: token mint precision
FeeLedgerstruct
- total_exchange_feeu128lifetime gross taker fees collected (analytics; not a routing driver) precision: QUOTE_PRECISION
- total_liquidation_feeu128lifetime liquidation fees charged to liquidatees (IF + protocol cuts; pure analytics — routing happens via the pending counters). precision: QUOTE_PRECISION
- pending_protocol_feeu128protocol (residual) carveouts accrued but not yet materialized into `protocol_fee_pool`. precision: QUOTE_PRECISION
- pending_if_feeu128insurance-fund carveouts accrued but not yet materialized into the quote `revenue_pool`; also the first bankruptcy tranche. precision: QUOTE_PRECISION
- amm_protocol_fees_receivedu128cumulative fee provision granted to the AMM via `amm_fee_numerator` — its backstop-of-last-resort tranche, drawable (and decremented) only in bankruptcy. The AMM's own spread/trading capital beyond this provision is never tapped. precision: QUOTE_PRECISION
- pending_amm_provisionu128AMM fee provision accrued at fill (already booked into the AMM's `total_fee_minus_distributions`) but not yet tokenized into `amm.fee_pool` by the sweep. Invariant: `<= amm_protocol_fees_received`. precision: QUOTE_PRECISION
FeeStructurestruct
- fee_tiers[FeeTier; 10]
- filler_reward_structureOrderFillerRewardStructure
- flat_filler_feeu64
- amm_fee_numeratoru32Share of the trade-fee *remainder* (taker fee after maker rebate, referral, referee discount, and filler reward are taken off the top) provisioned to the AMM as liquidity (its backstop-of-last-resort tranche, tracked in `PerpMarket.fee_ledger.amm_protocol_fees_received`). precision: FEE_PERCENTAGE_DENOMINATOR. `amm_fee_numerator + if_fee_numerator` must be <= FEE_PERCENTAGE_DENOMINATOR; the protocol receives the residual (`remainder − amm − if`) into its withdrawable `protocol_fee_pool`. (Was the reserved `padding: u64`, repartitioned into two u32s — size/alignment unchanged.)
- if_fee_numeratoru32Share of the trade-fee remainder routed to the insurance fund (`revenue_pool`).
FeeTierstruct
- fee_numeratoru32
- fee_denominatoru32
- maker_rebate_numeratoru32
- maker_rebate_denominatoru32
- referrer_reward_numeratoru32
- referrer_reward_denominatoru32
- referee_fee_numeratoru32
- referee_fee_denominatoru32
FundingPaymentRecordstruct
- tsi64
- user_authoritypubkey
- userpubkey
- market_indexu16
- funding_paymenti64precision: QUOTE_PRECISION
- base_asset_amounti64precision: BASE_PRECISION
- user_last_cumulative_fundingi64precision: FUNDING_RATE_PRECISION
- amm_cumulative_funding_longi128precision: FUNDING_RATE_PRECISION
- amm_cumulative_funding_shorti128precision: FUNDING_RATE_PRECISION
FundingRateRecordstruct
- tsi64
- record_idu64
- market_indexu16
- funding_ratei64precision: FUNDING_RATE_PRECISION
- funding_rate_longi128precision: FUNDING_RATE_PRECISION
- funding_rate_shorti128precision: FUNDING_RATE_PRECISION
- cumulative_funding_rate_longi128precision: FUNDING_RATE_PRECISION
- cumulative_funding_rate_shorti128precision: FUNDING_RATE_PRECISION
- oracle_price_twapi64precision: PRICE_PRECISION
- mark_price_twapu64precision: PRICE_PRECISION
- base_asset_amount_with_ammi128precision: BASE_PRECISION
HedgeConfigstruct
- pool_idu8The LP pool this market hedges into (`LPPool.pool_id`).
- statusu8Hedging enabled for this market; 0 disables it.
- paused_operationsu8Bitflags of paused `ConstituentLpOperation`s.
- exchange_fee_exclusion_scalaru8Scalar excluding a share of exchange fees from hedge routing.
- fee_transfer_scalaru8Scalar for the share of fees transferred to the hedge pool.
- padding[u8; 11]
HistoricalIndexDatastruct
- last_index_bid_priceu64precision: PRICE_PRECISION
- last_index_ask_priceu64precision: PRICE_PRECISION
- last_index_price_twapu64precision: PRICE_PRECISION
- last_index_price_twap_5minu64precision: PRICE_PRECISION
- last_index_price_twap_tsi64unix_timestamp of last snapshot
HistoricalOracleDatastruct
- last_oracle_pricei64precision: PRICE_PRECISION
- last_oracle_confu64precision: PRICE_PRECISION
- last_oracle_delayi64number of slots since last update
- last_oracle_price_twapi64precision: PRICE_PRECISION
- last_oracle_price_twap_5mini64precision: PRICE_PRECISION
- last_oracle_price_twap_tsi64unix_timestamp of last snapshot
HotRoleenum
- AmmCrank
- LpCache
- LpSwap
- LpSettle
- FeatureFlag
- Fuel
- UserFlag
- VaultDeposit
- MmOracleCrank
- AmmSpreadAdjust
- FeeWithdraw
InsuranceClaimstruct
- revenue_withdraw_since_last_settlei64The amount of revenue last settled Positive if funds left the perp market, negative if funds were pulled into the perp market precision: QUOTE_PRECISION
- max_revenue_withdraw_per_periodu64The max amount of revenue that can be withdrawn per period precision: QUOTE_PRECISION
- quote_max_insuranceu64The max amount of insurance that perp market can use to resolve bankruptcy and pnl deficits precision: QUOTE_PRECISION
- quote_settled_insuranceu64The amount of insurance that has been used to resolve bankruptcy and pnl deficits precision: QUOTE_PRECISION
- last_revenue_withdraw_tsi64The last time revenue was settled in/out of market
InsuranceFundstruct
- vaultpubkey
- total_sharesu128
- user_sharesu128
- shares_baseu128
- unstaking_periodi64
- last_revenue_settle_tsi64
- revenue_settle_periodi64How often `revenue_pool` may settle into the IF vault (seconds).
- if_fee_factoru32Fraction of spot deposit-interest gains carved out to the insurance fund (staker-owned). precision: IF_FACTOR_PRECISION. (Was `total_factor`; the protocol-vs-staker split was removed — the IF is now 100% staker-owned, so this is purely the staker IF carveout.)
- _padding_if[u8; 4]Was `user_factor` (the old protocol/staker split knob). The IF is now 100% staker-owned, so the split is gone; slot kept as padding.
InsuranceFundRecordstruct
- tsi64
- spot_market_indexu16
- perp_market_indexu16
- user_if_factoru32precision: PERCENTAGE_PRECISION
- total_if_factoru32precision: PERCENTAGE_PRECISION
- vault_amount_beforeu64precision: token mint precision
- insurance_vault_amount_beforeu64precision: token mint precision
- total_if_shares_beforeu128
- total_if_shares_afteru128
- amounti64precision: token mint precision
InsuranceFundStakestruct
- authoritypubkey
- if_sharesu128
- last_withdraw_request_sharesu128
- if_baseu128
- last_valid_tsi64
- last_withdraw_request_valueu64
- last_withdraw_request_tsi64
- cost_basisi64
- market_indexu16
- padding[u8; 14]
InsuranceFundStakeRecordstruct
- tsi64
- user_authoritypubkey
- actionStakeAction
- amountu64precision: token mint precision
- market_indexu16
- insurance_vault_amount_beforeu64precision: token mint precision
- if_shares_beforeu128
- user_if_shares_beforeu128
- total_if_shares_beforeu128
- if_shares_afteru128
- user_if_shares_afteru128
- total_if_shares_afteru128
LPBorrowLendDepositRecordstruct
- tsi64
- slotu64
- spot_market_indexu16
- constituent_indexu16
- directionDepositDirection
- token_balancei64
- last_token_balancei64
- interest_accrued_token_amounti64
- amount_deposit_withdrawu64
- lp_poolpubkey
LPMintRedeemRecordstruct
- tsi64
- slotu64
- authoritypubkey
- descriptionu8
- amountu128precision: continutent mint precision, gross fees
- feei128precision: fee on amount, constituent market mint precision
- spot_market_indexu16
- constituent_indexu16
- oracle_pricei64precision: PRICE_PRECISION
- mintpubkeytoken mint
- lp_amountu64lp amount, lp mint precision
- lp_feei64lp fee, lp mint precision
- lp_priceu128the fair price of the lp token, PRICE_PRECISION
- mint_redeem_idu64
- last_aumu128LPPool last_aum
- last_aum_slotu64
- in_market_current_weighti64PERCENTAGE_PRECISION
- in_market_target_weighti64
- lp_poolpubkey
LPSettleRecordstruct
- record_idu64
- last_tsi64
- last_slotu64
- tsi64
- slotu64
- perp_market_indexu16
- settle_to_lp_amounti64
- perp_amm_pnl_deltai64
- perp_amm_ex_fee_deltai64
- lp_aumu128
- lp_priceu128
- lp_poolpubkey
LPSwapRecordstruct
- tsi64
- slotu64
- authoritypubkey
- out_amountu128precision: out market mint precision, gross fees
- in_amountu128precision: in market mint precision, gross fees
- out_feei128precision: fee on amount_out, in market mint precision
- in_feei128precision: fee on amount_in, out market mint precision
- out_spot_market_indexu16
- in_spot_market_indexu16
- out_constituent_indexu16
- in_constituent_indexu16
- out_oracle_pricei64precision: PRICE_PRECISION
- in_oracle_pricei64precision: PRICE_PRECISION
- last_aumu128LPPool last_aum, QUOTE_PRECISION
- last_aum_slotu64
- in_market_current_weighti64PERCENTAGE_PRECISION
- out_market_current_weighti64PERCENTAGE_PRECISION
- in_market_target_weighti64PERCENTAGE_PRECISION
- out_market_target_weighti64PERCENTAGE_PRECISION
- in_swap_idu64
- out_swap_idu64
- lp_poolpubkey
LiquidateBorrowForPerpPnlRecordstruct
- perp_market_indexu16
- market_oracle_pricei64
- pnl_transferu128
- liability_market_indexu16
- liability_pricei64
- liability_transferu128
LiquidatePerpPnlForDepositRecordstruct
- perp_market_indexu16
- market_oracle_pricei64
- pnl_transferu128
- asset_market_indexu16
- asset_pricei64
- asset_transferu128
LiquidatePerpRecordstruct
- market_indexu16
- oracle_pricei64
- base_asset_amounti64
- quote_asset_amounti64
- fill_record_idu64
- user_order_idu32
- liquidator_order_idu32
- liquidator_feeu64precision: QUOTE_PRECISION
- if_feeu64precision: QUOTE_PRECISION
- protocol_feeu64protocol's cut, routed to the perp market's `protocol_fee_pool` precision: QUOTE_PRECISION
LiquidateSpotRecordstruct
- asset_market_indexu16
- asset_pricei64
- asset_transferu128
- liability_market_indexu16
- liability_pricei64
- liability_transferu128precision: token mint precision
- if_feeu64precision: token mint precision
- protocol_feeu64protocol's cut, routed to the liability market's `protocol_fee_pool` precision: token mint precision
LiquidationRecordstruct
- tsi64
- liquidation_typeLiquidationType
- userpubkey
- liquidatorpubkey
- margin_requirementu128
- total_collaterali128
- margin_freedu64
- liquidation_idu16
- bankruptbool
- canceled_order_idsVec<u32>
- liquidate_perpLiquidatePerpRecord
- liquidate_spotLiquidateSpotRecord
- liquidate_borrow_for_perp_pnlLiquidateBorrowForPerpPnlRecord
- liquidate_perp_pnl_for_depositLiquidatePerpPnlForDepositRecord
- perp_bankruptcyPerpBankruptcyRecord
- spot_bankruptcySpotBankruptcyRecord
- bit_flagsu8
LiquidationTypeenum
- LiquidatePerp
- LiquidateSpot
- LiquidateBorrowForPerpPnl
- LiquidatePerpPnlForDeposit
- PerpBankruptcy
- SpotBankruptcy
LpPoolParamsstruct
- max_settle_quote_amountOption<u64>
- volatilityOption<u64>
- gamma_executionOption<u8>
- xiOption<u8>
- max_aumOption<u128>
- whitelist_mintOption<pubkey>
MarketStatsstruct
- last_mark_price_twapu64Average estimate of (bid+ask)/2 price over funding_period. precision: PRICE_PRECISION
- last_mark_price_twap_5minu64Average estimate of (bid+ask)/2 price over FIVE_MINUTES.
- last_mark_price_twap_tsi64The last unix_timestamp the mark twap was updated.
- last_bid_price_twapu64Average estimate of bid price over funding_period. precision: PRICE_PRECISION
- last_ask_price_twapu64Average estimate of ask price over funding_period. precision: PRICE_PRECISION
- mark_stdu64Estimate of standard deviation of fill (mark) prices. precision: PRICE_PRECISION
- oracle_stdu64Estimate of standard deviation of the oracle price at each update. precision: PRICE_PRECISION
- last_oracle_conf_pctu64The pct size of the oracle confidence interval. precision: PERCENTAGE_PRECISION
- volume_24hu64Estimated total of volume in market. QUOTE_PRECISION
- long_intensity_volumeu64The volume intensity of long fills (across all makers).
- short_intensity_volumeu64The volume intensity of short fills (across all makers).
- last_trade_tsi64The blockchain unix_timestamp at the time of the last trade.
- last_24h_avg_funding_ratei64estimate of last 24h of funding rate perp market (unit is quote per base) Market-wide config / rolling stat — read by the AMM when computing `reference_price_offset` and by funding-rate updates. Migrated from `PerpMarket` so the AMM reads only from `MarketStats`. precision: QUOTE_PRECISION
- funding_periodi64the periodicity of the funding rate updates. Market-wide config used across the funding path. Migrated from `PerpMarket`.
- min_order_sizeu64the minimum base size of an order. Market-wide config read by the AMM when computing fallback prices / spread reserves. Migrated from `PerpMarket`. precision: BASE_PRECISION
- mm_oracle_pricei64MM oracle price snapshot (set by the native handler).
- mm_oracle_slotu64Slot at which the mm_oracle_* fields were last updated.
- mm_oracle_sequence_idu64Monotonically increasing sequence id for mm_oracle updates.
- last_oracle_normalised_pricei64Canonical sanitised/clamped oracle price — the latest oracle reading after normalisation (any quoter's view, not AMM-specific).
- last_reference_price_offseti32Previous reference price offset, written by `_update_amm` after a successful repeg/k_update. Read by `update_amm_quote_state` to implement the legacy time-decayed reference-price-offset smoothing transition — when the freshly computed offset's sign flips relative to this cached value AND `curve_update_intensity > 100`, the transition is clamped per-slot rather than snapping. Migrated from `AMM.reference_price_offset` (which was deleted in the AMM-decoupling refactor) so the smoothing behaviour is preserved across cranks. precision: PRICE_PRECISION
- last_oracle_validboolWhether the oracle was valid at the most recent `_update_amm`. Read by settlement and fill paths to gate operations.
- padding[u8; 3]Padding so last_funding_oracle_twap is 8-aligned.
- last_funding_oracle_twapi64Oracle TWAP captured at last funding update, the normalizer `last_24h_avg_funding_rate` accrued against. Read by the AMM's funding bias spread and `get_last_funding_basis`. Migrated from `PerpMarket` so the AMM reads only from `MarketStats`. precision: PRICE_PRECISION
- historical_oracle_dataHistoricalOracleDataHistorical oracle readings — TWAPs, last raw price, confidence, delay, timestamp. Market-wide data (any quoter would want it), updated by `_update_amm` / funding paths. Migrated from AMM.
MarketStatusenum
- Initialized
- Active
- ReduceOnly
- Settlement
- Delisted
MarketTypeenum
- Spot
- Perp
ModifyOrderParamsstruct
- directionOption<PositionDirection>
- base_asset_amountOption<u64>
- priceOption<u64>
- reduce_onlyOption<bool>
- post_onlyOption<PostOnlyParam>
- bit_flagsOption<u8>
- max_tsOption<i64>
- trigger_priceOption<u64>
- trigger_conditionOption<OrderTriggerCondition>
- oracle_price_offsetOption<i64>
- auction_durationOption<u8>
- auction_start_priceOption<i64>
- auction_end_priceOption<i64>
- policyOption<u8>
NewUserRecordstruct
- tsi64unix_timestamp of action
- user_authoritypubkey
- userpubkey
- sub_account_idu16
- name[u8; 32]
- referrerpubkey
OracleGuardRailsstruct
- price_divergencePriceDivergenceGuardRails
- validityValidityGuardRails
OracleSourceenum
- Pyth
- DeprecatedSwitchboard
- QuoteAsset
- Pyth1K
- Pyth1M
- PythStableCoin
- Prelaunch
- PythPull
- Pyth1KPull
- Pyth1MPull
- PythStableCoinPull
- DeprecatedSwitchboardOnDemand
- PythLazer
- PythLazer1K
- PythLazer1M
- PythLazerStableCoin
Orderstruct
- slotu64The slot the order was placed
- priceu64The limit price for the order (can be 0 for market orders) For orders with an auction, this price isn't used until the auction is complete precision: PRICE_PRECISION
- base_asset_amountu64The size of the order precision for perps: BASE_PRECISION precision for spot: token mint precision
- base_asset_amount_filledu64The amount of the order filled precision for perps: BASE_PRECISION precision for spot: token mint precision
- quote_asset_amount_filledu64The amount of quote filled for the order precision: QUOTE_PRECISION
- trigger_priceu64At what price the order will be triggered. Only relevant for trigger orders precision: PRICE_PRECISION
- auction_start_pricei64The start price for the auction. Only relevant for market/oracle orders precision: PRICE_PRECISION
- auction_end_pricei64The end price for the auction. Only relevant for market/oracle orders precision: PRICE_PRECISION
- max_tsi64The time when the order will expire
- oracle_price_offseti64If set, the order limit price is the oracle price + this offset precision: PRICE_PRECISION
- order_idu32The id for the order. Each users has their own order id space
- market_indexu16The perp/spot market index
- statusOrderStatusWhether the order is open or unused
- order_typeOrderTypeThe type of order
- market_typeMarketTypeWhether market is spot or perp
- user_order_idu8User generated order id. Can make it easier to place/cancel orders
- existing_position_directionPositionDirectionWhat the users position was when the order was placed
- directionPositionDirectionWhether the user is going long or short. LONG = bid, SHORT = ask
- reduce_onlyboolWhether the order is allowed to only reduce position size
- post_onlyboolWhether the order must be a maker
- immediate_or_cancelboolWhether the order must be canceled the same slot it is placed
- trigger_conditionOrderTriggerConditionWhether the order is triggered above or below the trigger price. Only relevant for trigger orders
- auction_durationu8How many slots the auction lasts
- posted_slot_tailu8Last 8 bits of the slot the order was posted on-chain (not order slot for signed msg orders)
- bit_flagsu8Bitflags for further classification 0: is_signed_message
- padding[u8; 5]
OrderActionenum
- Place
- Cancel
- Fill
- Trigger
- Expire
OrderActionExplanationenum
- None
- InsufficientFreeCollateral
- OraclePriceBreachedLimitPrice
- MarketOrderFilledToLimitPrice
- OrderExpired
- Liquidation
- OrderFilledWithAMM
- OrderFilledWithAMMJit
- OrderFilledWithMatch
- OrderFilledWithMatchJit
- MarketExpired
- RiskingIncreasingOrder
- ReduceOnlyOrderIncreasedPosition
- OrderFillWithSerum
- NoBorrowLiquidity
- OrderFillWithPhoenix
- OrderFilledWithAMMJitLPSplit
- OrderFilledWithLPJit
- DeriskLp
- OrderFilledWithOpenbookV2
- TransferPerpPosition
OrderActionRecordstruct
- tsi64
- actionOrderAction
- action_explanationOrderActionExplanation
- market_indexu16
- market_typeMarketType
- fillerOption<pubkey>
- filler_rewardOption<u64>precision: QUOTE_PRECISION
- fill_record_idOption<u64>
- base_asset_amount_filledOption<u64>precision: BASE_PRECISION (perp) or MINT_PRECISION (spot)
- quote_asset_amount_filledOption<u64>precision: QUOTE_PRECISION
- taker_feeOption<u64>precision: QUOTE_PRECISION
- maker_feeOption<i64>precision: QUOTE_PRECISION
- referrer_rewardOption<u32>precision: QUOTE_PRECISION
- quote_asset_amount_surplusOption<i64>precision: QUOTE_PRECISION
- spot_fulfillment_method_feeOption<u64>precision: QUOTE_PRECISION
- takerOption<pubkey>
- taker_order_idOption<u32>
- taker_order_directionOption<PositionDirection>
- taker_order_base_asset_amountOption<u64>precision: BASE_PRECISION (perp) or MINT_PRECISION (spot)
- taker_order_cumulative_base_asset_amount_filledOption<u64>precision: BASE_PRECISION (perp) or MINT_PRECISION (spot)
- taker_order_cumulative_quote_asset_amount_filledOption<u64>precision: QUOTE_PRECISION
- makerOption<pubkey>
- maker_order_idOption<u32>
- maker_order_directionOption<PositionDirection>
- maker_order_base_asset_amountOption<u64>precision: BASE_PRECISION (perp) or MINT_PRECISION (spot)
- maker_order_cumulative_base_asset_amount_filledOption<u64>precision: BASE_PRECISION (perp) or MINT_PRECISION (spot)
- maker_order_cumulative_quote_asset_amount_filledOption<u64>precision: QUOTE_PRECISION
- oracle_pricei64precision: PRICE_PRECISION
- bit_flagsu8Order bit flags, defined in [`crate::state::user::OrderBitFlag`]
- taker_existing_quote_entry_amountOption<u64>precision: QUOTE_PRECISION Only Some if the taker reduced position
- taker_existing_base_asset_amountOption<u64>precision: BASE_PRECISION Only Some if the taker flipped position direction
- maker_existing_quote_entry_amountOption<u64>precision: QUOTE_PRECISION Only Some if the maker reduced position
- maker_existing_base_asset_amountOption<u64>precision: BASE_PRECISION Only Some if the maker flipped position direction
- trigger_priceOption<u64>precision: PRICE_PRECISION
- builder_idxOption<u8>the idx of the builder in the taker's [`RevenueShareEscrow`] account
- builder_feeOption<u64>precision: QUOTE_PRECISION builder fee paid by the taker
OrderFillerRewardStructurestruct
- time_based_reward_lower_boundu128
- reward_numeratoru32
- reward_denominatoru32
- _padding[u8; 8]
OrderParamsstruct
- order_typeOrderType
- market_typeMarketType
- directionPositionDirection
- user_order_idu8
- base_asset_amountu64
- priceu64
- market_indexu16
- reduce_onlybool
- post_onlyPostOnlyParam
- bit_flagsu8
- max_tsOption<i64>
- trigger_priceOption<u64>
- trigger_conditionOrderTriggerCondition
- oracle_price_offsetOption<i64>
- auction_durationOption<u8>
- auction_start_priceOption<i64>
- auction_end_priceOption<i64>
- builder_idxOption<u8>the index into the placing user's RevenueShareEscrow.approved_builders list, if this order carries a builder code. Only honored for non-swift orders; swift orders carry the builder info in the signed message envelope instead.
- builder_fee_tenth_bpsOption<u16>the builder fee on this order, in tenths of a bps, e.g. 100 = 0.01%
OrderRecordstruct
- tsi64
- userpubkey
- orderOrder
OrderStatusenum
- Init
- Open
- Filled
- Canceled
OrderTriggerConditionenum
- Above
- Below
- TriggeredAbove
- TriggeredBelow
OrderTypeenum
- Market
- Limit
- TriggerMarket
- TriggerLimit
- Oracle
OverrideAmmCacheParamsstruct
- quote_owed_from_lp_poolOption<i64>
- last_settle_slotOption<u64>
- last_fee_pool_token_amountOption<u128>
- last_net_pnl_pool_token_amountOption<i128>
- amm_position_scalarOption<u8>
- amm_inventory_limitOption<i64>
PerpBankruptcyRecordstruct
- market_indexu16
- pnli128
- if_paymentu128
- clawback_userOption<pubkey>
- clawback_user_paymentOption<u128>
- cumulative_funding_rate_deltai128
PerpMarketstruct
- pubkeypubkeyThe perp market's address. It is a pda of the market index
- base_asset_amount_longi128always non-negative. tracks number of total longs in market (regardless of counterparty) precision: BASE_PRECISION
- base_asset_amount_shorti128always non-positive. tracks number of total shorts in market (regardless of counterparty) precision: BASE_PRECISION
- quote_asset_amounti128sum of all user's perp quote_asset_amount in market precision: QUOTE_PRECISION
- quote_entry_amount_longi128sum of all long user's quote_entry_amount in market precision: QUOTE_PRECISION
- quote_entry_amount_shorti128sum of all short user's quote_entry_amount in market precision: QUOTE_PRECISION
- quote_break_even_amount_longi128sum of all long user's quote_break_even_amount in market precision: QUOTE_PRECISION
- quote_break_even_amount_shorti128sum of all short user's quote_break_even_amount in market precision: QUOTE_PRECISION
- max_open_interestu128max allowed open interest, blocks trades that breach this value precision: BASE_PRECISION
- total_social_lossu128accumulated social loss paid by users since inception in market precision: QUOTE_PRECISION
- cumulative_funding_rate_longi128accumulated funding rate for longs since inception in market
- cumulative_funding_rate_shorti128accumulated funding rate for shorts since inception in market
- fee_ledgerFeeLedgerThe market's fee ledger: every fee-split counter in one place (gross analytics, pending protocol/IF carveouts, and the AMM's backstop tranche). Mutate through its accessor methods, not raw field writes.
- oraclepubkeyoracle price data public key
- pnl_poolPoolBalanceThe market's pnl pool. When users settle negative pnl, the balance increases. When users settle positive pnl, the balance decreases. Can not go negative.
- protocol_fee_poolPoolBalanceProtocol fees collected on this perp market, quote/USDC-denominated — a protocol-owned Deposit-type claim against the quote spot market vault (like `pnl_pool`; counted in the quote market's `deposit_balance`). Owned by the protocol, not users, and never part of the insurance backstop. `market_index` is set to `quote_spot_market_index`. Withdrawn directly to `State.protocol_fee_recipient_perp`.
- protocol_liquidation_feeu32Protocol's cut of a perp liquidation, taken from the liquidatee. precision: LIQUIDATOR_FEE_PRECISION
- _padding_buffer[u8; 4]
- fee_pool_buffer_targetu64The pnl-pool retention buffer the streaming sweep's IF and AMM-provision drains leave untouched: `sweep_market_fees` drains those pendings only from what the pnl pool holds above `max(net_user_pnl, 0) + fee_pool_buffer_target`. The protocol drain is EXEMPT — it reserves only `max(net_user_pnl, 0)` and runs first; it sweeps every settle, so each drain stays small, and its pending is no bankruptcy tranche so retaining it buys nothing. Why a buffer on top of the user-claims reservation: `net_user_pnl` is a mark-to-market snapshot, so a pool swept to the exact mark is short on the next adverse oracle tick — and the sweep is a one-way valve, so the slack can't be cheaply recalled (IF value returns only through capped gated paths, the AMM provision only via bankruptcy clawback). The buffer throttles those outflows per sweep; pool tokens are fungible (pendings are counters, not segregated tokens), so whichever cut lingers keeps settling winners in the meantime. This delays materialization, it does not divert anyone's cut. Side benefits: an unswept IF cut gives THIS market uncapped market-local bankruptcy coverage (tranche 1) instead of capped shared-vault coverage, and the buffer damps the IF settle ratchet (value settled into the IF accrues to stakers permanently). precision: QUOTE_PRECISION
- name[u8; 32]Encoded display name for the perp market e.g. SOL-PERP
- insurance_claimInsuranceClaimThe perp market's claim on the insurance fund
- last_funding_ratei64last funding rate in this perp market (unit is quote per base) precision: FUNDING_RATE_PRECISION
- last_funding_rate_longi64last funding rate for longs in this perp market (unit is quote per base) precision: FUNDING_RATE_PRECISION
- last_funding_rate_shorti64last funding rate for shorts in this perp market (unit is quote per base) precision: QUOTE_PRECISION
- last_funding_rate_tsi64the last funding rate update unix_timestamp
- net_unsettled_funding_pnli64unsettled funding pnl across the market (protocol-wide)
- funding_clamp_thresholdu32dead-zone threshold for the funding premium. mark/oracle twap spreads within +/- this band are treated as noise and add no premium; spreads past it are shrunk toward zero by this amount so funding stays continuous across the boundary. fit per market post-launch precision: BPS_PRECISION
- funding_ramp_slopeu32slope of the funding premium ramp above the dead zone. 1.0x passes the shrunk spread through unchanged; higher leans into the premium harder fit per market post-launch precision: PERCENTAGE_PRECISION
- order_step_sizeu64the base step size (increment) of orders precision: BASE_PRECISION
- order_tick_sizeu64the price tick size of orders precision: PRICE_PRECISION
- unrealized_pnl_max_imbalanceu64The max pnl imbalance before positive pnl asset weight is discounted pnl imbalance is the difference between long and short pnl. When it's greater than 0, the amm has negative pnl and the initial asset weight for positive pnl is discounted precision = QUOTE_PRECISION
- expiry_tsi64The ts when the market will be expired. Only set if market is in reduce only mode
- expiry_pricei64The price at which positions will be settled. Only set if market is expired precision = PRICE_PRECISION
- next_fill_record_idu64Every trade has a fill record id. This is the next id to be used
- next_funding_rate_record_idu64Every funding rate update has a record id. This is the next id to be used
- imf_factoru32The initial margin fraction factor. Used to increase margin ratio for large positions precision: MARGIN_PRECISION
- unrealized_pnl_imf_factoru32The imf factor for unrealized pnl. Used to discount asset weight for large positive pnl precision: MARGIN_PRECISION
- liquidator_feeu32The fee the liquidator is paid for taking over perp position precision: LIQUIDATOR_FEE_PRECISION
- if_liquidation_feeu32The fee the insurance fund receives from liquidation precision: LIQUIDATOR_FEE_PRECISION
- margin_ratio_initialu32The margin ratio which determines how much collateral is required to open a position e.g. margin ratio of .1 means a user must have $100 of total collateral to open a $1000 position precision: MARGIN_PRECISION
- margin_ratio_maintenanceu32The margin ratio which determines when a user will be liquidated e.g. margin ratio of .05 means a user must have $50 of total collateral to maintain a $1000 position else they will be liquidated precision: MARGIN_PRECISION
- unrealized_pnl_initial_asset_weightu32The initial asset weight for positive pnl. Negative pnl always has an asset weight of 1 precision: SPOT_WEIGHT_PRECISION
- unrealized_pnl_maintenance_asset_weightu32The maintenance asset weight for positive pnl. Negative pnl always has an asset weight of 1 precision: SPOT_WEIGHT_PRECISION
- number_of_users_with_baseu32number of users in a position (base)
- number_of_usersu32number of users in a position (pnl) or pnl (quote)
- market_indexu16
- statusMarketStatusWhether a market is active, reduce only, expired, etc Affects whether users can open/close positions
- contract_typeContractTypeCurrently only Perpetual markets are supported
- contract_tierContractTierThe contract tier determines how much insurance a market can receive, with more speculative markets receiving less insurance It also influences the order perp markets can be liquidated, with less speculative markets being liquidated first
- paused_operationsu8
- quote_spot_market_indexu16The spot market that pnl is settled in
- fee_adjustmenti16Between -100 and 100, represents what % to increase/decrease the fee by E.g. if this is -50 and the fee is 5bps, the new fee will be 2.5bps if this is 50 and the fee is 5bps, the new fee will be 7.5bps
- _padding_align_lfp[u8; 6]Explicit padding so the IDL records the 6 bytes the Rust compiler inserts to 8-align `last_fill_price`. Without this the JS borsh decoder (which reads sequentially after the variable-span enum `status`) reads every field past `fee_adjustment` 6 bytes early.
- last_fill_priceu64
- pool_idu8
- _padding_pmm[u8; 2]
- _padding_hedge[u8; 5]Was `lp_fee_transfer_scalar`, `lp_status`, `lp_paused_operations`, `lp_exchange_fee_excluscion_scalar`, `lp_pool_id` (5×u8). Relocated into `hedge_config` at the tail; kept as reserved bytes so existing account byte offsets (and snapshots) are undisturbed.
- market_configu8
- oracle_sourceOracleSourcethe oracle provider information. used to decode/scale the oracle public key
- oracle_slot_delay_overridei8override for the per-fill slot delay required from the oracle (default -1 = use state default)
- oracle_low_risk_slot_delay_overridei8the override for the state.min_perp_auction_duration 0 is no override, -1 is disable speed bump, 1-100 is literal speed bump
- bankruptcy_if_floor_pctu32Floor on the unswept IF-fee carveout, as a percentage of open-interest notional (PERCENTAGE_PRECISION; 0 disables). The fee sweep's IF drain leaves `pending_if_fee` at (at least) this floor, so a standing first-loss tranche is always available to `resolve_perp_bankruptcy` — a permissionless sweep (or the inline sweep on any pnl settle) cannot drain the tranche below it ahead of a bankruptcy resolution. Notional is valued at the market's own oracle TWAP so a manipulated spot print can't crush the floor. Occupies the former 4-byte trailing padding before `market_stats` (same offset/alignment on all targets), so existing accounts read 0 = disabled until the admin sets it; new markets initialize to `DEFAULT_BANKRUPTCY_IF_FLOOR_PCT`.
- market_statsMarketStatsMarket-wide stats shared across all makers: mark/oracle TWAPs, std, volume, intensity, mm-oracle snapshot, `historical_oracle_data`, `last_oracle_normalised_price`, `last_oracle_valid`. Writers (e.g. `MarketStats::update_mark_std`, `update_volume_24h`, native `handle_update_mm_oracle_native`) update this directly.
- _padding_align_amm[u8; 8]8 bytes of explicit padding so MarketStats (216 bytes) plus this padding equals 224 bytes — the offset Rust naturally inserts to 16-align AMM's leading u128. Making it explicit keeps the IDL byte layout aligned with `repr(C)`.
- ammAMMThe automated market maker. Last field so future quoter modules can land in the trailing region without disturbing earlier byte offsets — in the target architecture this account holds back-to-back per-quoter state slices (AMM, DLOB-maker state, future propAMM-style participants, …) and each module owns a contiguous span starting at a known offset.
- hedge_configHedgeConfigThis market's hedge (LP pool) configuration. Sits immediately after `amm` so the trailing `[amm, hedge_config]` span is the contiguous VLP region.
PerpMarketFeeSweepRecordstruct
- tsi64unix_timestamp of action
- market_indexu16
- if_sweptu64pending insurance cut moved to the quote spot market's revenue_pool
- protocol_sweptu64pending protocol cut moved to the market's protocol_fee_pool
- amm_provision_tokenizedu64AMM fee provision tokenized into amm.fee_pool (booked at fill)
PerpPositionstruct
- last_cumulative_funding_ratei64The perp market's last cumulative funding rate. Used to calculate the funding payment owed to user precision: FUNDING_RATE_PRECISION
- base_asset_amounti64the size of the users perp position precision: BASE_PRECISION
- quote_asset_amounti64Used to calculate the users pnl. Upon entry, is equal to base_asset_amount * avg entry price - fees Updated when the user open/closes position or settles pnl. Includes fees/funding precision: QUOTE_PRECISION
- quote_break_even_amounti64The amount of quote the user would need to exit their position at to break even Updated when the user open/closes position or settles pnl. Includes fees/funding precision: QUOTE_PRECISION
- quote_entry_amounti64The amount quote the user entered the position with. Equal to base asset amount * avg entry price Updated when the user open/closes position. Excludes fees/funding precision: QUOTE_PRECISION
- open_bidsi64The amount of non reduce only trigger orders the user has open precision: BASE_PRECISION
- open_asksi64The amount of non reduce only trigger orders the user has open precision: BASE_PRECISION
- settled_pnli64The amount of pnl settled in this market since opening the position precision: QUOTE_PRECISION
- isolated_position_scaled_balanceu64The scaled balance of the isolated position precision: SPOT_BALANCE_PRECISION
- padding[u8; 2]
- max_margin_ratiou16
- market_indexu16The market index for the perp market
- open_ordersu8The number of open orders
- position_flagu8
PoolBalancestruct
- scaled_balanceu128To get the pool's token amount, you must multiply the scaled balance by the market's cumulative deposit interest precision: SPOT_BALANCE_PRECISION
- market_indexu16The spot market the pool is for
- padding[u8; 14]
PositionDirectionenum
- Long
- Short
PostOnlyParamenum
- None
- MustPostOnly
- TryPostOnly
- Slide
PrelaunchOraclestruct
- pricei64
- max_pricei64
- confidenceu64
- last_update_slotu64
- amm_last_update_slotu64
- perp_market_indexu16
- padding[u8; 70]
PrelaunchOracleParamsstruct
- perp_market_indexu16
- priceOption<i64>
- max_priceOption<i64>
PriceDivergenceGuardRailsstruct
- mark_oracle_percent_divergenceu64
- oracle_twap_5min_percent_divergenceu64
ProtocolFeeWithdrawRecordstruct
- tsi64unix_timestamp of action
- market_indexu16perp market index for a perp-fee withdrawal, else the spot market index
- is_perpbooltrue if this withdrawal drained a perp market's protocol_fee_pool (sourced from the quote spot vault), false for a spot market withdrawal
- spot_market_indexu16the spot market the tokens were drawn from
- amountu64
- recipient_token_accountpubkey
PythLazerOraclestruct
- pricei64
- publish_timeu64
- posted_slotu64
- exponenti32
- _padding[u8; 4]
- confu64
ReferrerNamestruct
- authoritypubkey
- userpubkey
- user_statspubkey
- name[u8; 32]
RevenueSharestruct
- authoritypubkeythe owner of this account, a builder or referrer
- total_referrer_rewardsu64
- total_builder_rewardsu64
- padding[u8; 24]
RevenueShareEscrowstruct
- authoritypubkeythe owner of this account, a user
- referrerpubkey
- reserved_fixed[u8; 24]
- padding0u32
- ordersVec<RevenueShareOrder>
- padding1u32
- approved_buildersVec<BuilderInfo>
RevenueShareOrderstruct
- fees_accruedu64fees accrued so far for this order slot. This is not exclusively fees from this order_id and may include fees from other orders in the same market. This may be swept to the builder's SpotPosition during settle_pnl.
- order_idu32the order_id of the current active order in this slot. It's only relevant while bit_flag = Open
- fee_tenth_bpsu16the builder fee on this order, in tenths of a bps, e.g. 100 = 0.01%
- market_indexu16
- sub_account_idu16the subaccount_id of the user who created this order. It's only relevant while bit_flag = Open
- builder_idxu8the index of the RevenueShareEscrow.approved_builders list, that this order's fee will settle to. Ignored if bit_flag = Referral.
- bit_flagsu8bitflags that describe the state of the order. [`RevenueShareOrderBitFlag::Init`]: this order slot is available for use. [`RevenueShareOrderBitFlag::Open`]: this order slot is occupied, `order_id` is the `sub_account_id`'s active order. [`RevenueShareOrderBitFlag::Completed`]: this order has been filled or canceled, and is waiting to be settled into. the builder's account order_id and sub_account_id are no longer relevant, it may be merged with other orders. [`RevenueShareOrderBitFlag::Referral`]: this order stores referral rewards waiting to be settled for this market. If it is set, no other bitflag should be set.
- user_order_indexu8the index into the User's orders list when this RevenueShareOrder was created, make sure to verify that order_id matches.
- market_typeMarketType
- padding[u8; 10]
RevenueShareSettleRecordstruct
- tsi64
- builderOption<pubkey>
- referrerOption<pubkey>
- fee_settledu64
- market_indexu16
- market_typeMarketType
- builder_sub_account_idu16
- builder_total_referrer_rewardsu64
- builder_total_builder_rewardsu64
ScaleOrderParamsstruct
- market_typeMarketType
- directionPositionDirection
- market_indexu16
- total_base_asset_amountu64Total base asset amount to distribute across all orders
- start_priceu64Starting price for the scale (in PRICE_PRECISION)
- end_priceu64Ending price for the scale (in PRICE_PRECISION)
- order_countu8Number of orders to place (min 2, max 32)
- size_distributionSizeDistributionHow to distribute sizes across orders
- reduce_onlyboolWhether orders should be reduce-only
- post_onlyPostOnlyParamPost-only setting for all orders
- bit_flagsu8Order bit flags
- max_tsOption<i64>Maximum timestamp for orders to be valid
SettlePnlExplanationenum
- None
- ExpiredPosition
SettlePnlModeenum
- MustSettle
- TrySettle
SettlePnlRecordstruct
- tsi64
- userpubkey
- market_indexu16
- pnli128
- base_asset_amounti64
- quote_asset_amount_afteri64
- quote_entry_amounti64
- settle_pricei64
- explanationSettlePnlExplanation
SignedMsgOrderIdstruct
- uuid[u8; 8]
- max_slotu64
- order_idu32
- paddingu32
SignedMsgOrderParamsDelegateMessagestruct
- signed_msg_order_paramsOrderParams
- taker_pubkeypubkey
- slotu64
- uuid[u8; 8]
- take_profit_order_paramsOption<SignedMsgTriggerOrderParams>
- stop_loss_order_paramsOption<SignedMsgTriggerOrderParams>
- max_margin_ratioOption<u16>
- builder_idxOption<u8>
- builder_fee_tenth_bpsOption<u16>
- isolated_position_depositOption<u64>
SignedMsgOrderParamsMessagestruct
- signed_msg_order_paramsOrderParams
- sub_account_idu16
- slotu64
- uuid[u8; 8]
- take_profit_order_paramsOption<SignedMsgTriggerOrderParams>
- stop_loss_order_paramsOption<SignedMsgTriggerOrderParams>
- max_margin_ratioOption<u16>
- builder_idxOption<u8>
- builder_fee_tenth_bpsOption<u16>
- isolated_position_depositOption<u64>
SignedMsgOrderRecordstruct
- userpubkey
- hashstring
- matching_order_paramsOrderParams
- user_order_idu32
- signed_msg_order_max_slotu64
- signed_msg_order_uuid[u8; 8]
- tsi64
SignedMsgTriggerOrderParamsstruct
- trigger_priceu64
- base_asset_amountu64
SignedMsgUserOrdersstruct
- authority_pubkeypubkey
- paddingu32
- signed_msg_order_dataVec<SignedMsgOrderId>
SignedMsgWsDelegatesstruct
- delegatesVec<pubkey>
SizeDistributionenum
- Flat
- Ascending
- Descending
SpotBalanceTypeenum
- Deposit
- Borrow
SpotBankruptcyRecordstruct
- market_indexu16
- borrow_amountu128
- if_paymentu128
- cumulative_deposit_interest_deltau128
SpotInterestRecordstruct
- tsi64
- market_indexu16
- deposit_balanceu128precision: SPOT_BALANCE_PRECISION
- cumulative_deposit_interestu128precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- borrow_balanceu128precision: SPOT_BALANCE_PRECISION
- cumulative_borrow_interestu128precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- optimal_utilizationu32precision: PERCENTAGE_PRECISION
- optimal_borrow_rateu32precision: PERCENTAGE_PRECISION
- max_borrow_rateu32precision: PERCENTAGE_PRECISION
SpotMarketstruct
- pubkeypubkeyThe address of the spot market. It is a pda of the market index
- oraclepubkeyThe oracle used to price the markets deposits/borrows
- mintpubkeyThe token mint of the market
- vaultpubkeyThe vault used to store the market's deposits The amount in the vault should be equal to or greater than deposits - borrows
- name[u8; 32]The encoded display name for the market e.g. SOL
- insurance_fundInsuranceFundDetails on the insurance fund covering bankruptcies in this markets token Covers bankruptcies for borrows with this markets token and perps settling in this markets token
- total_spot_feeu128The total spot fees collected for this market precision: QUOTE_PRECISION
- deposit_balanceu128The sum of the scaled balances for deposits across users and pool balances To convert to the deposit token amount, multiply by the cumulative deposit interest precision: SPOT_BALANCE_PRECISION
- borrow_balanceu128The sum of the scaled balances for borrows across users and pool balances To convert to the borrow token amount, multiply by the cumulative borrow interest precision: SPOT_BALANCE_PRECISION
- cumulative_deposit_interestu128The cumulative interest earned by depositors Used to calculate the deposit token amount from the deposit balance precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- cumulative_borrow_interestu128The cumulative interest earned by borrowers Used to calculate the borrow token amount from the borrow balance precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- total_social_lossu128The total socialized loss from borrows, in the mint's token precision: token mint precision
- total_quote_social_lossu128The total socialized loss from borrows, in the quote market's token preicision: QUOTE_PRECISION
- revenue_poolPoolBalanceRevenue the protocol has collected in this markets token e.g. for SOL-PERP, funds can be settled in usdc and will flow into the USDC revenue pool
- spot_fee_poolPoolBalanceThe fees collected from swaps between this market and the quote market Is settled to the quote markets revenue pool
- historical_oracle_dataHistoricalOracleData
- historical_index_dataHistoricalIndexData
- withdraw_guard_thresholdu64no withdraw limits/guards when deposits below this threshold precision: token mint precision
- max_token_depositsu64The max amount of token deposits in this market 0 if there is no limit precision: token mint precision
- deposit_token_twapu6424hr average of deposit token amount precision: token mint precision
- borrow_token_twapu6424hr average of borrow token amount precision: token mint precision
- utilization_twapu6424hr average of utilization which is borrow amount over token amount precision: SPOT_UTILIZATION_PRECISION
- last_interest_tsu64Last time the cumulative deposit and borrow interest was updated
- last_twap_tsu64Last time the deposit/borrow/utilization averages were updated
- expiry_tsi64The time the market is set to expire. Only set if market is in reduce only mode
- order_step_sizeu64Spot orders must be a multiple of the step size precision: token mint precision
- order_tick_sizeu64Spot orders must be a multiple of the tick size precision: PRICE_PRECISION
- min_order_sizeu64The minimum order size precision: token mint precision
- max_position_sizeu64The maximum spot position size if the limit is 0, there is no limit precision: token mint precision
- next_fill_record_idu64Every spot trade has a fill record id. This is the next id to use
- next_deposit_record_idu64Every deposit has a deposit record id. This is the next id to use
- initial_asset_weightu32The initial asset weight used to calculate a deposits contribution to a users initial total collateral e.g. if the asset weight is .8, $100 of deposits contributes $80 to the users initial total collateral precision: SPOT_WEIGHT_PRECISION
- maintenance_asset_weightu32The maintenance asset weight used to calculate a deposits contribution to a users maintenance total collateral e.g. if the asset weight is .9, $100 of deposits contributes $90 to the users maintenance total collateral precision: SPOT_WEIGHT_PRECISION
- initial_liability_weightu32The initial liability weight used to calculate a borrows contribution to a users initial margin requirement e.g. if the liability weight is .9, $100 of borrows contributes $90 to the users initial margin requirement precision: SPOT_WEIGHT_PRECISION
- maintenance_liability_weightu32The maintenance liability weight used to calculate a borrows contribution to a users maintenance margin requirement e.g. if the liability weight is .8, $100 of borrows contributes $80 to the users maintenance margin requirement precision: SPOT_WEIGHT_PRECISION
- imf_factoru32The initial margin fraction factor. Used to increase liability weight/decrease asset weight for large positions precision: MARGIN_PRECISION
- liquidator_feeu32The fee the liquidator is paid for taking over borrow/deposit precision: LIQUIDATOR_FEE_PRECISION
- if_liquidation_feeu32The fee the insurance fund receives from liquidation precision: LIQUIDATOR_FEE_PRECISION
- optimal_utilizationu32The optimal utilization rate for this market. Used to determine the markets borrow rate precision: SPOT_UTILIZATION_PRECISION
- optimal_borrow_rateu32The borrow rate for this market when the market has optimal utilization precision: SPOT_RATE_PRECISION
- max_borrow_rateu32The borrow rate for this market when the market has 1000 utilization precision: SPOT_RATE_PRECISION
- decimalsu32The market's token mint's decimals. To from decimals to a precision, 10^decimals
- market_indexu16
- orders_enabledboolWhether or not spot trading is enabled
- oracle_sourceOracleSource
- statusMarketStatus
- asset_tierAssetTierThe asset tier affects how a deposit can be used as collateral and the priority for a borrow being liquidated
- paused_operationsu8
- if_paused_operationsu8
- fee_adjustmenti16
- max_token_borrows_fractionu16What fraction of max_token_deposits disabled when 0, 1 => 1/10000 => .01% of max_token_deposits precision: X/10000
- flash_loan_amountu64For swaps, the amount of token loaned out in the begin_swap ix precision: token mint precision
- flash_loan_initial_token_amountu64For swaps, the amount in the users token account in the begin_swap ix Used to calculate how much of the token left the system in end_swap ix precision: token mint precision
- total_swap_feeu64The total fees received from swaps precision: token mint precision
- scale_initial_asset_weight_startu64When to begin scaling down the initial asset weight disabled when 0 precision: QUOTE_PRECISION
- min_borrow_rateu8The min borrow rate for this market when the market regardless of utilization 1 => 1/200 => .5% precision: X/200
- token_program_flagu8
- pool_idu8
- _padding_align_pfp[u8; 8]Aligns `protocol_fee_pool`'s leading u128 to a 16-byte struct offset so host (x86_64, align 16) and SBF (align 8) layouts agree. Do not reorder.
- protocol_fee_poolPoolBalanceProtocol fees collected in this market's token (lending protocol carveout + spot-liquidation protocol fee). A protocol-owned Deposit-type claim inside the spot vault (counted in `deposit_balance`, like `revenue_pool`) — owned by the protocol, not users, and never part of the insurance backstop. Withdrawn directly to `State.protocol_fee_recipient_spot`; the withdrawal decrements this claim and re-validates the vault still covers all remaining claims, so it can never tap user deposits.
- protocol_liquidation_feeu32Protocol's cut of a spot liquidation, taken from the liquidatee. precision: LIQUIDATOR_FEE_PRECISION
- protocol_fee_factoru32Protocol's carveout of lending deposit-interest gains, routed to `protocol_fee_pool`. precision: IF_FACTOR_PRECISION
- padding[u8; 8]
SpotMarketVaultDepositRecordstruct
- tsi64
- market_indexu16
- deposit_balanceu128precision: SPOT_BALANCE_PRECISION
- cumulative_deposit_interest_beforeu128precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- cumulative_deposit_interest_afteru128precision: SPOT_CUMULATIVE_INTEREST_PRECISION
- deposit_token_amount_beforeu64
- amountu64
SpotPositionstruct
- scaled_balanceu64The scaled balance of the position. To get the token amount, multiply by the cumulative deposit/borrow interest of corresponding market. precision: SPOT_BALANCE_PRECISION
- open_bidsi64How many spot non reduce only trigger orders the user has open precision: token mint precision
- open_asksi64How many spot non reduce only trigger orders the user has open precision: token mint precision
- cumulative_depositsi64The cumulative deposits/borrows a user has made into a market precision: token mint precision
- market_indexu16The market index of the corresponding spot market
- balance_typeSpotBalanceTypeWhether the position is deposit or borrow
- open_ordersu8Number of open orders
- padding[u8; 4]
StakeActionenum
- Stake
- UnstakeRequest
- UnstakeCancelRequest
- Unstake
- UnstakeTransfer
- StakeTransfer
- AdminDeposit
Statestruct
- cold_adminpubkeyRoot authority. Set at `initialize`; only this key can rotate `warm_admin` and `pause_admin`. Expected to sit behind a (small) timelocked multisig.
- warm_adminpubkeyOperational authority (e.g. multisig+timelock). Can rotate the 10 hot keys below. `Pubkey::default()` means unset — only `cold_admin` can act in that case.
- pause_adminpubkeyEmergency-pause authority. No on-chain timelock — intended to live behind a fast-acting multisig that can flip pause flags without delay. May only *add* pause bits (never clear them); cold/warm retain full pause + unpause power. `Pubkey::default()` means unassigned (only cold/warm can pause).
- hot_amm_crankpubkeyPurpose-specific bot keys. `Pubkey::default()` means the role is unassigned and only warm/cold can call handlers gated on that role.
- hot_lp_cachepubkey
- hot_lp_swappubkey
- hot_lp_settlepubkey
- hot_feature_flagpubkey
- hot_fuelpubkey
- hot_user_flagpubkey
- hot_vault_depositpubkey
- hot_mm_oracle_crankpubkey
- hot_amm_spread_adjustpubkey
- whitelist_mintpubkey
- discount_mintpubkey
- signerpubkey
- srm_vaultpubkey
- perp_fee_structureFeeStructure
- spot_fee_structureFeeStructure
- oracle_guard_railsOracleGuardRails
- number_of_authoritiesu64
- number_of_sub_accountsu64
- liquidation_margin_buffer_ratiou32
- settlement_durationu16
- number_of_marketsu16
- number_of_spot_marketsu16
- signer_nonceu8
- min_perp_auction_durationu8
- default_market_order_time_in_forceu8
- default_spot_auction_durationu8
- exchange_statusu8
- liquidation_durationu8
- initial_pct_to_liquidateu16
- max_number_of_sub_accountsu16
- max_initialize_user_feeu16
- feature_bit_flagsu8
- lp_pool_feature_bit_flagsu8
- solvency_statusu8Bitmask of `SolvencyStatus` flags. Gates internal solvency-repair flows (bankruptcy / pnl-deficit resolution) independently of `WithdrawPaused`, so user withdrawals can be halted while repair keeps running, or repair can be frozen on its own when an oracle is suspect. `0` = repair allowed.
- protocol_fee_recipient_perppubkeyTreasury that PERP protocol fees (quote-denominated) may be withdrawn to. Settable only by `cold_admin`. `withdraw_protocol_fees_perp` pays this key's associated token account (recipient-locked). `Pubkey::default()` (unset) makes perp withdrawals inert.
- protocol_fee_recipient_spotpubkeyTreasury that SPOT protocol fees (each market's own token: lending carveouts + spot-liquidation cuts) may be withdrawn to. Settable only by `cold_admin`. `withdraw_protocol_fees_spot` pays this key's associated token account for the market's mint (recipient-locked). `Pubkey::default()` (unset) makes spot withdrawals inert.
- hot_fee_withdrawpubkeyHot key authorized for the `FeeWithdraw` role (triggers protocol-fee withdrawals to the configured recipients).
- padding[u8; 271]
SwapRecordstruct
- tsi64
- userpubkey
- amount_outu64precision: out market mint precision
- amount_inu64precision: in market mint precision
- out_market_indexu16
- in_market_indexu16
- out_oracle_pricei64precision: PRICE_PRECISION
- in_oracle_pricei64precision: PRICE_PRECISION
- feeu64
SwapReduceOnlyenum
- In
- Out
TransferFeeAndPnlPoolDirectionenum
- FeeToPnlPool
- PnlToFeePool
TransferFeeAndPnlPoolRecordstruct
- tsi64
- slotu64
- perp_market_index_with_fee_poolu16
- perp_market_index_with_pnl_poolu16
- directionTransferFeeAndPnlPoolDirection
- amountu64
UpdatePerpMarketSummaryStatsParamsstruct
- net_unsettled_funding_pnlOption<i64>
- update_amm_summary_statsOption<bool>
Userstruct
- authoritypubkeyThe owner/authority of the account
- delegatepubkeyAn addresses that can control the account on the authority's behalf. Has limited power, cant withdraw
- name[u8; 32]Encoded display name e.g. "toly"
- spot_positions[SpotPosition; 8]The user's spot positions
- perp_positions[PerpPosition; 8]The user's perp positions
- orders[Order; 32]The user's orders
- total_depositsu64The total values of deposits the user has made precision: QUOTE_PRECISION
- total_withdrawsu64The total values of withdrawals the user has made precision: QUOTE_PRECISION
- total_social_lossu64The total socialized loss the users has incurred upon the protocol precision: QUOTE_PRECISION
- settled_perp_pnli64Fees (taker fees, maker rebate, referrer reward, filler reward) and pnl for perps precision: QUOTE_PRECISION
- cumulative_spot_feesi64Fees (taker fees, maker rebate, filler reward) for spot precision: QUOTE_PRECISION
- cumulative_perp_fundingi64Cumulative funding paid/received for perps precision: QUOTE_PRECISION
- liquidation_margin_freedu64The amount of margin freed during liquidation. Used to force the liquidation to occur over a period of time Defaults to zero when not being liquidated precision: QUOTE_PRECISION
- last_active_slotu64The last slot a user was active. Used to determine if a user is idle
- next_order_idu32Every user order has an order id. This is the next order id to be used
- max_margin_ratiou32Custom max initial margin ratio for the user
- next_liquidation_idu16The next liquidation id to be used for user
- sub_account_idu16The sub account id for this user
- statusu8Whether the user is active, being liquidated or bankrupt
- is_margin_trading_enabledboolWhether the user has enabled margin trading
- idleboolUser is idle if they haven't interacted with the protocol in 1 week and they have no orders, perp positions or borrows Off-chain keeper bots can ignore users that are idle
- open_ordersu8number of open orders
- has_open_orderboolWhether or not user has open order
- open_auctionsu8number of open orders with auction
- has_open_auctionboolWhether or not user has open order with auction
- pool_idu8
- special_user_statusu8Whether the user is a special user (vamm hedger, etc)
- padding[u8; 3]
- equity_flooru64Minimum account equity (cross-margin total collateral) required for risk-increasing orders, fills, withdrawals and deposit transfers. Settable only by the warm/cold admin; 0 disables the check. precision: QUOTE_PRECISION
- padding2[u8; 8]
UserFeesstruct
- total_fee_paidu64Total taker fee paid precision: QUOTE_PRECISION
- total_fee_rebateu64Total maker fee rebate precision: QUOTE_PRECISION
- total_token_discountu64Total discount from holding token precision: QUOTE_PRECISION
- total_referee_discountu64Total discount from being referred precision: QUOTE_PRECISION
UserStatsstruct
- authoritypubkeyThe authority for all of a users sub accounts
- referrerpubkeyThe address that referred this user
- feesUserFeesStats on the fees paid by the user
- maker_volume_30du64Rolling 30day maker volume for user precision: QUOTE_PRECISION
- taker_volume_30du64Rolling 30day taker volume for user precision: QUOTE_PRECISION
- filler_volume_30du64Rolling 30day filler volume for user precision: QUOTE_PRECISION
- last_maker_volume_30d_tsi64last time the maker volume was updated
- last_taker_volume_30d_tsi64last time the taker volume was updated
- last_filler_volume_30d_tsi64last time the filler volume was updated
- if_staked_quote_asset_amountu64The amount of tokens staked in the quote spot markets if
- number_of_sub_accountsu16The current number of sub accounts
- number_of_sub_accounts_createdu16The number of sub accounts created. Can be greater than the number of sub accounts if user has deleted sub accounts
- referrer_statusu8Flags for referrer status: First bit (LSB): 1 if user is a referrer, 0 otherwise Second bit: 1 if user was referred, 0 otherwise
- disable_update_perp_bid_ask_twapu8
- paused_operationsu8
- padding1[u8; 9]9 bytes: 1 byte of former repr(C) alignment padding + the removed 8-byte `if_staked_gov_token_amount` field (gov-token stake fee discount)
- delegate_permissionsu8Delegate permissions across all sub accounts
- equity_breaker_trippedu8Set by the permissionless `trip_equity_floor_breaker` instruction when any of the authority's subaccounts falls below its equity floor. While set, every subaccount of the authority rejects risk-increasing fills, withdrawals and transfers out. Cleared only by the warm admin.
- padding[u8; 62]
ValidityGuardRailsstruct
- slots_before_stale_for_ammi64
- slots_before_stale_for_margini64
- confidence_interval_max_sizeu64
- too_volatile_ratioi64
_SignedMsgOrderParamsExportstruct
- _aSignedMsgOrderParamsMessage
- _bSignedMsgOrderParamsDelegateMessage
Events 25
AmmCurveChanged
no fields
DeleteUserRecord
no fields
DepositRecord
no fields
FundingPaymentRecord
no fields
FundingRateRecord
no fields
InsuranceFundRecord
no fields
InsuranceFundStakeRecord
no fields
LPBorrowLendDepositRecord
no fields
LPMintRedeemRecord
no fields
LPSettleRecord
no fields
LPSwapRecord
no fields
LiquidationRecord
no fields
NewUserRecord
no fields
OrderActionRecord
no fields
OrderRecord
no fields
PerpMarketFeeSweepRecord
no fields
ProtocolFeeWithdrawRecord
no fields
RevenueShareSettleRecord
no fields
SettlePnlRecord
no fields
SignedMsgOrderRecord
no fields
SpotInterestRecord
no fields
SpotMarketVaultDepositRecord
no fields
SwapRecord
no fields
TransferFeeAndPnlPoolRecord
no fields
_SignedMsgOrderParamsExport
no fields
Errors 360
- 6000InvalidSpotMarketAuthorityInvalid Spot Market Authority
- 6001InvalidInsuranceFundAuthorityClearing house not insurance fund authority
- 6002InsufficientDepositInsufficient deposit
- 6003InsufficientCollateralInsufficient collateral
- 6004SufficientCollateralSufficient collateral
- 6005MaxNumberOfPositionsMax number of positions taken
- 6006AdminControlsPricesDisabledAdmin Controls Prices Disabled
- 6007MarketDelistedMarket Delisted
- 6008MarketIndexAlreadyInitializedMarket Index Already Initialized
- 6009UserAccountAndUserPositionsAccountMismatchUser Account And User Positions Account Mismatch
- 6010UserHasNoPositionInMarketUser Has No Position In Market
- 6011InvalidInitialPegInvalid Initial Peg
- 6012InvalidRepegRedundantAMM repeg already configured with amt given
- 6013InvalidRepegDirectionAMM repeg incorrect repeg direction
- 6014InvalidRepegProfitabilityAMM repeg out of bounds pnl
- 6015SlippageOutsideLimitSlippage Outside Limit Price
- 6016OrderSizeTooSmallOrder Size Too Small
- 6017InvalidUpdateKPrice change too large when updating K
- 6018AdminWithdrawTooLargeAdmin tried to withdraw amount larger than fees collected
- 6019MathErrorMath Error
- 6020BnConversionErrorConversion to u128/u64 failed with an overflow or underflow
- 6021ClockUnavailableClock unavailable
- 6022UnableToLoadOracleUnable To Load Oracles
- 6023PriceBandsBreachedPrice Bands Breached
- 6024ExchangePausedExchange is paused
- 6025InvalidWhitelistTokenInvalid whitelist token
- 6026WhitelistTokenNotFoundWhitelist token not found
- 6027InvalidDiscountTokenInvalid discount token
- 6028DiscountTokenNotFoundDiscount token not found
- 6029ReferrerNotFoundReferrer not found
- 6030ReferrerStatsNotFoundReferrerNotFound
- 6031ReferrerMustBeWritableReferrerMustBeWritable
- 6032ReferrerStatsMustBeWritableReferrerMustBeWritable
- 6033ReferrerAndReferrerStatsAuthorityUnequalReferrerAndReferrerStatsAuthorityUnequal
- 6034InvalidReferrerInvalidReferrer
- 6035InvalidOracleInvalidOracle
- 6036OracleNotFoundOracleNotFound
- 6037LiquidationsBlockedByOracleLiquidations Blocked By Oracle
- 6038MaxDepositCan not deposit more than max deposit
- 6039CantDeleteUserWithCollateralCan not delete user that still has collateral
- 6040InvalidFundingProfitabilityAMM funding out of bounds pnl
- 6041CastingFailureCasting Failure
- 6042InvalidOrderInvalidOrder
- 6043InvalidOrderMaxTsInvalidOrderMaxTs
- 6044InvalidOrderMarketTypeInvalidOrderMarketType
- 6045InvalidOrderForInitialMarginReqInvalidOrderForInitialMarginReq
- 6046InvalidOrderNotRiskReducingInvalidOrderNotRiskReducing
- 6047InvalidOrderSizeTooSmallInvalidOrderSizeTooSmall
- 6048InvalidOrderNotStepSizeMultipleInvalidOrderNotStepSizeMultiple
- 6049InvalidOrderBaseQuoteAssetInvalidOrderBaseQuoteAsset
- 6050InvalidOrderIOCInvalidOrderIOC
- 6051InvalidOrderPostOnlyInvalidOrderPostOnly
- 6052InvalidOrderIOCPostOnlyInvalidOrderIOCPostOnly
- 6053InvalidOrderTriggerInvalidOrderTrigger
- 6054InvalidOrderAuctionInvalidOrderAuction
- 6055InvalidOrderOracleOffsetInvalidOrderOracleOffset
- 6056InvalidOrderMinOrderSizeInvalidOrderMinOrderSize
- 6057PlacePostOnlyLimitFailureFailed to Place Post-Only Limit Order
- 6058UserHasNoOrderUser has no order
- 6059OrderAmountTooSmallOrder Amount Too Small
- 6060MaxNumberOfOrdersMax number of orders taken
- 6061OrderDoesNotExistOrder does not exist
- 6062OrderNotOpenOrder not open
- 6063FillOrderDidNotUpdateStateFillOrderDidNotUpdateState
- 6064ReduceOnlyOrderIncreasedRiskReduce only order increased risk
- 6065UnableToLoadAccountLoaderUnable to load AccountLoader
- 6066TradeSizeTooLargeTrade Size Too Large
- 6067UserCantReferThemselvesUser cant refer themselves
- 6068DidNotReceiveExpectedReferrerDid not receive expected referrer
- 6069CouldNotDeserializeReferrerCould not deserialize referrer
- 6070CouldNotDeserializeReferrerStatsCould not deserialize referrer stats
- 6071UserOrderIdAlreadyInUseUser Order Id Already In Use
- 6072NoPositionsLiquidatableNo positions liquidatable
- 6073InvalidMarginRatioInvalid Margin Ratio
- 6074CantCancelPostOnlyOrderCant Cancel Post Only Order
- 6075InvalidOracleOffsetInvalidOracleOffset
- 6076CantExpireOrdersCantExpireOrders
- 6077CouldNotLoadMarketDataCouldNotLoadMarketData
- 6078PerpMarketNotFoundPerpMarketNotFound
- 6079InvalidMarketAccountInvalidMarketAccount
- 6080UnableToLoadPerpMarketAccountUnableToLoadMarketAccount
- 6081MarketWrongMutabilityMarketWrongMutability
- 6082UnableToCastUnixTimeUnableToCastUnixTime
- 6083CouldNotFindSpotPositionCouldNotFindSpotPosition
- 6084NoSpotPositionAvailableNoSpotPositionAvailable
- 6085InvalidSpotMarketInitializationInvalidSpotMarketInitialization
- 6086CouldNotLoadSpotMarketDataCouldNotLoadSpotMarketData
- 6087SpotMarketNotFoundSpotMarketNotFound
- 6088InvalidSpotMarketAccountInvalidSpotMarketAccount
- 6089UnableToLoadSpotMarketAccountUnableToLoadSpotMarketAccount
- 6090SpotMarketWrongMutabilitySpotMarketWrongMutability
- 6091SpotMarketInterestNotUpToDateSpotInterestNotUpToDate
- 6092SpotMarketInsufficientDepositsSpotMarketInsufficientDeposits
- 6093UserMustSettleTheirOwnPositiveUnsettledPNLUserMustSettleTheirOwnPositiveUnsettledPNL
- 6094CantUpdateSpotBalanceTypeCantUpdateSpotBalanceType
- 6095InsufficientCollateralForSettlingPNLInsufficientCollateralForSettlingPNL
- 6096AMMNotUpdatedInSameSlotAMMNotUpdatedInSameSlot
- 6097AuctionNotCompleteAuctionNotComplete
- 6098MakerNotFoundMakerNotFound
- 6099MakerStatsNotFoundMakerNotFound
- 6100MakerMustBeWritableMakerMustBeWritable
- 6101MakerStatsMustBeWritableMakerMustBeWritable
- 6102MakerOrderNotFoundMakerOrderNotFound
- 6103CouldNotDeserializeMakerCouldNotDeserializeMaker
- 6104CouldNotDeserializeMakerStatsCouldNotDeserializeMaker
- 6105AuctionPriceDoesNotSatisfyMakerAuctionPriceDoesNotSatisfyMaker
- 6106MakerCantFulfillOwnOrderMakerCantFulfillOwnOrder
- 6107MakerOrderMustBePostOnlyMakerOrderMustBePostOnly
- 6108CantMatchTwoPostOnlysCantMatchTwoPostOnlys
- 6109OrderBreachesOraclePriceLimitsOrderBreachesOraclePriceLimits
- 6110OrderMustBeTriggeredFirstOrderMustBeTriggeredFirst
- 6111OrderNotTriggerableOrderNotTriggerable
- 6112OrderDidNotSatisfyTriggerConditionOrderDidNotSatisfyTriggerCondition
- 6113PositionAlreadyBeingLiquidatedPositionAlreadyBeingLiquidated
- 6114PositionDoesntHaveOpenPositionOrOrdersPositionDoesntHaveOpenPositionOrOrders
- 6115AllOrdersAreAlreadyLiquidationsAllOrdersAreAlreadyLiquidations
- 6116CantCancelLiquidationOrderCantCancelLiquidationOrder
- 6117UserIsBeingLiquidatedUserIsBeingLiquidated
- 6118LiquidationsOngoingLiquidationsOngoing
- 6119WrongSpotBalanceTypeWrongSpotBalanceType
- 6120UserCantLiquidateThemselfUserCantLiquidateThemself
- 6121InvalidPerpPositionToLiquidateInvalidPerpPositionToLiquidate
- 6122InvalidBaseAssetAmountForLiquidatePerpInvalidBaseAssetAmountForLiquidatePerp
- 6123InvalidPositionLastFundingRateInvalidPositionLastFundingRate
- 6124InvalidPositionDeltaInvalidPositionDelta
- 6125UserBankruptUserBankrupt
- 6126UserNotBankruptUserNotBankrupt
- 6127UserHasInvalidBorrowUserHasInvalidBorrow
- 6128DailyWithdrawLimitDailyWithdrawLimit
- 6129DefaultErrorDefaultError
- 6130InsufficientLPTokensInsufficient LP tokens
- 6131CantLPWithPerpPositionCant LP with a market position
- 6132UnableToBurnLPTokensUnable to burn LP tokens
- 6133TryingToRemoveLiquidityTooFastTrying to remove liqudity too fast after adding it
- 6134InvalidSpotMarketVaultInvalid Spot Market Vault
- 6135InvalidSpotMarketStateInvalid Spot Market State
- 6136InvalidSerumProgramInvalidSerumProgram
- 6137InvalidSerumMarketInvalidSerumMarket
- 6138InvalidSerumBidsInvalidSerumBids
- 6139InvalidSerumAsksInvalidSerumAsks
- 6140InvalidSerumOpenOrdersInvalidSerumOpenOrders
- 6141FailedSerumCPIFailedSerumCPI
- 6142FailedToFillOnExternalMarketFailedToFillOnExternalMarket
- 6143InvalidFulfillmentConfigInvalidFulfillmentConfig
- 6144InvalidFeeStructureInvalidFeeStructure
- 6145InsufficientIFSharesInsufficient IF shares
- 6146MarketActionPausedthe Market has paused this action
- 6147MarketPlaceOrderPausedthe Market status doesnt allow placing orders
- 6148MarketFillOrderPausedthe Market status doesnt allow filling orders
- 6149MarketWithdrawPausedthe Market status doesnt allow withdraws
- 6150ProtectedAssetTierViolationAction violates the Protected Asset Tier rules
- 6151IsolatedAssetTierViolationAction violates the Isolated Asset Tier rules
- 6152UserCantBeDeletedUser Cant Be Deleted
- 6153ReduceOnlyWithdrawIncreasedRiskReduce Only Withdraw Increased Risk
- 6154MaxOpenInterestMax Open Interest
- 6155CantResolvePerpBankruptcyCant Resolve Perp Bankruptcy
- 6156LiquidationDoesntSatisfyLimitPriceLiquidation Doesnt Satisfy Limit Price
- 6157MarginTradingDisabledMargin Trading Disabled
- 6158InvalidMarketStatusToSettlePnlInvalid Market Status to Settle Perp Pnl
- 6159PerpMarketNotInSettlementPerpMarketNotInSettlement
- 6160PerpMarketNotInReduceOnlyPerpMarketNotInReduceOnly
- 6161PerpMarketSettlementBufferNotReachedPerpMarketSettlementBufferNotReached
- 6162PerpMarketSettlementUserHasOpenOrdersPerpMarketSettlementUserHasOpenOrders
- 6163PerpMarketSettlementUserHasActiveLPPerpMarketSettlementUserHasActiveLP
- 6164UnableToSettleExpiredUserPositionUnableToSettleExpiredUserPosition
- 6165UnequalMarketIndexForSpotTransferUnequalMarketIndexForSpotTransfer
- 6166InvalidPerpPositionDetectedInvalidPerpPositionDetected
- 6167InvalidSpotPositionDetectedInvalidSpotPositionDetected
- 6168InvalidAmmDetectedInvalidAmmDetected
- 6169InvalidAmmForFillDetectedInvalidAmmForFillDetected
- 6170InvalidAmmLimitPriceOverrideInvalidAmmLimitPriceOverride
- 6171InvalidOrderFillPriceInvalidOrderFillPrice
- 6172SpotMarketBalanceInvariantViolatedSpotMarketBalanceInvariantViolated
- 6173SpotMarketVaultInvariantViolatedSpotMarketVaultInvariantViolated
- 6174InvalidPDAInvalidPDA
- 6175InvalidPDASignerInvalidPDASigner
- 6176RevenueSettingsCannotSettleToIFRevenueSettingsCannotSettleToIF
- 6177NoRevenueToSettleToIFNoRevenueToSettleToIF
- 6178NoAmmPerpPnlDeficitNoAmmPerpPnlDeficit
- 6179SufficientPerpPnlPoolSufficientPerpPnlPool
- 6180InsufficientPerpPnlPoolInsufficientPerpPnlPool
- 6181PerpPnlDeficitBelowThresholdPerpPnlDeficitBelowThreshold
- 6182MaxRevenueWithdrawPerPeriodReachedMaxRevenueWithdrawPerPeriodReached
- 6183MaxIFWithdrawReachedInvalidSpotPositionDetected
- 6184NoIFWithdrawAvailableNoIFWithdrawAvailable
- 6185InvalidIFUnstakeInvalidIFUnstake
- 6186InvalidIFUnstakeSizeInvalidIFUnstakeSize
- 6187InvalidIFUnstakeCancelInvalidIFUnstakeCancel
- 6188InvalidIFForNewStakesInvalidIFForNewStakes
- 6189InvalidIFRebaseInvalidIFRebase
- 6190InvalidInsuranceUnstakeSizeInvalidInsuranceUnstakeSize
- 6191InvalidOrderLimitPriceInvalidOrderLimitPrice
- 6192InvalidIFDetectedInvalidIFDetected
- 6193InvalidAmmMaxSpreadDetectedInvalidAmmMaxSpreadDetected
- 6194InvalidConcentrationCoefInvalidConcentrationCoef
- 6195InvalidSrmVaultInvalidSrmVault
- 6196InvalidVaultOwnerInvalidVaultOwner
- 6197InvalidMarketStatusForFillsInvalidMarketStatusForFills
- 6198IFWithdrawRequestInProgressIFWithdrawRequestInProgress
- 6199NoIFWithdrawRequestInProgressNoIFWithdrawRequestInProgress
- 6200IFWithdrawRequestTooSmallIFWithdrawRequestTooSmall
- 6201IncorrectSpotMarketAccountPassedIncorrectSpotMarketAccountPassed
- 6202BlockchainClockInconsistencyBlockchainClockInconsistency
- 6203InvalidIFSharesDetectedInvalidIFSharesDetected
- 6204NewLPSizeTooSmallNewLPSizeTooSmall
- 6205MarketStatusInvalidForNewLPMarketStatusInvalidForNewLP
- 6206InvalidMarkTwapUpdateDetectedInvalidMarkTwapUpdateDetected
- 6207MarketSettlementAttemptOnActiveMarketMarketSettlementAttemptOnActiveMarket
- 6208MarketSettlementRequiresSettledLPMarketSettlementRequiresSettledLP
- 6209MarketSettlementAttemptTooEarlyMarketSettlementAttemptTooEarly
- 6210MarketSettlementTargetPriceInvalidMarketSettlementTargetPriceInvalid
- 6211UnsupportedSpotMarketUnsupportedSpotMarket
- 6212SpotOrdersDisabledSpotOrdersDisabled
- 6213MarketBeingInitializedMarket Being Initialized
- 6214InvalidUserSubAccountIdInvalid Sub Account Id
- 6215InvalidTriggerOrderConditionInvalid Trigger Order Condition
- 6216InvalidSpotPositionInvalid Spot Position
- 6217CantTransferBetweenSameUserAccountCant transfer between same user account
- 6218InvalidPerpPositionInvalid Perp Position
- 6219UnableToGetLimitPriceUnable To Get Limit Price
- 6220InvalidLiquidationInvalid Liquidation
- 6221SpotFulfillmentConfigDisabledSpot Fulfillment Config Disabled
- 6222InvalidMakerInvalid Maker
- 6223FailedUnwrapFailed Unwrap
- 6224MaxNumberOfUsersMax Number Of Users
- 6225InvalidOracleForSettlePnlInvalidOracleForSettlePnl
- 6226MarginOrdersOpenMarginOrdersOpen
- 6227TierViolationLiquidatingPerpPnlTierViolationLiquidatingPerpPnl
- 6228CouldNotLoadUserDataCouldNotLoadUserData
- 6229UserWrongMutabilityUserWrongMutability
- 6230InvalidUserAccountInvalidUserAccount
- 6231CouldNotLoadUserStatsDataCouldNotLoadUserData
- 6232UserStatsWrongMutabilityUserWrongMutability
- 6233InvalidUserStatsAccountInvalidUserAccount
- 6234UserNotFoundUserNotFound
- 6235UnableToLoadUserAccountUnableToLoadUserAccount
- 6236UserStatsNotFoundUserStatsNotFound
- 6237UnableToLoadUserStatsAccountUnableToLoadUserStatsAccount
- 6238UserNotInactiveUser Not Inactive
- 6239RevertFillRevertFill
- 6240InvalidMarketAccountforDeletionInvalid MarketAccount for Deletion
- 6241InvalidSpotFulfillmentParamsInvalid Spot Fulfillment Params
- 6242FailedToGetMintFailed to Get Mint
- 6243FailedPhoenixCPIFailedPhoenixCPI
- 6244FailedToDeserializePhoenixMarketFailedToDeserializePhoenixMarket
- 6245InvalidPricePrecisionInvalidPricePrecision
- 6246InvalidPhoenixProgramInvalidPhoenixProgram
- 6247InvalidPhoenixMarketInvalidPhoenixMarket
- 6248InvalidSwapInvalidSwap
- 6249SwapLimitPriceBreachedSwapLimitPriceBreached
- 6250SpotMarketReduceOnlySpotMarketReduceOnly
- 6251FundingWasNotUpdatedFundingWasNotUpdated
- 6252ImpossibleFillImpossibleFill
- 6253CantUpdatePerpBidAskTwapCantUpdatePerpBidAskTwap
- 6254UserReduceOnlyUserReduceOnly
- 6255InvalidMarginCalculationInvalidMarginCalculation
- 6256CantPayUserInitFeeCantPayUserInitFee
- 6257CantReclaimRentCantReclaimRent
- 6258InsuranceFundOperationPausedInsuranceFundOperationPaused
- 6259NoUnsettledPnlNoUnsettledPnl
- 6260PnlPoolCantSettleUserPnlPoolCantSettleUser
- 6261OracleNonPositiveOracleInvalid
- 6262OracleTooVolatileOracleTooVolatile
- 6263OracleTooUncertainOracleTooUncertain
- 6264OracleStaleForMarginOracleStaleForMargin
- 6265OracleInsufficientDataPointsOracleInsufficientDataPoints
- 6266OracleStaleForAMMOracleStaleForAMM
- 6267UnableToParsePullOracleMessageUnable to parse pull oracle message
- 6268MaxBorrowsCan not borow more than max borrows
- 6269OracleUpdatesNotMonotonicUpdates must be monotonically increasing
- 6270OraclePriceFeedMessageMismatchTrying to update price feed with the wrong feed id
- 6271OracleUnsupportedMessageTypeThe message in the update must be a PriceFeedMessage
- 6272OracleDeserializeMessageFailedCould not deserialize the message in the update
- 6273OracleWrongGuardianSetOwnerWrong guardian set owner in update price atomic
- 6274OracleWrongWriteAuthorityOracle post update atomic price feed account must be velocity program
- 6275OracleWrongVaaOwnerOracle vaa owner must be wormhole program
- 6276OracleTooManyPriceAccountUpdatesMulti updates must have 2 or fewer accounts passed in remaining accounts
- 6277OracleMismatchedVaaAndPriceUpdatesDon't have the same remaining accounts number and pyth updates left
- 6278OracleBadRemainingAccountPublicKeyRemaining account passed does not match oracle update derived pda
- 6279FailedOpenbookV2CPIFailedOpenbookV2CPI
- 6280InvalidOpenbookV2ProgramInvalidOpenbookV2Program
- 6281InvalidOpenbookV2MarketInvalidOpenbookV2Market
- 6282NonZeroTransferFeeNon zero transfer fee
- 6283LiquidationOrderFailedToFillLiquidation order failed to fill
- 6284DepreciatedPredictionMarketOrderDeprecated
- 6285InvalidVerificationIxIndexEd25519 Ix must be before place and make SignedMsg order ix
- 6286SigVerificationFailedSignedMsg message verificaiton failed
- 6287MismatchedSignedMsgOrderParamsMarketIndexMarket index mismatched b/w taker and maker SignedMsg order params
- 6288InvalidSignedMsgOrderParamInvalid SignedMsg order param
- 6289PlaceAndTakeOrderSuccessConditionFailedPlace and take order success condition failed
- 6290DeprecatedHighLeverageModeConfigDeprecated
- 6291InvalidRFQUserAccountInvalid RFQ User Account
- 6292RFQUserAccountWrongMutabilityRFQUserAccount should be mutable
- 6293RFQUserAccountFullRFQUserAccount has too many active RFQs
- 6294RFQOrderNotFilledRFQ order not filled as expected
- 6295InvalidRFQOrderRFQ orders must be jit makers
- 6296InvalidRFQMatchRFQ matches must be valid
- 6297InvalidSignedMsgUserAccountInvalid SignedMsg user account
- 6298SignedMsgUserAccountWrongMutabilitySignedMsg account wrong mutability
- 6299SignedMsgUserOrdersAccountFullSignedMsgUserAccount has too many active orders
- 6300SignedMsgOrderDoesNotExistOrder with SignedMsg uuid does not exist
- 6301InvalidSignedMsgOrderIdSignedMsg order id cannot be 0s
- 6302InvalidPoolIdInvalid pool id
- 6303InvalidProtectedMakerModeConfigInvalid Protected Maker Mode Config
- 6304InvalidPythLazerStorageOwnerInvalid pyth lazer storage owner
- 6305UnverifiedPythLazerMessageVerification of pyth lazer message failed
- 6306InvalidPythLazerMessageInvalid pyth lazer message
- 6307PythLazerMessagePriceFeedMismatchPyth lazer message does not correspond to correct fed id
- 6308InvalidLiquidateSpotWithSwapInvalidLiquidateSpotWithSwap
- 6309SignedMsgUserContextUserMismatchUser in SignedMsg message does not match user in ix context
- 6310Deprecated1Deprecated
- 6311Deprecated2Deprecated
- 6312InvalidTransferPerpPositionInvalid Transfer Perp Position
- 6313InvalidSignedMsgUserOrdersResizeInvalid SignedMsgUserOrders resize
- 6314DeprecatedCouldNotDeserializeHighLeverageModeConfigDeprecated
- 6315InvalidIfRebalanceConfigInvalid If Rebalance Config
- 6316InvalidIfRebalanceSwapInvalid If Rebalance Swap
- 6317InvalidRevenueShareResizeInvalid RevenueShare resize
- 6318BuilderRevokedBuilder has been revoked
- 6319InvalidBuilderFeeBuilder fee is greater than max fee bps
- 6320RevenueShareEscrowAuthorityMismatchRevenueShareEscrow authority mismatch
- 6321RevenueShareEscrowOrdersAccountFullRevenueShareEscrow has too many active orders
- 6322InvalidRevenueShareAccountInvalid RevenueShareAccount
- 6323CannotRevokeBuilderWithOpenOrdersCannot revoke builder with open orders
- 6324UnableToLoadRevenueShareAccountUnable to load builder account
- 6325InvalidConstituentInvalid Constituent
- 6326InvalidAmmConstituentMappingArgumentInvalid Amm Constituent Mapping argument
- 6327ConstituentNotFoundConstituent not found
- 6328ConstituentCouldNotLoadConstituent could not load
- 6329ConstituentWrongMutabilityConstituent wrong mutability
- 6330WrongNumberOfConstituentsWrong number of constituents passed to instruction
- 6331InsufficientConstituentTokenBalanceInsufficient constituent token balance
- 6332AMMCacheStaleAmm Cache data too stale
- 6333LpPoolAumDelayedLP Pool AUM not updated recently
- 6334ConstituentOracleStaleConstituent oracle is stale
- 6335LpInvariantFailedLP Invariant failed
- 6336InvalidConstituentDerivativeWeightsInvalid constituent derivative weights
- 6337MaxDlpAumBreachedMax DLP AUM Breached
- 6338SettleLpPoolDisabledSettle Lp Pool Disabled
- 6339MintRedeemLpPoolDisabledMint/Redeem Lp Pool Disabled
- 6340LpPoolSettleInvariantBreachedSettlement amount exceeded
- 6341InvalidConstituentOperationInvalid constituent operation
- 6342UnauthorizedUnauthorized for operation
- 6343InvalidLpPoolIdInvalid Lp Pool Id for Operation
- 6344MarketIndexNotFoundAmmCacheMarketIndexNotFoundAmmCache
- 6345InvalidIsolatedPerpMarketInvalid Isolated Perp Market
- 6346InvalidOrderScaleOrderCountInvalid scale order count - must be between 2 and 10
- 6347InvalidOrderScalePriceRangeInvalid scale order price range
- 6348InvalidPerpMarketConfigInvalid perp market config
- 6349InvalidInsuranceFundWithdrawalRecipientInsurance fund withdrawal recipient must be the designated treasury address
- 6350SpotDlobTradingDisabledSpot DLOB trading is disabled
- 6351InvalidAdminTierSigner is not authorized for this admin tier
- 6352WithdrawGuardThresholdNotionalTooLargeWithdraw guard threshold notional exceeds max
- 6353InvalidProtocolFeeRecipientRecipient must be the configured protocol fee recipient
- 6354InsufficientProtocolFeesInsufficient protocol fees available to withdraw
- 6355InvalidNativeStateAccountNative dispatch: supplied state account is not the canonical Velocity state PDA
- 6356InvalidNativePerpMarketAccountNative dispatch: supplied market account is not a Velocity perp market
- 6357IsolatedPositionDisabledIsolated positions are not enabled in this build
- 6358EquityBelowFloorAccount equity is below the user-set equity floor
- 6359InvalidEquityFloorTransferInvalid equity floor transfer between subaccounts
What's an IDL?
An IDL — Interface Description Language — is a JSON spec that describes how to talk to a program: its instructions, the accounts each one needs, argument and account types, events, and errors.
Anchor auto-generates it at build time. A program can publish it on-chain at a PDA derived from its id, so any client or explorer can decode the program's transactions without its source code.
Why it's often missing
Publishing is opt-in — a courtesy, not a requirement. Many programs never do, and non-Anchor frameworks (Pinocchio, native, Steel) don't produce one at all; their interface lives in an off-chain Shank/Codama artifact, or nowhere public. Absence means you can't auto-decode it — not that anything is wrong.
3 of 202 instructions used · 199 never called in this window
Tractioni
The recordi
| Event | When | Detail | Receipt |
|---|---|---|---|
| DEPLOY | 2d ago | slot 432,140,867 | poll…0867 |