pub struct MarketSummary {Show 17 fields
pub pair: String,
pub peg_target: f64,
pub best_bid: Option<f64>,
pub best_ask: Option<f64>,
pub mid_price: Option<f64>,
pub spread: Option<f64>,
pub volume_24h: Option<f64>,
pub execution_10k_buy: Option<ExecutionEstimate>,
pub execution_10k_sell: Option<ExecutionEstimate>,
pub asks: Vec<OrderBookLevel>,
pub bids: Vec<OrderBookLevel>,
pub ask_outliers: usize,
pub bid_outliers: usize,
pub ask_depth: f64,
pub bid_depth: f64,
pub checks: Vec<HealthCheck>,
pub healthy: bool,
}Expand description
Aggregated market summary with order book snapshot and health results.
Fields§
§pair: StringPair label (e.g., “PUSD/USDT”).
peg_target: f64Peg target.
best_bid: Option<f64>Best bid (raw, no outlier filtering).
best_ask: Option<f64>Best ask.
mid_price: Option<f64>Mid price.
spread: Option<f64>Spread.
volume_24h: Option<f64>24h volume in quote (e.g. USDT) if available.
execution_10k_buy: Option<ExecutionEstimate>Execution estimate for 10k USDT buy (slippage).
execution_10k_sell: Option<ExecutionEstimate>Execution estimate for 10k USDT sell (slippage).
asks: Vec<OrderBookLevel>Asks within peg range (for display).
bids: Vec<OrderBookLevel>Bids within peg range.
ask_outliers: usizeCount of ask levels excluded as outliers.
bid_outliers: usizeCount of bid levels excluded as outliers.
ask_depth: f64Ask depth (quote) within range.
bid_depth: f64Bid depth (quote) within range.
checks: Vec<HealthCheck>Health check results.
healthy: boolOverall healthy (no failures).
Implementations§
Source§impl MarketSummary
impl MarketSummary
Sourcepub fn from_order_book(
book: &OrderBook,
peg_target: f64,
thresholds: &HealthThresholds,
volume_24h: Option<f64>,
) -> Self
pub fn from_order_book( book: &OrderBook, peg_target: f64, thresholds: &HealthThresholds, volume_24h: Option<f64>, ) -> Self
Build summary from order book with given peg and thresholds. Optionally includes 24h volume (from venue ticker) and execution estimates for 10k USDT.
Sourcepub fn format_text(&self, venue_or_chain: Option<&str>) -> String
pub fn format_text(&self, venue_or_chain: Option<&str>) -> String
Format as human-readable text report.
When venue_or_chain is provided, it is displayed in the header (e.g. binance, ethereum).
Trait Implementations§
Source§impl Clone for MarketSummary
impl Clone for MarketSummary
Source§fn clone(&self) -> MarketSummary
fn clone(&self) -> MarketSummary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MarketSummary
impl RefUnwindSafe for MarketSummary
impl Send for MarketSummary
impl Sync for MarketSummary
impl Unpin for MarketSummary
impl UnwindSafe for MarketSummary
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more