Function agnostic_orderbook::instruction::create_market [−][src]
pub fn create_market(
agnostic_orderbook_program_id: Pubkey,
market_account: Pubkey,
event_queue: Pubkey,
bids: Pubkey,
asks: Pubkey,
create_market_params: Params
) -> Instruction
Expand description
Create and initialize a new orderbook market
The event_queue, bids, and asks accounts should be freshly allocated or zeroed out accounts.
-
The market account will only contain a
MarketState
object and should be sized appropriately. -
The event queue will contain an
EventQueueHeader
object followed by a return register sized for aOrderSummary
(size ofORDER_SUMMARY_SIZE
) and then a series of eventsEvent
. The serialized size of anEvent
object is given bycompute_slot_size
The size of the queue should be determined accordingly. -
The asks and bids accounts will contain a header of size [
SLAB_HEADER_LEN
][crate::critbit::SLAB_HEADER_LEN
] followed by a series of slots of size [compute_slot_size(callback_info_len)
][crate::critbit::Slab::compute_slot_size
].