pub struct ProbeReport {
pub by_template: BTreeMap<String, TemplateProbes>,
}Expand description
Venue-probe results by template.
Fields§
§by_template: BTreeMap<String, TemplateProbes>By template label; (unnamed) collects probes without one.
Implementations§
Source§impl ProbeReport
impl ProbeReport
Sourcepub fn from_records(records: &[LegRecord], prices: Option<&Prices>) -> Self
pub fn from_records(records: &[LegRecord], prices: Option<&Prices>) -> Self
Tally venue-probe records by template. prices values the per-dollar column; with None
it stays empty.
pub fn is_empty(&self) -> bool
Sourcepub fn render(&self, name: &str) -> String
pub fn render(&self, name: &str) -> String
A Markdown section headed name: one table row per template, then each template’s
outcome counts.
The columns, per template. Every bps figure is positive when the template beat the baseline: more output for ExactIn, less input charged for ExactOut.
probes: every probe, whatever its outcome.filled: probes that filled, and their share ofprobes.per hop (bps): the mean of each probe’s change against the hop’s onchain fill (LegRecord::output_bps, clamped to ±CHANGE_CLAMP_BPS), every hop counting once. In parentheses, how many probes were scored.per dollar (bps): the same changes, each weighted by the hop’s USD notional, so large hops count for more. In parentheses, the total notional.—without prices.vs same-state (bps): the mean change against the original swap’s hop replayed on the same state as the probe (LegRecord::quoted_output_amount), unclamped. Unlikeper hop, it excludes the state drift between the probe’s simulation point and the hop’s block, so it reads as the template’s own edge. In parentheses, how many probes had both fills.
A column with nothing to average shows —.
Trait Implementations§
Source§impl Clone for ProbeReport
impl Clone for ProbeReport
Source§impl Default for ProbeReport
impl Default for ProbeReport
Auto Trait Implementations§
impl Forget for ProbeReport
impl Freeze for ProbeReportwhere
*const LeafNode<String, TemplateProbes> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, TemplateProbes)>>: Freeze,
impl Move for ProbeReport
impl RefUnwindSafe for ProbeReport
impl Send for ProbeReportwhere
NodeRef<Owned, String, TemplateProbes, LeafOrInternal>: Send,
BoxRaw<(String, TemplateProbes)>: Send,
impl Sync for ProbeReportwhere
NodeRef<Owned, String, TemplateProbes, LeafOrInternal>: Sync,
BoxRaw<(String, TemplateProbes)>: Sync,
impl Unpin for ProbeReportwhere
*const LeafNode<String, TemplateProbes> is !null: Unpin,
Box<(String, TemplateProbes)>: Unpin,
impl UnsafeUnpin for ProbeReportwhere
*const LeafNode<String, TemplateProbes> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, TemplateProbes)>>: UnsafeUnpin,
impl UnwindSafe for ProbeReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more