pub fn close_fill_accounts(
    program: &Program,
    retail_account_owner: Pubkey,
    nonce: u64,
    fill_nonce: u16,
    vault_meta_account_auction_id: u64,
    vault_meta_account_auction_epoch: u64,
    arbiter: Pubkey,
    auction_state_account_bid_mint: Pubkey,
    vault_token_account_mint: Pubkey,
    market_maker_x_token_account: Pubkey,
    retail_data_account: Pubkey,
    market_maker_account_owner: Pubkey,
    rebate_receiver_token_account: Pubkey,
    is_rebate_receiver_token_account_uninitialized: bool,
    is_x_token_account_uninitialized: bool
) -> Instruction
Expand description

This instruction is used to close the various accounts opened during the lifecycle of the trade, and additionally give a rebate to the order flow source for its order flow.

Lamports used to open the accounts will be returned to the payers who opened the accounts.

Arguments

  • retail_account_owner The public key of the retail_account_owner account.
  • nonce An unsigned 64 bit integer. The nonce used as a seed to generate the PDA for the vault token account, taken from the retail trader’s account when the order in question was initially created.
  • fill_nonce An unsigned 16 bit integer. The fill nonce taken from the vault meta account at fill time, and used to generate the PDA for the fill record account.
  • vault_meta_account_auction_id The unsigned integer field named auction_id in the vault_meta_account account.
  • vault_meta_account_auction_epoch The unsigned integer field named auction_epoch in the vault_meta_account account.
  • arbiter The public key of the arbiter account.
  • auction_state_account_bid_mint The public key field named bid_mint in the auction_state_account account.
  • vault_token_account_mint The public key field named mint in the vault_token_account account.
  • market_maker_x_token_account The SPL token account associated with the market maker, and which receives the asset sold by the retail trader during a trade. This account is expected to be mutable. This account is the market_maker_account_owner’s associated token account for the mint of the asset sent by the retail trader
  • retail_data_account The retail data account holds state specific to the retail trader. This account is expected to be mutable. The key of retail_account_owner must match the field named retail_account_owner in this account
  • market_maker_account_owner The public key of the market maker. This account is expected to be mutable
  • rebate_receiver_token_account The SPL token account associated with the order used to receive a payment from the network, with the same mint as the token accounts used by market makers to bid in the associated auction. This account is expected to be mutable
  • is_rebate_receiver_token_account_uninitialized True if and only if the rebate receiver token account is uninitialized
  • is_x_token_account_uninitialized True if and only if the market maker’s X token account is uninitialized

Returns an instruction