Skip to main content

Module route_plan

Module route_plan 

Source
Expand description

One route, hop by hop: what the router quotes, what a decoded transaction reports, and what both are recorded and streamed as. Only the router names a pool; only a transaction’s route events name the program that ran a hop.

Addresses and amounts stay as strings — nothing here does address arithmetic, and a raw token amount exceeds what a JSON number holds exactly.

Every field is concrete and always written. A plan is recorded through bincode, whose decoder reads fields positionally: #[serde(flatten)] and serde_json::Value cannot cross it, and skip_serializing_if desynchronizes it. An unset value therefore travels as an explicit null, which costs a JSON reader nothing — json_extract answers null for a missing key either way.

Structs§

RouteHop
RouteHopSwapInfo
RoutePlan
A whole route in the order its hops run. Deserialization bypasses RoutePlan::new, so a plan read off the wire can still be empty.

Constants§

FULL_PERCENT
The whole trade through one hop; anything less is a split.

Functions§

is_split
The trade was split across pools rather than routed as one path, so the hops are branches and cannot line up positionally against a sequential original.
labels
pool_keys
A route’s identity for deduplication: two routes over the same pools fill the same way whatever order the router lists them in. Skips hops the router gave no pool for.