arrow-left

All pages
gitbookPowered by GitBook
1 of 3

Loading...

Loading...

Loading...

Level 2 Tick-Level

Bids and asks

hashtag
What is this dataset?

All bids and asks on an exchange's order book. Use Kaiko Stream for real-time tick-level updates, or CSV for backdated information.

hashtag
File structure details

  • File Name: [kaiko_legacy_slug]_[instrument_symbol]_[date].csv.gz

    • Files are generated on a daily basis.

    • example: bf_btcusdt_2022-09-01.csv

  • Cut-off time:

circle-info

The exchanges do not provide a timestamp:

  1. Bitfinex (bfnx)

  2. Bitflyer (bfly

Column
Description
Example

hashtag
How to create a local order book with CSV files

  1. Download the CSV files, which usually start with updates (type: u).

  2. Ignore the updates before the 1st snapshot (type: s) that appears in the CSV file.

circle-exclamation

Please dump the locally managed order book if you encounter a snapshot between updates while maintaining the orderbook, and start fresh with the new snapshot.

00:00:00 UTC
  • We use the timestamp when exchanges send the order book data points through websocket in order to cut-off the data points between days, if the timestamps are provided by the exchanges.

  • When the timestamps are not provided by the exchanges, we use the data collection timestamp when the data points arrive at Kaiko's collection system (see below for these exchanges).

  • Column Delimeter: ; (semi-colon)

  • Decimal Mark (in numbers): . (dot)

  • )
  • CEX.io (cexi)

  • List of [ask price, volume]

    [[20103,0],[20207,0],[20057,1.00111351]]

    bids

    List of [bid price, volume]

    [[19584,0],[19904,21.9973]]

    If the prices in the updates exist in the locally managed order book, update the amount. The amount 0 means to remove the price level from the order book, because it is cancelled or filled.
  • If the prices in the updates do not exist in the locally managed order book, insert that price level in the order book.

  • Receiving an update that removes a price level that is not in your local order book is a normal exchange's behavior that can happen. In this case, you can just ignore the updates.

  • timestamp

    Timestamp when the exchanges send the data or we collect the data, depending on exchanges. In the epoch format.

    1661990400274591751

    type

    Type of the message. s: snapshot. u: update.

    s

    asks

    Mints and burns

    hashtag
    What is this dataset?

    This data includes event data related to the addition (mint) and removal (burn) of tokens from a liquidity pool.

    hashtag
    File structure details

    • File Name: [kaiko_exchange_code]_[pool_address]_[date].csv

      • Files are created on a daily basis.

      • example: usp2_0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc_2023-02-12.csv

    Field
    Description
    Example
    Cut-off time:
    00:00:00 UTC
    • We use the timestamp of the block in order to cut-off the data points between days.

  • Column Delimeter: , (comma)

  • Decimal Mark (in numbers): . (dot)

  • The date equivalent.

    2023-02-12T00:00:11Z

    pool_name

    Name of the pool as it is written on the blockchain.

    USDC-WETH

    type

    Event type. By default both burn and mint are shown.

    burn or mint

    transaction_hash

    Filter on a specific transaction hash.

    0xe68b84740**

    price

    The price at this block.

    0.0006495312950691

    symbols

    The symbols of the tokens in the pool, separated by a semi-colon.

    USDC;WETH

    addresses

    The addresses of the tokens in the pool, separated by a semi-colon.

    0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48;0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

    amounts

    The amounts of each token, separated by a semi-colon.

    4.3800141550673e+07;28449.56266562047

    block_number

    The height of the block.

    16028979

    timestamp

    The timestamp of the block.

    1669161611000

    datetime