pub struct VenueTemplate {
pub label: String,
pub mode: SwapMode,
pub input_mint: Address,
pub output_mint: Address,
pub instruction: TemplateInstruction,
pub amount_offset: u32,
pub taker: TakerSlots,
pub resolve: Option<TemplateResolver>,
pub frame: Option<TemplateFrame>,
}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: AddressThe mint the matched hops sell; base58 inputMint on the wire.
output_mint: AddressThe mint the matched hops buy; base58 outputMint on the wire.
instruction: TemplateInstructionThe instruction each probe runs.
amount_offset: u32Offset of the AMOUNT_WIDTH-byte little-endian amount in instruction.data.
taker: TakerSlotsThe account slots rewritten to each probe’s taker.
resolve: Option<TemplateResolver>How the instruction is brought up to date with the state each probe pass runs at.
frame: Option<TemplateFrame>The transaction each probe fires in place of instruction, which then names only the venue
program.
Implementations§
Source§impl VenueTemplate
impl VenueTemplate
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<(), ParseVenueTemplateError>
pub fn validate(&self) -> Result<(), ParseVenueTemplateError>
Checks the rules deserialization enforces. Call it on a template built in code before sending it.
§Errors
The first rule the template breaks, as a ParseVenueTemplateError.