Skip to main content

Module reroute_report

Module reroute_report 

Source
Expand description

Reports over a set of reroute results, from any source.

  • Input: one LegRecord per rerouted swap. Map your source (a replacementSubscribe stream, a session database) onto it.
  • Pricing: Samples gathered from the records give USD Prices, derived from the records alone.
  • Reports: one venue’s flow, onchain against rerouted (Report); how the reroutes did against the original swaps (RangeReport); and venue probes by template (probes::ProbeReport).

Nothing here does I/O.

Re-exports§

pub use benchmark::LoadStats;
pub use benchmark::Measurement;
pub use benchmark::OUTLIER_BPS;
pub use benchmark::RangeReport;
pub use benchmark::SideTotals;
pub use benchmark::VENUE_DUST_USD;
pub use benchmark::VenueTotals;

Modules§

benchmark
The reroute benchmark: how each rerouted route did against the historical one, as win/loss counts, volume-weighted bps, and the venues both sides routed through.
probes
Per-template accounting of venue probes. Probes have their own table (direct_fill_probes) and their own wire variant (ReplacementNotification::Venue), so their records arrive pre-selected; nothing here checks that, and router rows fed in still render as a plausible-looking probe table.

Structs§

Direction
One trade direction’s before and after.
Flow
What crossed the venue in one trade direction, on one side of the comparison.
LegRecord
One rerouted swap. The three plans share one shape (RoutePlan); a side that was not recorded is None, never an empty plan.
Prices
USD prices for one range, derived from the range’s own reroutes.
Report
One venue’s flow across a set of reroute results, onchain against rerouted, by trade direction.
ReportBuilder
Accumulates a Report one record at a time, holding pricing samples, one accumulator per trade direction, and the venue labels seen — never the records.
Samples
Pricing samples gathered from LegRecords; turn them into Prices with Samples::prices.
Target
The venue under test, as the two sides can each name it.

Enums§

RerouteReportError
The selector named a venue the stream never carried — a wrong address or a misspelling. Reporting that as $0 would be indistinguishable from a venue with no flow.
SwapMode
Whether the swap fixes the input amount (ExactIn) or the output amount (ExactOut).

Type Aliases§

Pair
A trade direction, keyed by the mints it moves between as (input, output).