Expand description
The reroute-report core fed from replacementSubscribe notifications. The computation —
records, pricing, the reports themselves — lives in simulator_api::reroute_report; this
module only maps the wire shape onto it.
ReplacementNotification carries three shapes down one stream: Requote feeds the venue-flow
Report, Venue the per-template ProbeReport, and Original feeds neither. Each
routing function reads only its own variant and silently skips the others.
let target = Target::new(Some("BisonFi".to_string()), None);
let report = reroute_report::from_notifications(target, notifications)?;
println!("{}", report.render(None));
let probes = reroute_report::probes_from_notifications(notifications);
println!("{}", probes.render("R1"));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 isNone, never an empty plan. - Probe
Report - Venue-probe results by template.
- Report
- One venue’s flow across a set of reroute results, onchain against rerouted, by trade direction.
- Report
Builder - Accumulates a
Reportone record at a time, holding pricing samples, one accumulator per trade direction, and the venue labels seen — never the records. - Target
- The venue under test, as the two sides can each name it.
Enums§
- Reroute
Report Error - The selector named a venue the stream never carried — a wrong address or a misspelling.
Reporting that as
$0would be indistinguishable from a venue with no flow. - Swap
Mode - Whether the swap fixes the input amount (
ExactIn) or the output amount (ExactOut).
Functions§
- from_
notifications - Build the venue-flow report from anything that yields replacement notifications — a slice, a
Vec, a lazily-parsed file.VenueandOriginalvariants are skipped. - from_
stream - Build the venue-flow report from a live stream, holding no more than
ReportBuilderdoes.VenueandOriginalvariants are skipped. - leg_
records - One record per leg of a requote. Notification-level facts (error, signature, the original’s realized output) repeat onto each; the original’s output attaches only when the notification has a single leg, since a multi-swap total is nobody’s single leg.
- probe_
record - One record for a venue probe: one hop, re-priced against a venue template. Feeds
ProbeReportonly, so the flow-report fields are left at inert defaults. - probes_
from_ notifications - Build the per-template probe report from anything that yields replacement notifications.
RequoteandOriginalvariants are skipped. - probes_
from_ stream - Build the per-template probe report from a live stream, holding no more than one merge’s worth
of state at a time.
RequoteandOriginalvariants are skipped. - short_
mint - The token’s symbol, or a shortened address
Type Aliases§
- Pair
- A trade direction, keyed by the mints it moves between as
(input, output).