parse_stats_24hr

Function parse_stats_24hr 

Source
pub fn parse_stats_24hr(data: &Value) -> Result<Stats24hr>
Expand description

Parse 24-hour statistics from Binance API response.

§Arguments

  • data - Binance 24-hour statistics JSON data

§Returns

Returns a Stats24hr.

§Binance API Response Format

{
  "symbol": "BTCUSDT",
  "priceChange": "1000.00",
  "priceChangePercent": "2.04",
  "weightedAvgPrice": "49500.00",
  "prevClosePrice": "49000.00",
  "lastPrice": "50000.00",
  "lastQty": "0.5",
  "bidPrice": "49999.00",
  "bidQty": "1.5",
  "askPrice": "50001.00",
  "askQty": "2.0",
  "openPrice": "49000.00",
  "highPrice": "51000.00",
  "lowPrice": "48500.00",
  "volume": "1000.5",
  "quoteVolume": "50000000.0",
  "openTime": 1609459200000,
  "closeTime": 1609545600000,
  "firstId": 100000,
  "lastId": 200000,
  "count": 100000
}