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 a OrderSummary (size of ORDER_SUMMARY_SIZE) and then a series of events Event. The serialized size of an Event object is given by compute_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].