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
MarketStateobject and should be sized appropriately. - 
The event queue will contain an
EventQueueHeaderobject followed by a return register sized for aOrderSummary(size ofORDER_SUMMARY_SIZE) and then a series of eventsEvent. The serialized size of anEventobject is given bycompute_slot_sizeThe 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].