Skip to main content

Module fetch

Module fetch 

Source
Expand description

The market summary use case: venue + pair -> order book, 24h volume and MarketSummary. scope market summary, token-health --with-market, insights and the web endpoints all call it, so the same input gives the same request everywhere.

Traits§

DexAnalyticsSource
Port: token analytics with DEX pools, for a DEX venue’s synthetic book. Adapters resolve the token (symbol, address or alias) on the chain.

Functions§

fetch_book_and_volume
Fetches the book and 24h quote volume for pair on venue.
fetch_pattern_trades
The venue’s recent trades for the bot-pattern advisory (super::patterns::TRADE_SAMPLE of them). Err says why there are none: the summary shows it, and it never fails the summary.
fetch_summary
Fetches the book and volume, then judges it against thresholds, with the bot-pattern advisory from the venue’s recent trades.
fetch_summary_with_trades
fetch_summary, with the venue’s recent trades it read (or why there are none), so a caller can read them too without a second fetch.
fetch_token_summary
The market summary for a token the caller has already analyzed. The pair is the token symbol with the venue’s default quote: a token symbol is never split (WETH is not W/ETH). A DEX venue reads these analytics, so they must be on its chain.
fetch_token_summary_by_nameDeprecated
fetch_token_summary for a venue name: resolves it with MarketVenue::from_name (the one unknown-venue error), then fetches.
fetch_token_summary_by_name_with_http
fetch_token_summary_by_name, sending a CEX venue’s requests through http.
most_liquid
The pool with the most USD liquidity: the deepest book, not the first.