Skip to main content

RerouteParams

Struct RerouteParams 

Source
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>,
}
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: bool

Also 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: bool

Also 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: bool

Re-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.

Implementations§

Source§

impl RerouteParams

Source

pub const fn is_noop(&self) -> bool

Whether this block asks for anything at all — a run with neither re-quoting nor a direct fill template has a reroute section that does nothing.

Trait Implementations§

Source§

impl Clone for RerouteParams

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RerouteParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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.

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RerouteParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for RerouteParams

Source§

impl PartialEq for RerouteParams

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RerouteParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RerouteParams

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V