Function dflow_sdk::client::instructions::cancel_order
source · [−]pub fn cancel_order(
program: &Program,
retail_account_owner: Pubkey,
nonce: u64,
vault_meta_account_auction_id: u64,
vault_meta_account_auction_epoch: u64,
retail_data_account: Pubkey,
market_maker_data_account: Pubkey,
retail_x_token_account: Pubkey,
x_mint: Pubkey
) -> Instruction
Expand description
This instruction cancels an open order.
Cancelling an open order can only be done if it has not been filled and if the order has been filled partially, the retail trader can only cancel the part of the order which is still open.
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.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.retail_data_account
The retail data account holds state specific to the retail trader. This account is expected to be mutablemarket_maker_data_account
The account storing state specific to the market maker. This account must be owned by the DFlow program, and this account must be initialized by calling the initialize market maker instruction. This account is expected to be mutableretail_x_token_account
The SPL token account associated with the retail trader which is used to deposit the sold token into escrow prior to the trade occurring. This account is expected to be mutablex_mint
The SPL mint account associated with the token that is sold by the retail trader during the swap.
Returns an instruction