Structs§
- Market
Header - Market account header (v1.0 layout) — stored at the beginning of the account data. The RiskEngine state follows immediately after, accessed via raw pointer because RiskEngine is ~1.165 MB and doesn’t derive Copy.
Constants§
- MARKET_
ACCOUNT_ SIZE - Total account size (v1 layout): discriminator + header + engine
- MARKET_
ACCOUNT_ SIZE_ V0 - Total account size for the legacy v0.9 layout. Used by
migrate_header_v1to validate that the account being migrated is a pre-v1 market. - MARKET_
DISCRIMINATOR_ V1 - 8-byte discriminator for v1 market accounts: 7 fixed bytes (
b"percmrk") followed by a 1-byte layout version (0x01).
Functions§
- engine_
from_ account_ data - Helper to get a mutable reference to the RiskEngine from raw account data.
- engine_
from_ account_ data_ ref - header_
from_ account_ data - is_
v1_ market - Returns
trueiffdatastarts with the v1 discriminator. - market_
signer_ seeds - Market PDA signer seeds: [b“market“, authority_key, &[bump]]
- write_
header