davdiding / cex-adaptors

2 stars 0 forks source link

[Public] Sync `ticker` format #74

Closed davidting0918 closed 5 months ago

davidting0918 commented 5 months ago

Issue purpose:

Sync okx, binance, bybit, kucoin, bitget, htx, gateioticker output format

Sync function

  1. get_tickers

    • inputs format :
      {
      "market": "spot"  // must be in "spot", "perp", "futures". If `null` will return all tickers on the exchange
      }
    • output format :
      {
      "BTC/USDT:USDT" : {
      "timestamp": 1630000000000,
      "instrument_id": "BTC/USDT:USDT",
      "open_time": 1630000000000,
      "close_time": 1630000000000,
      "open": 10000.0,
      "high": 11000.0,
      "low": 9000.0,
      "last": 10000.0,
      "base_volume": 1000.0,
      "quote_volume": 10000000.0,
      "price_change": 0.0,  // must in quote currency
      "price_change_percent": 0.01, // must in percentage, if 0.01 means 1%,
      "raw_data": {},
      },
      // many instrument ticker
      }
  2. get_ticker

    • inputs format :
      {
      "instrument_id": "BTC/USDT:USDT"  // must be instrument_id in exchange's exchange info
      }
    • output format :
      {
      "BTC/USDT:USDT" : {
      "timestamp": 1630000000000,
      "instrument_id": "BTC/USDT:USDT",
      "open_time": 1630000000000,
      "close_time": 1630000000000,
      "open": 10000.0,
      "high": 11000.0,
      "low": 9000.0,
      "last": 10000.0,
      "base_volume": 1000.0,
      "quote_volume": 10000000.0,
      "price_change": 0.0,  // must in quote currency
      "price_change_percent": 0.01, // must in percentage, if 0.01 means 1%,
      "raw_data": {},
      }
      }