pub struct BeginSettle<'a> {
pub program_id: Pubkey,
pub state_pda: Pubkey,
pub finalize_ix_index: u16,
pub auction_id: i64,
pub order_pdas: &'a [Pubkey],
pub sell_token_accounts: &'a [Pubkey],
pub pulls: &'a [&'a [Pull]],
}Expand description
Builder for a BeginSettle instruction settling the orders described by the
parallel lists:
order_pdas[i]is the canonical order PDA (seecrate::pda::order)sell_token_accounts[i]is the order’s sell token account,pulls[i]the list ofPulls to perform from that order’s sell token account, each sending an amount from thei-th order sell token account to a destination.
The slices are assumed to have the same length but this is not enforced in the builder.
Wire format (grouped, with n orders and T total transfers):
[discriminator=0][finalize_ix_index: u16 LE][auction_id: i64 LE][n: u8] [transfer_count×n][amount: u64 LE ×T].
Required accounts: [instructions_sysvar (R), state_pda (R), token_program (R)] followed, per order, by [order_pda (W), sell_token_account (W), destination (W)...].
The program requires the order PDAs to be strictly increasing by address. This builder establishes that ordering for the caller: it sorts the orders by PDA address, carrying each order’s sell token account, transfer count, amounts, and destination metas before emitting them.
Fields§
§program_id: Pubkey§state_pda: Pubkey§finalize_ix_index: u16§auction_id: i64The off-chain auction this settlement executes. Carried in the instruction data so the settlement can be tied back to its auction off-chain, unused on-chain.
order_pdas: &'a [Pubkey]§sell_token_accounts: &'a [Pubkey]§pulls: &'a [&'a [Pull]]