pub struct L1Score {
pub l1_fill: Option<u64>,
pub change_vs_l1_bps: Option<i64>,
}Expand description
What the original filled on L1, and how the shape carrying this scored against it.
One derivation for all three kinds — Self::new — but the scope differs, so each kind
documents its own: a probe’s is the probed HOP’s L1 output, a replayed original’s is net route
flow across the whole SWAP’s pair, a re-quote’s is what the original realized across the
transaction. Read within a kind; never sum or average across them.
Fields§
§l1_fill: Option<u64>§change_vs_l1_bps: Option<i64>filled against Self::l1_fill in bps, clamped, so positive means it beat what actually
traded.
Implementations§
Source§impl L1Score
impl L1Score
Sourcepub fn new(measured: Option<u64>, l1_fill: u64, mode: SwapMode) -> Self
pub fn new(measured: Option<u64>, l1_fill: u64, mode: SwapMode) -> Self
Score measured against what the original moved on L1 on the same side. ExactIn measures
output, so more is better; ExactOut measures the input charged, so the sign is flipped and
positive always means the stand-in beat what traded. An L1 fill of zero is no baseline:
dividing by it would clamp to a number rather than say nothing.
A measured zero is left unscored for the same reason. Some venues decline by returning
zero rather than by reverting, which is a refusal to quote and not a quote of nothing;
scored, it lands at CHANGE_CLAMP_BPS and a handful of declines sink a venue’s mean far
below what it actually paid.