Skip to main content

Module reroute_report

Module reroute_report 

Source
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 is None, never an empty plan.
ProbeReport
Venue-probe results by template.
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.
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).

Functions§

from_notifications
Build the venue-flow report from anything that yields replacement notifications — a slice, a Vec, a lazily-parsed file. Venue and Original variants are skipped.
from_stream
Build the venue-flow report from a live stream, holding no more than ReportBuilder does. Venue and Original variants 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 ProbeReport only, 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. Requote and Original variants 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. Requote and Original variants 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).