pub struct DirectFillTemplate {
pub label: String,
pub mode: SwapMode,
pub input_mint: Address,
pub output_mint: Address,
pub instruction: TemplateInstruction,
pub amount_offset: u32,
pub taker: TakerSlots,
}Expand description
One instruction the caller serialized, with the slots the server rewrites per probe and the
offset it writes the amount at. Matches hops of mode originals trading inputMint →
outputMint and is priced against each such hop’s realized fill.
Every floor, fee, direction and venue payload is the caller’s: the server writes the amount, rewrites the taker, funds, simulates and reads the fill.
Fields§
§label: StringThe template’s identity on rows, events, notifications, report groups and stats keys. Unique per session, non-blank after trim.
mode: SwapModeWhich originals match, and whether the hop’s input (ExactIn) or output (ExactOut)
amount is written.
input_mint: Address§output_mint: Address§instruction: TemplateInstruction§amount_offset: u32Offset of the AMOUNT_WIDTH-byte little-endian amount in instruction.data.
taker: TakerSlotsImplementations§
Source§impl DirectFillTemplate
impl DirectFillTemplate
Sourcepub fn role_slots(&self) -> impl Iterator<Item = u8>
pub fn role_slots(&self) -> impl Iterator<Item = u8>
The account slots a probe rewrites: every user slot, then the input and output token accounts.
Sourcepub fn validate(&self) -> Result<(), ParseDirectFillTemplateError>
pub fn validate(&self) -> Result<(), ParseDirectFillTemplateError>
The rules TryFrom<DirectFillTemplateWire> enforces, for a template built in code:
[simulator_trading::template::instantiate] indexes on them without checking.