Skip to main content

Module reroute_report

Module reroute_report 

Source
Expand description

The source-agnostic reroute-report core: one row in (LegRecord), the pricing derived from a stream of them (Samples / Prices), and the two reports built over both — the venue-flow one (Report) and the benchmark (RangeReport). Adapters map their own source onto LegRecord; 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 re-quoted route did against the one L1 landed, as win/loss counts, volume-weighted bps, and the venues both sides routed through.

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 re-quoted swap. The three plans share one shape (RoutePlan); a side that was not recorded is None, never an empty plan.
Prices
Per-range prices, derived from the range’s own reroutes.
Report
What a stream said about one venue.
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
Retained until the range ends, because a median cannot be folded. Two mints and two amounts against a notification’s multi-KB route plans, which is what lets a report skip the stream.
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).