pub struct RerouteParams {
pub aggregators: RerouteAggregators,
pub filter: Option<RerouteFilter>,
pub detect_failed_l1_swaps: bool,
pub circular_arbs: bool,
pub requote: bool,
pub direct_fill: Vec<DirectFillTemplate>,
pub extra_markets: BTreeSet<Address>,
}Expand description
Re-quoting historical swaps through the metis router: each admitted swap is re-quoted and the routed transaction is simulated just before the original executes — never committed, so the replay is unaffected. Each simulation reads the state of the batch its original belonged to; reroutes never observe one another.
Presence is the switch, which makes “a knob but no rerouting” unrepresentable rather than a validation error.
Fields§
§aggregators: RerouteAggregators§filter: Option<RerouteFilter>Restrict re-quoting to the mint pairs of interest — a maker’s own book. Absent: every detected swap on an admitted aggregator is re-quoted.
detect_failed_l1_swaps: boolAlso re-quote swaps whose L1 transaction failed, when the allowlist admits the failure as one re-quoting can answer (a slippage rejection, or a failure after the swap already ran).
Off by default: L1 realised nothing for these, so every comparison against the original is
undefined and they are tracked as their own population — swaps_detected and
swaps_rerouted exclude them, and every row carries original_failed.
circular_arbs: boolAlso re-quote arbitrage cycles — swaps whose input and output mint are the same. Off by default: the router prices a cycle and then refuses to build the route it found.
requote: boolRe-quote detected swaps through the metis router.
On by default, and the only reason a session starts a sidecar. Turn it off to run
Self::direct_fill alone: pricing a venue metis cannot route needs no router, and
waiting on one would be waiting for something that can never answer.
direct_fill: Vec<DirectFillTemplate>Instruction templates to probe against the hops this run detects, alongside the re-quoting: each hop whose direction and mode a template names is instantiated through it, funded, simulated and scored against what the hop filled on L1. Empty: no direct fill.
Only the census is template-driven. Self::aggregators still decides which originals
reach it, so a template-only run must widen the allowlist to every router whose hops it
wants priced.
extra_markets: BTreeSet<Address>Pools for the router to consider on top of the markets it already knows. Each must hold
an account at the start of the range: a pool that exists nowhere on chain gets its
accounts from an account override anchored at the first slot. Requires Self::requote.
Implementations§
Trait Implementations§
Source§impl Clone for RerouteParams
impl Clone for RerouteParams
Source§impl Debug for RerouteParams
impl Debug for RerouteParams
Source§impl Default for RerouteParams
Hand-written rather than derived: requote defaults to ON, and a derived Default would
give the opposite of what deserializing an empty object gives.
impl Default for RerouteParams
Hand-written rather than derived: requote defaults to ON, and a derived Default would
give the opposite of what deserializing an empty object gives.