Function dflow_sdk::client::instructions::fill_order
source · [−]pub fn fill_order(
program: &Program,
retail_account_owner: Pubkey,
nonce: u64,
vault_meta_account_fill_nonce: u16,
vault_meta_account_auction_id: u64,
vault_meta_account_auction_epoch: u64,
market_maker_account_owner: Pubkey,
y_mint: Pubkey,
order_details: String,
fill_amount: u64,
fill_price: u64,
retail_data_account: Pubkey,
market_maker_data_account: Pubkey,
x_mint: Pubkey,
market_maker_y_token_account: Pubkey,
retail_y_token_account: Pubkey,
is_y_token_account_uninitialized: bool
) -> Instruction
Expand description
This instruction is used to fill an open order
When a market maker fills an order that is assigned to them, this instruction will partially settle the trade; the retail trader will receive the tokens from the market maker, but the market maker must wait until arbiters have voted on the fairness of the fill in order to receive the retail trader’s tokens.
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 meta account, taken from the retail trader’s account when the order in question was initially created.vault_meta_account_fill_nonce
The unsigned integer field named fill_nonce in the vault_meta_account account. 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.market_maker_account_owner
The public key of the market_maker_account_owner account.y_mint
The public key of the y_mint account.order_details
The unencrypted order details sent by the retail trader.fill_amount
The fill amount, referring to the amount of tokens to be received by the retail trader in the trade.fill_price
The price, quoted in the quote currency for the given pair, at which the fill is being completed.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 mutablex_mint
The SPL mint account associated with the token that is sold by the retail trader during the swap.market_maker_y_token_account
The SPL token account associated with the market maker, and which sends the asset being received by the retail trader during a trade. This account is expected to be mutableretail_y_token_account
The SPL token account associated with the retail trader, and which receives the asset being sent by the market maker during a trade. This account is expected to be mutable. This account is the retail_y_token_account’s associated token account for the mint of the asset sent by the market makeris_y_token_account_uninitialized
True if and only if the retail trader’s Y token account is uninitialized
Returns an instruction