Skip to content

Markets

Because the market account is at a fixed position in the input buffer, its data begins at a compile-time-known offset from r1. The MarketHeader sits at the start of market account data and stores absolute pointers into the market's memory map:

These absolute pointers are initialized during market registration, eliminating input buffer pointer arithmetic overhead when accessing market data structures.

Registration

Market registration accepts only the discriminant byte as instruction data:

The instruction requires the following accounts:

Market registration algorithms

Main handler

Market PDA initialization

Vault initialization