NAV
curl python

Introduction

Kaiko provides live and historical institutional quality market data for digital assets. Our service retrieves and validates millions of trades, derivative data and order books each day from the world's leading cryptocurrency exchanges to deliver robust and reliable market data to financial institutions globally. To learn more the product suites of Kaiko, please visit Kaiko's Data Dictionary. It shows schemas, methodologies, data samples, and additional information about all product suites that we provide and the delivery channels they are accessible through.

This is the documentation for the v2 of our REST API and CSV files.

Kaiko currently provides two HTTP APIs:

In addition, Kaiko also offers a Stream product for real-time, low latency data:

Change Log

2023-12-12

Mapping update: Changes implemented for the following Instruments due to Ronin And Romanian Fiat Currencies having an identical ticker.

2023-12-11

2023-12-04

2023-11-23

2023-11-16

2023-11-13

Mapping update: Changes implemented for the following Instruments due to Merit Circle Migration from MC to BEAN Ticker.

2023-11-10

Mapping updates:

2023-10-26 - Data Quality Update. We identified and resolved an issue that caused duplication in our MEXC trades data. As of 2023-10-26, all new MEXC trades data will be free from such duplication. Please note that due to MEXC's unique data structure, we are unable to retroactively correct the impacted historical data. We recommend users to consider this when using any MEXC trade data prior to 2023-10-26.

2023-10-26

2023-09-22

2023-09-18

Reference Data behavior Update - The "trade_end_timestamp" field will only be populated after 7 consecutive days of inactivity. Previously, this field would be populated after 1 day of inactivity.

2023-07-26

Mapping update: Change implemented to the code used for DMarket. Code changed to accomodate the actively trading Dream Machine Token.

2023-06-08

Mapping update: Changes implemented for BitMEX Perpetual Futures contracts. Instrument codes are no longer using "base_asset" - "quote_asset" convention for API codes. To differentiate between different Perpetual Future contract types, these should now be queried using the codes assigned by BitMEX

E.g. BTC-USD → XBTUSD

2023-06-06

2023-05-31

2023-05-17

Mapping update: Changes implemented for the following Instruments

2023-05-03

2023-04-24

2023-04-11

Mapping update: Changes implemented for the following Instruments

2023-04-06

Mapping update: Changes implemented for the following Instruments

2023-04-05

2023-04-04

2023-03-30

2023-03-29

Mapping update: Changes implemented for the following Assets

2023-03-27

Mapping update: Changes implemented for the following Assets

2023-03-23

Mapping update: Changes implemented for the following Assets

2023-02-21

Mapping update: Changes implemented for the following Assets

2023-02-06

2023-02-02

2023-01-26

2023-01-16

2023-01-12

2022-06-03

Mapping update: Changes implemented for the following Assets

2022-05-18

Mapping Update: FTXUSD deprecation

2022-04-29

2022-02-17

Mapping update

2022-02-15

Mapping update

2022-01-06

Mapping update

2021-12-28

Mapping update

2021-12-24

2021-12-20

2021-12-10

Mapping update

2021-12-08

Mapping update

API Input

When interacting with Kaiko HTTP APIs, you are expected to pass two information in a header:

curl --compressed -H 'Accept: application/json' 'https://<api_hostname>/<endpoint>'

Timestamp Input

All time parameters are in UTC and returned in the following ISO 8601 datetime format:

YYYY-MM-DDThh:mm:ss.sssZ

For example:

2017-12-17T13:35:24.351Z

The "T" separates the date from the time. The trailing "Z" indicates UTC time.

Exchange Code

We strive to use only one exchange code to cover all the instrument classes such as spot, futures and etc., but due to the legacy issues, we might use different exchange codes for one exchange. The following exchanges are the exchanges having more than one exchange codes for covering different instrument classes.

Exchange Exchange code Instrument Classes
Binance binc spot, future, perpetual future
Binance bopt option
Bybit bbit future, perpetual future, option
Bybit bbsp spot
Huobi huob spot
Huobi hbdm future, perpetual future, option
Kraken krkn spot
Kraken crfl future, perpetual future

Instrument Code

To access any detailed data such as trade, order book and etc, we need to provide an instrument code as an input for the REST API. Instruments follow a different naming conventions based on their instrument classes.

Spot

Spot names are normalized to have the same name format (base_asset-quote_asset) across exchanges. For instance, to access the data of Binance's spot btc/usdt, btc-usdt is the right instrument code.

Future

The instrument code for futures are not normalized. In other words, one should use the instrument names given by exchanges to download data of futures from Kaiko REST API endpoints. (e.g. Bitmex future: xbtu21, Binance future: btcusd220930)

Perpetual-future

Instruments of perpetual futures are normalized to have the same name format (base_asset-quote_asset) across exchanges. In other words, Deribit option: btc7oct2231000p)

Option

The instrument code for options are not normalized. In other words, one should use the instrument names given by exchanges to download data of options from Kaiko REST API endpoints. (e.g. Deribit option: btc7oct2231000p)

API Output

"taker_side_sell" Explained

You can find this field in the Trade API endpoint

For Centralized Exchange(CEX) taker_side_sell takes the value of true when a taker's sell order fills a maker's buy order and false when a taker's buy order fills a maker's sell order.

For Decentralized Exchanges (DEX) using Automatic Market Maker (AMM) protocols, the liquidity pool contract is considered the maker. The entity executing a transaction against the liquidity pool is the taker.

If an exchange does not appear below, it can be assumed that all data we provide is normalized correctly. For exchanges where we were unable to confirm as reporting data from either a taker or a maker's perspective, we have included the notation mapping from the exchange's trade direction field to our taker_side_sell field. This is necessary so that researchers who want to further study trade direction can make their own conclusions. For exchanges that classify trade direction differently or exclude the field entirely, we also include the notation mapping and a short explanation for how their variable differs.

Furthermore, there are some trades of the Australian Exchange Independent Reserve, where we cannot decide if it is the taker buy or taker sell. As such, it is the only exchange that has 3 values, which are true, false and unknown, in the field taker_side_sell.

Finally, we have made a couple of errors in classifying exchanges as "maker" or "taker", typically early on in the process of developing taker_side_sell. Rather than switch our trade reporting after years of data collection, we have simply marked exchanges where the inverse of the notation stated should be applied. For these exchanges, researchers should be aware that when taker_side_sell: false, the inverse should be assumed.

To read an in-depth explanation of this variable, read our post here.

Unconfirmed, Misclassified or Absent Trade Direction Field

Exchange Exchange Notation Kaiko taker_side_sell: true equivalent to: Comment
BTCBox "type": "buy" or "sell" inverse notation: "type": "sell" Inverse, but confirmed perspective from exchange.
Liquid (Quoine) taker_side: "buy" or "sell" inverse notation: taker_side: "buy" Inverse, but confirmed perspective from exchange.
Bithumb "type": "bid" or "ask" inverse notation: "type": "bid" Inverse, but confirmed perspective from exchange.
Coinone "is_ask": "0"(if seller is taker)/"1"(if seller is maker) inverse notation: "is_ask": "1" Inverse, confirmed from exchange but slightly different notation format
Bitstamp type: 0 (buy) or 1 (sell) type: 1 Unconfirmed perspective from exchange
Bit-Z "s": "buy" or "sell" "s": "sell" Unconfirmed perspective from exchange
EXX type": "buy" or "sell" type: "sell" Unconfirmed perspective from exchange
CEX.io type: "buy" or "sell" type: "sell" Unconfirmed perspective from exchange
Yobit "type": "bid" or "ask" "type": "bid" Unconfirmed perspective from exchange
itBit None Always returns true No buy/sell field
Korbit None Always returns null No buy/sell field
Coinflex None Always returns null No buy/sell field
Independent Reserve "Side": "Buy" or "Sell" "Side": "Sell" Some trades have "Unknown"

Market Open and Close

Digital asset exchanges operate approximately 24x7x365. For daily aggregated data, the opening price is calculated as the first trade at or after 00:00:00 UTC. The closing price is calculated as the last trade prior to 00:00:00 UTC.

Timestamp Output

All timestamps are returned as millisecond Unix timestamps (the number of milliseconds elapsed since 1970-01-01 00:00:00.000 UTC). For metadata fields, times are also returned in millisecond-resolution ISO 8601 datetime strings in the same format as input for convenience.

CEX Coverage

The table below focuses solely on active centralized cryptocurrency exchanges. The column headers trades and orderbook snapshot encompass not only tick trades and tick orderbooks, but also aggregated data. This includes Open, High, Low, Close, Volume (OHLCV) and Volume Weighted Average Price (VWAP) for trades, as well as aggregated depth for the orderbook snapshot.

DEX Coverage

The table below describes our DEX coverage. The column trades also encompass aggregated data. This includes Open, High, Low, Close, Volume (OHLCV) and Volume Weighted Average Price (VWAP).

Reference Data API

Reference data covers assets and instruments

General

The base URL for the Reference Data Endpoints is: https://reference-data-api.kaiko.io/. Authentication is not required.

Assets

This endpoint retrieves a list of supported assets.

Request Example

curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/assets'

Response Example

{
  "result": "success",
  "data": [
    {
      "code": "btc",
      "name": "Bitcoin",
      "asset_class": "cryptocurrency",
      "asset_classes": [
        "cryptocurrency"
      ]
    },
    {
      "code": "bch",
      "name": "Bitcoin Cash",
      "asset_class": "cryptocurrency",
      "asset_classes": [
        "cryptocurrency"
      ]
    },
    {
      "code": "jpy",
      "name": "Japanese Yen",
      "asset_class": "fiat",
      "asset_classes": [
        "fiat"
      ]
    },
    /* ... */
  ]
}

HTTP request

GET https://reference-data-api.kaiko.io/v1/assets

Parameters

No parameters supported.

Fields

Field Description
asset_class The asset's primary asset class
asset_classes The asset's secondary asset classes
code Kaiko identifier for the asset.
name The asset name

Exchanges

Request Example

curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/exchanges'

Response Example


{
  "result": "success",
  "data": [
    {
      "code": "bfly",
      "name": "bitFlyer",
      "kaiko_legacy_slug": "bl"
    },
    {
      "code": "bfnx",
      "name": "Bitfinex",
      "kaiko_legacy_slug": "bf"
    }
    /* ... */
  ]
}

This endpoint retrieves a list of supported exchanges.

HTTP request

GET https://reference-data-api.kaiko.io/v1/exchanges

Parameters

No parameters supported.

Fields

Field Description
code Kaiko identifier for the exchange.
kaiko_legacy_slug Identifier used in delivery of aggregated data.
name The exchange name.

Instruments

Request Example

curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/instruments'

Response Example

{
  "result": "success",
  "data": [
    {
      "kaiko_legacy_exchange_slug": "bf",
      "trade_start_time": "2017-08-09T23:36:33.0000000Z",
      "trade_end_time": null,
      "code": "xmr-btc",
      "exchange_code": "bfnx",
      "exchange_pair_code": "XMRBTC",
      "base_asset": "xmr",
      "quote_asset": "btc",
      "kaiko_legacy_symbol": "xmrbtc",
      "class": "spot",
      "trade_start_timestamp": 1502321793000,
      "trade_end_timestamp": null,
      "trade_count": 2439870,
      "trade_compressed_size": 35037071
    },
    {
      "kaiko_legacy_exchange_slug": "kk",
      "trade_start_time": "2017-08-08T20:10:04.0000000Z",
      "trade_end_time": null,
      "code": "gno-eth",
      "exchange_code": "krkn",
      "exchange_pair_code": "GNOETH",
      "base_asset": "gno",
      "quote_asset": "eth",
      "kaiko_legacy_symbol": "gnoeth",
      "class": "spot",
      "trade_start_timestamp": 1502223004345,
      "trade_end_timestamp": null,
      "trade_count": 380822,
      "trade_compressed_size": 21119034
    },
    /* ... */
  ]
}

This endpoint retrieves a list of supported instruments. There are three possible cases regarding the trading period:

HTTP request

GET https://reference-data-api.kaiko.io/v1/instruments

Parameters

Parameter Required Description
exchange_code No Exchange code. See Exchanges Reference Data Endpoint.
base_asset No The desired base asset code. See Instruments Reference Data Endpoint.
quote_asset No The desired quote asset code. See Instruments Reference Data Endpoint.
code No Kaiko identifier for the instrument. Always base_asset-quote_asset for spot instruments.
kaiko_legacy_symbol No Kaiko legacy instrument symbol.
class No spot, future, perpetual-future,...
base_asset_class No Base asset class. See Instruments Reference Data Endpoint.
quote_asset_class No Quote asset class. See Instruments Reference Data Endpoint.
trade_start_timestamp No Starting time in ISO 8601 (inclusive).
trade_end_timestamp No Ending time in ISO 8601 (inclusive). Can also use "ongoing" to get ongoing instruments.
trade_count_min No Minimum number of trades.
trade_count_max No Maximum number of trades.
with_list_pools No true or false. For pairs traded on DEXs, provides the list of underlying pools to each instrument.
continuation_token No See Pagination.
page_size No Maximum number of records to return in one response
orderBy No Order results by a specifit field. See below for all possible values.
order No Return the data in ascending (1) or descending (-1) order

Possible values for orderBy: exchange_code, class, kaiko_legacy_symbol, trade_start_timestamp, trade_end_timestamp, trade_count, base_asset, quote_asset, code, trade_count_min, trade_count_max

All parameters, except for trade_count_min/max, trade_start/end_timestamp can be repeated in the URL to filter on all those value For example to get instruments for coinbase & deribit : /instruments?exchange_code=cbse&exchange_code=drbt

Fields

Field Description
base_asset1 Base asset.
class spot, future, perpetual-future,...
code2 Kaiko identifier for the instrument. Always base_asset-quote_asset for spot instruments.
exchange_code Exchange code.
exchange_pair_code2 Identifier for the instrument used by the exchange.
kaiko_legacy_exchange_slug Exchange kaiko_legacy_slug.
kaiko_legacy_symbol Identifier used in past deliveries of historical market data and Data Feed.
quote_asset1 Quote asset.
trade_start_time Time of first available trade in Kaiko's data set.
trade_start_timestamp Timestamp of first available trade in Kaiko's data set.
trade_end_time Time of last available trade in Kaiko's data set. null if instrument is still active
trade_end_timestamp Timestamp of last available trade in Kaiko's data set. null if instrument is still active
trade_count Total number of trades available through Kaiko Market Data API and Data Feed. For active pairs, this is an approximation.
trade_compressed_size Approximate size in bytes of all available trades in Kaiko Data Feed.
list_pools The list of the underlying pools to each instrument. (Only when arg with_list_pools=true is provided).

*1: Some exchanges may refer to base and quote currencies differently. Kaiko denotes prices in units of quote and volume in units of base, as reported by exchanges. * *2: Some exchanges reverse the ordering of base/quote in their codes. *

Pools

Request Example

curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/pools'

Response Example

{
  "result":"success",
  "data":[
    {"address":"0x52ea46506b9cc5ef470c5bf89f17dc28bb35d85c",
      "name":"usdt",
      "protocol":"curv",
      "type":"base pool",
      "fee":"0.0004",
      "tokens":[
        {"address":"0x5d3a536e4d6dbd6114cc1ead35777bab948e3643","symbol":"cDAI","decimals":"8"},
        {"address":"0x39aa39c021dfbae8fac545936693ac917d5e7563","symbol":"cUSDC","decimals":"8"},
        {"address":"0xdac17f958d2ee523a2206206994597c13d831ec7","symbol":"USDT","decimals":"6"}
      ],
      "underlyingTokens":[
        {"address":"0x6b175474e89094c44da98b954eedeac495271d0f","symbol":"DAI","decimals":"18"},
        {"address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","symbol":"USDC","decimals":"6"},
        {"address":"0xdac17f958d2ee523a2206206994597c13d831ec7","symbol":"USDT","decimals":"6"}
      ]
    },
    /* ... */
  ]
}

This endpoint retrieves a list of supported pools. The caracteristics of each pool differs depending on the protocol.

HTTP request

GET https://reference-data-api.kaiko.io/v1/pools

Parameters

Parameter Required Description
address No The pool's contract address.
protocol No The pool's protocol.
type No The pool's type. ex: Curve meta pool, Curve base pool, etc.
fee No The trading fees on this pool.
tokens No Filter on one or several tokens in the pool.
underlying_tokens No Filter on one or several tokens in the pool. Specific to Curve.

Fields

Field Description
address The pool's contract address.
name The pool's name as it is specified on-chain.
protocol The pool's protocol. ex:usp2,usp3, curv, blcr
type The pool's type. ex: Curve meta pool, Curve base pool, etc.
fee The trading fees on this pool.
tokens The pool's tokens.
underlyingTokens The underlying tokens in the pool. Specific to Curve.
tickSpacing The pool's tick spacing. Specific to Uniswap v3.
weights The weights of the different tokens in the pool. Specific to Balancer.

Blockchains

Request Example

curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/blockchains'

Response Example

{
    "result":"success",
    "count": 10,
    "data":
    [
        {"id":1,"name":"ethereum","is_evm":true},
        {"id":2,"name":"bsc","is_evm":true},
        {"id":3,"name":"polygon","is_evm":true},
        {"id":4,"name":"arbitrum","is_evm":true},
        {"id":5,"name":"avalanche","is_evm":true},
        /* ... */
    ]
}

This endpoint retrieves the list of supported blockchains.

HTTP request

GET https://reference-data-api.kaiko.io/v1/blockchains

Fields

Field Description
id The blockchain's id in our reference data.
name The blockchain's name in our reference data.
is_evm If the blockchain is EVM-Compatible or not.

Market Data API

General

Base endpoints

The base URL for the Market Data Endpoints is regionalized. We are currently offering endpoints in the US and in Europe:

Usage

Authentication

Request Syntax

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://<api_hostname>/<endpoint>'

Each API lives under its own hostname. Clients must include an API key in the header of every request they make. The format is as follows:

X-Api-Key: <client-api-key>

Data versioning

Kaiko takes transparency and accountability very seriously. Therefore, our provided datasets are versioned. Dataset versioning is orthogonal to API versioning. Any potential breaking changes in results (e.g. semantical changes or corrections of historically incorrect data) will result in a new dataset version - no corrections or adjustments will be done in the dark. Addition of new data will not result in a new dataset version. Data is versioned on a per-base-data level.

The versioning is selected by selecting a base data set and a version. All current Market Data API endpoints take the commodity and data_version parameters.

By setting this to latest, you will get the most recent version. The returned version is always included in the query field and can be referred to if you would ever need to compare results, should we ever need to adjust historical data. Paginating over a request with version set to latest will preserve the current version across subsequent pagination requests.

We recommend using the most current version explicitly in production integrations as the latest label might move at any time to a breaking change. For the trades and order_book_snapshots commodities the latest version is currently v1

Response Example

{
  "timestamp": 1540474596175,
  "trade_id": "68024786",
  "price": "6559.84000000",
  "amount": "0.00646600",
  "taker_side_sell": true
}

Envelope

Response Example

{
  "result": "success",
  "time": "2018-06-14T17:19:40.303Z",
  "timestamp": 1528996780303,
  "query": { /* ... */ },
  "data": [ /* ... */ ],
  "access": {
    "access_range": {
      "start_timestamp": 1546300800000,
      "end_timestamp": 1577836800000
    },
    "data_range": {
      "start_timestamp": 1356998400000,
      "end_timestamp": 1577836800000
    }
  }
}

All API responses are in JSON format. A result field, with a value of success or error is returned with each request. In the event of an error, a message field will provide an error message.

An access object is also echoed back. It contains two ranges of timestamps:

Key Data type Description
access {} Time ranges of accesses.
data [] | {} Response result data.
message string Error message, if query was not successful.
query {} All handled query parameters echoed back.
result string success if query successful, error otherwise.
time string The current time at our endpoint.
timestamp long The current time at our endpoint.

Pagination

Pagination Example

{
  "result": "success",
  "time": "2018-06-14T17:19:40.303Z",
  "timestamp": 1528996780303,
  "query": {...},
  "data": [...],
  "continuation_token": "ab25lIG1vcmUgYmVlciBpcyBvbmUgbW9yZSBiZWVyIHRvbyBtYW55",
  "next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=ab25lIG1vcmUgYmVlciBpcyBvbmUgbW9yZSBiZWVyIHRvbyBtYW55",
  "access": {...}
}

For queries that result in a larger dataset than can be returned in a single response, a continuation_token field is included. Calling the same endpoint again with the continuation_token query parameter added will return the next result page. For convenience, a next_url field is also included, containing a URL that can be called directly to get the next page. Paginated endpoints also takes a page_size parameter that specifies the maximum number of items that should be included in each response. Only the first call should include page_size, all subsequent calls should only use continuation_token. Paginating over a request with version set to latest will preserve the current version across subsequent pagination requests.

Parameters

Parameter Required Description
continuation_token No
page_size No Maximum number of records to return in one response

Errors

All API responses are in JSON format. A result field, with a value of success or error is returned with each request. In the event of an error, a message field will provide an error message.

HTTP error codes

The Kaiko platform API uses the following error codes:

Error Code Meaning
400 Bad Request
401 Unauthorized -- You are not authenticated properly. See Authentication.
403 Forbidden -- You don't have access to the requested resource.
404 Not Found
405 Method Not Allowed
406 Not Acceptable
429 Too Many Requests
500 Internal Server Error -- We had a problem with our service. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance.

Trade data

Real-time & Historical Trade Data

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades'

Response Example

{
    "query": {
        "page_size": 100,
        "exchange": "bfnx",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "sort": "desc",
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2020-11-12T16:33:20.575Z"
    },
    "time": "2020-11-12T16:33:20.869Z",
    "timestamp": 1605198800869,
    "data": [
        {
            "timestamp": 1605198775855,
            "trade_id": "522419198",
            "price": "16026",
            "amount": "0.025",
            "taker_side_sell": true
        },
        {
            "timestamp": 1605198775031,
            "trade_id": "522419197",
            "price": "16026",
            "amount": "0.01",
            "taker_side_sell": true
        },
  /* ... */
  ],
  "result": "success",
  "continuation_token": "rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
  "next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
  "access": {
    "access_range": {
      "start_timestamp": null,
      "end_timestamp": null
    },
    "data_range": {
      "start_timestamp": null,
      "end_timestamp": null
    }
  }
}

This endpoint retrieves trades for an instrument on a specific exchange. Trades are sorted by time, in a descendingly order unless it is specified otherwise. Note that taker_side_sell can be null in the cases where this information was not available at collection.

HTTP request

GET https://{region}.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{instrument}/trades{?start_time,end_time,page_size,continuation_token}

Parameters

Parameter Required Description Example
region Yes Choose between eu and us. eu
exchange1 Yes Exchange code. See Exchanges Reference Data Endpoint. okex
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
start_time2 No Starting time in ISO 8601 (inclusive).
end_time2 No Ending time in ISO 8601 (exclusive).
page_size2 No See Pagination (min: 1, default: 100, max: 100000).
continuation_token No See Pagination.

Fields

Field Description
timestamp The timestamp provided by the exchange or the collection timestamp in Unix Timestamp (in milliseconds)
trade_id Unique trade ID (unique to the exchange). In case the exchange does not provide an ID, we generate it ourselves.
price Price displayed in quote currency.
amount Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).
taker_side_sell See Taker Side Sell

1: This endpoint serves both data from centralized as well as decentralized exchanges. 2: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Order Book data

This endpoint provides a month’s worth of historical snapshots of the top 10% of the order book. The term β€˜10%’ signifies the range of limit orders we’re considering. For ask limit orders, we’re looking at those with prices that are up to 10% higher than the best ask price. Conversely, for bid limit orders, we’re focusing on those with prices that are up to 10% lower than the best bid price. This ensures a comprehensive view of the market’s depth within a 10% price band around the best bid and ask prices.

Order Book Snapshots: Full

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/full?slippage=100000&page_size=10&limit_orders=2&slippage_ref=best'

Response Example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "slippage": 100000,
        "limit_orders": 2,
        "slippage_ref": "best",
        "sort": "desc",
        "metric": "full",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T14:10:06.320Z"
    },
    "time": "2020-05-26T14:10:06.418Z",
    "timestamp": 1590502206418,
    "data": [
        {
            "poll_timestamp": 1590502155757,
            "poll_date": "2020-05-26T14:09:15.757Z",
            "timestamp": null,
            "bid_volume0_1": "46.595",
            "bid_volume0_2": "110.570",
            "bid_volume0_3": "167.920",
            "bid_volume0_4": "198.416",
            "bid_volume0_5": "243.554",
            "bid_volume0_6": "346.467",
            "bid_volume0_7": "354.090",
            "bid_volume0_8": "359.058",
            "bid_volume0_9": "381.422",
            "bid_volume1": "384.066",
            "bid_volume1_5": "467.014",
            "bid_volume2": "522.441",
            "bid_volume4": "918.911",
            "bid_volume6": "1187.306",
            "bid_volume8": "1187.306",
            "bid_volume10": "1187.306",
            "ask_volume0_1": "13.158",
            "ask_volume0_2": "40.072",
            "ask_volume0_3": "71.129",
            "ask_volume0_4": "179.463",
            "ask_volume0_5": "259.140",
            "ask_volume0_6": "266.315",
            "ask_volume0_7": "324.288",
            "ask_volume0_8": "353.024",
            "ask_volume0_9": "376.738",
            "ask_volume1": "405.965",
            "ask_volume1_5": "467.665",
            "ask_volume2": "506.326",
            "ask_volume4": "862.843",
            "ask_volume6": "1322.553",
            "ask_volume8": "1428.856",
            "ask_volume10": "1428.856",
            "spread": "0.1",
            "mid_price": "8819.95",
            "ask_slippage": "0.0002782477139043083900226757369614512",
            "bid_slippage": "0.0",
            "asks": [
                {
                    "amount": "5.914",
                    "price": "8820"
                },
                {
                    "amount": "0.08",
                    "price": "8821"
                }
            ],
            "bids": [
                {
                    "amount": "11.814",
                    "price": "8819.9"
                },
                {
                    "amount": "4.197",
                    "price": "8819.8"
                }
            ]
        },
      /* ... */
],
    "result": "success",
    "continuation_token": "Ehad6pjoEpvpZSkvbtsyx8WxTj9vgc4s5VSow1USG8pXP1UGFSxSF7fTacxA54rYoqebnMTdCpE3ZxB3nSTM5CYNModkKRASDWMHymPFHNXnGL73RdkHSVUv6UYa4YwrRinH7JbwRqbB5HwmZdxWaonnaVkeZZc1wZiuK2oR4ePQdotGEnvKY8spPjYwnX8s3D6w1bCqZqL6ENaNH5Pa6b53MdbmyQBjE8F",
    "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/full?continuation_token=Ehad6pjoEpvpZSkvbtsyx8WxTjvgc4s5VSow1USG8pXP1UGFSxSF7fTacxA54rYoqebnMTdCpE3ZxB3nSTM5CYNModkKRASDWMHymPFHNXnGL73RdkHSVUv6UYa4YwrRinH7JbwRqbB5HwmZdxWaonnaVkeZZc1wZiuK2oR4ePQdotGEnvKY8spPjYwnX8s3D6w1bCqZqL6ENaNH5Pa6b53MdbmyQBjE8F",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

The full endpoint returns all the following order book data: the snapshot itself (bids and asks), the depth of the order book (the cummulative volume of the base asset at 0.1%, 0.2%, 0.3%, 0.4%, 0.5%, 0.6%, 0.7%, 0.8%, 0.9%, 1%, 1.5%, 2%, 4%, 6%, 8% and 10% from the best ask and best bid respectively), the spread, the mid price and, when the slippage parameter is not empty, the percentage of slippage for a given order size, either calculated from the best bid/ask or calculated from the mid price. All data is returned in descending order.

HTTP request

GET https://us.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/full{?start_time,end_time,page_size,continuation_token,slippage,slippage_ref,orders,limit_orders}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange Yes Exchange code. See Exchanges Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
limit_orders No Number of orders to return on bid and ask side per snapshot. To retreive the best bid/ask, set this parameter to 1 (default: 10)
page_size1 No Number of snapshots to return. See Pagination (default: 10, max: 100).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc
start_time1 No Starting time in ISO 8601 (inclusive).
slippage No Order size (in quote asset) for which to calculate the percentage of slippage. Default: 0. When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref No Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best). Default: mid_price.

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Fields

Field Description
poll_timestamp The timestamp at which the raw data snapshot was taken.
poll_date The date at which the raw data snapshot was taken.
timestamp The timestamp provided by the exchange. null when not provided.
bid_volume_x The volume of bids placed within 0 and x% of the best bid.
ask_volume_x The volume of asks placed within 0 and x% of the best ask.
spread The difference between the best bid and the best ask at the time the snapshot was taken.
mid_price The mid price between the best bid and the best ask.
ask_slippage The percentage price slippage for a market buy order placed at the time that the order book snapshot was taken.
bid_slippage The percentage price slippage for a market sell order placed at the time that the order book snapshot was taken.
asks The sell orders in the snapshot. If the limit_oders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids The buy orders in the snapshot. If the limit_oders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.

Order Book Snapshots: Raw

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/raw?page_size=10&limit_orders=2'

Response example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "slippage": 0,
        "limit_orders": 2,
        "slippage_ref": "mid_price",
        "sort": "desc",
        "metric": "raw",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T14:13:08.823Z"
    },
    "time": "2020-05-26T14:13:08.899Z",
    "timestamp": 1590502388899,
    "data": [
        {
            "poll_timestamp": 1590502335760,
            "poll_date": "2020-05-26T14:12:15.760Z",
            "timestamp": null,
            "asks": [
                {
                    "amount": "12",
                    "price": "8830"
                },
                {
                    "amount": "3.67",
                    "price": "8832.9"
                }
            ],
            "bids": [
                {
                    "amount": "13.316",
                    "price": "8829.9"
                },
                {
                    "amount": "0.097",
                    "price": "8829.4"
                }
            ]
        }
      /* ... */         
    ],
    "result": "success",
    "continuation_token": "Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
    "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/raw?continuation_token=Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

This endpoint is identical to the Full endpoint but only returns the raw snapshots of bids and asks without any additional metrics. The Full specific parameters (such as slippage and slippage_ref) are disabled but won't yield any errors when used. All data is returned in descending order.

HTTP request

GET https://us.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/raw{?start_time,end_time,page_size,continuation_token,limit_orders}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange Yes Exchange code. See Exchanges Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
limit_orders No Number of orders to return on bid and ask side per snapshot. To retreive the best bid/ask, set this parameter to 1 (default: 10)
page_size1 No Number of snapshots to return. See Pagination (default: 10, max: 100).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc
start_time1 No Starting time in ISO 8601 (inclusive).

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Fields

Field Description
poll_timestamp The timestamp at which the raw data snapshot was taken.
poll_date The date at which the raw data snapshot was taken.
timestamp The timestamp provided by the exchange. null when not provided.
asks The sell orders in the snapshot. If the limit_oders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids The buy orders in the snapshot. If the limit_oders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.

Order Book Snapshots: Depth

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/depth?page_size=10'

Response Example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "slippage": 0,
        "limit_orders": 0,
        "slippage_ref": "mid_price",
        "sort": "desc",
        "metric": "depth",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T14:29:44.757Z"
    },
    "time": "2020-05-26T14:29:44.816Z",
    "timestamp": 1590503384816,
    "data": [
        {
            "poll_timestamp": 1590503344916,
            "poll_date": "2020-05-26T14:29:04.916Z",
            "timestamp": null,
            "bid_volume0_1": "37.606",
            "bid_volume0_2": "102.304",
            "bid_volume0_3": "141.907",
            "bid_volume0_4": "177.446",
            "bid_volume0_5": "203.634",
            "bid_volume0_6": "218.450",
            "bid_volume0_7": "283.128",
            "bid_volume0_8": "293.533",
            "bid_volume0_9": "321.986",
            "bid_volume1": "348.213",
            "bid_volume1_5": "405.080",
            "bid_volume2": "444.782",
            "bid_volume4": "837.949",
            "bid_volume6": "1110.065",
            "bid_volume8": "1110.065",
            "bid_volume10": "1110.065",
            "ask_volume0_1": "7.401",
            "ask_volume0_2": "13.744",
            "ask_volume0_3": "58.917",
            "ask_volume0_4": "131.104",
            "ask_volume0_5": "165.971",
            "ask_volume0_6": "193.786",
            "ask_volume0_7": "257.001",
            "ask_volume0_8": "286.384",
            "ask_volume0_9": "312.040",
            "ask_volume1": "319.040",
            "ask_volume1_5": "382.927",
            "ask_volume2": "475.467",
            "ask_volume4": "909.144",
            "ask_volume6": "1229.664",
            "ask_volume8": "1323.505",
            "ask_volume10": "1323.505"
        },
      /* ... */
],
    "result": "success",
    "continuation_token": "Z8FjYwcAjf7MZEG382e5MpmZx7wkuziQTyy2k5fVgSrcF8jAYqUpRgPH5cbQ9MhJiFaxGRbwiERMp3cWhXJshy",
    "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/depth?continuation_token=Z8FjYwcAjf7MZEG382e5MpmZx7wkuziQTyy2k5fVgSrcF8jAYqUpRgPH5cbQ9MhJiFaxGRbwiERMp3cWhXJshy",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}        

This endpoint is identical to the Full endpoint but only returns metrics on the depth of the order book (the cummulative volume of the base asset at 0.1%, 0.2%, 0.3%, 0.4%, 0.5%, 0.6%, 0.7%, 0.8%, 0.9%, 1%, 1.5%, 2%, 4%, 6%, 8% and 10% from the best ask & best bid) per snapshot. The Full specific parameters (such as slippage, slippage_ref and limit_orders) are disabled but won't yield any errors when used. All data is returned in descending order.

HTTP request

GET https://us.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/depth{?start_time,end_time,page_size,continuation_token}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange Yes Exchange code. See Exchanges Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
page_size1 No Number of snapshots to return data for. See Pagination (default: 10, max: 100).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc
start_time1 No Starting time in ISO 8601 (inclusive).

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Fields

Field Description
poll_timestamp The timestamp at which the raw data snapshot was taken.
poll_date The date at which the raw data snapshot was taken.
timestamp The timestamp provided by the exchange. null when not provided.
bid_volume_x The volume of bids placed within 0 and x% of the best bid.
ask_volume_x The volume of asks placed within 0 and x% of the best ask.

Order Book Snapshots: Slippage

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/slippage?end_time=2019-12-09T00:00:00Z&slippage_ref=best&start_time=2019-12-01T00:00:00Z&slippage=1000000&page_size=10'

Response Example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "slippage": 100000,
        "limit_orders": 0,
        "slippage_ref": "best",
        "sort": "desc",
        "metric": "slippage",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T14:42:17.053Z"
    },
    "time": "2020-05-26T14:42:17.123Z",
    "timestamp": 1590504137123,
    "data": [
        {
            "poll_timestamp": 1590504124917,
            "poll_date": "2020-05-26T14:42:04.917Z",
            "timestamp": null,
            "ask_slippage": "0.0001057219873253085790064266041007855",
            "bid_slippage": "0.0001581287020485902479395059349031256"
        },
        {
            "poll_timestamp": 1590504075786,
            "poll_date": "2020-05-26T14:41:15.786Z",
            "timestamp": null,
            "ask_slippage": "0.00001534073225141691226479256404443437",
            "bid_slippage": "0.0002555856086571344339622641509433962"
        },
      /* ... */
    ],
    "result": "success",
    "continuation_token": "Z8Fj1yUWjj3uvv1U2d8fASeGLm4jZ4iHCopdsZLKUyDJE8KrBaDXwQQWXHJQxm",
    "next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/slippage?continuation_token=Z8Fj1yUWjj3uvv1U2d8fASeGLm4jZ4iHCopdsZLKUyDJE8KrBaDXwQQWXHJQxm",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

This endpoint is identical to the Full endpoint but only returns slippage for a given order size, either calculated from the best bid/ask or calculated from the mid price. The Full and Raw specific parameter limit_orders is disabled but won't yield any errors when used. All data is returned in descending order.

HTTP request

GET https://us.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/slippage{?start_time,end_time,page_size,continuation_token,slippage,slippage_ref}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange Yes Exchange code. See Exchanges Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
page_size1 No Number of snapshots to return data for. See Pagination (default: 10, max: 100).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc
start_time1 No Starting time in ISO 8601 (inclusive).
slippage No Order size (in quote asset) for which to calculate the percentage of slippage. Default: 0. When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref No Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best). Default: mid_price.

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Fields

Field Description
poll_timestamp The timestamp at which the raw data snapshot was taken.
poll_date The date at which the raw data snapshot was taken.
timestamp The timestamp provided by the exchange. null when not provided.
ask_slippage The percentage price slippage for a market buy order placed at the time that the order book snapshot was taken.
bid_slippage The percentage price slippage for a market sell order placed at the time that the order book snapshot was taken.

Order Book Aggregations: Full

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/ob_aggregations/full?page_size=10&slippage=100000&interval=1h&start_time=2019-12-04T00:00:00Z&end_time=2019-12-06T00:00:00Z'

Response Example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "interval": "1h",
        "slippage": 100000,
        "slippage_ref": "mid_price",
        "sort": "desc",
        "aggregation": "full",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T14:46:00.561Z"
    },
    "time": "2020-05-26T14:46:03.776Z",
    "timestamp": 1590504363776,
    "data": [
        {
            "poll_timestamp": 1590501600000,
            "ask_slippage": "0.00032766083806437735",
            "bid_slippage": "0.0002206511273162024",
            "bid_volume0_1": "31.751239130434783",
            "bid_volume0_2": "87.33763043478261",
            "bid_volume0_3": "139.32403260869566",
            "bid_volume0_4": "177.62314130434783",
            "bid_volume0_5": "206.71984782608695",
            "bid_volume0_6": "251.4888043478261",
            "bid_volume0_7": "287.1503043478261",
            "bid_volume0_8": "317.3515869565217",
            "bid_volume0_9": "335.79671739130436",
            "bid_volume1": "352.03117391304346",
            "bid_volume1_5": "419.0988260869565",
            "bid_volume2": "470.6285",
            "bid_volume4": "859.7884347826086",
            "bid_volume6": "1134.0595760869564",
            "bid_volume8": "1134.4657173913045",
            "bid_volume10": "1134.4657173913045",
            "ask_volume0_1": "21.558043478260867",
            "ask_volume0_2": "37.20532608695652",
            "ask_volume0_3": "78.02648913043478",
            "ask_volume0_4": "143.83753260869565",
            "ask_volume0_5": "192.98572826086954",
            "ask_volume0_6": "235.31961956521738",
            "ask_volume0_7": "280.5659565217391",
            "ask_volume0_8": "309.4857717391304",
            "ask_volume0_9": "327.8923152173913",
            "ask_volume1": "341.79707608695657",
            "ask_volume1_5": "411.3568043478261",
            "ask_volume2": "475.6048586956521",
            "ask_volume4": "885.1007826086956",
            "ask_volume6": "1263.1216413043478",
            "ask_volume8": "1364.2838369565218",
            "ask_volume10": "1364.2838369565218",
            "mid_price": "8830.427717391303",
            "spread": "1.175"
        }
      /* ... */
    ],
    "result": "success",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

This endpoint gives access to one month of historical 10% order book aggregated data. It returns metrics on the average depth of the order book (the cummulative volume of the base asset at 0.1%, 0.2%, 0.3%, 0.4%, 0.5%, 0.6%, 0.7%, 0.8%, 0.9%, 1%, 1.5%, 2%, 4%, 6%, 8% and 10% from the best ask & best bid), the average spread, the average mid price and, when the slippage parameter is not empty, the average percentage of slippage for a given order size, either calculated from the best bid/ask or calculated from the mid price for a given interval. For each interval, the aggregates are calculated by taking the average metrics of each snapshot within that interval. For example, the aggregated 1 hour spread is calculated by taking all spreads of each snapshot within an hour and calculating the average. All data is returned in descending order.

HTTP request

GET https://us.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/ob_aggregations/full{?start_time,end_time,page_size,continuation_token,slippage,slippage_ref,interval}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange Yes Exchange code. See Exchanges Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
interval No Interval period. Default 1h.
page_size1 No Number of snapshots to return data for. See Pagination (default: 10, max: 100).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc
start_time1 No Starting time in ISO 8601 (inclusive).
slippage No Order size (in quote asset) for which to calculate the percentage of slippage. Default: 0. When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref No Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best). Default: mid_price.

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Field Description
poll_timestamp The timestamp at which the interval begins.
bid_volume_x The average volume of bids placed within 0 and x% of the best bid over a specified interval.
ask_volume_x The average volume of asks placed within 0 and x% of the best ask over a specified interval.
spread The average difference between the best bid and the best ask over a specified interval.
mid_price The average mid price between the best bid and the best ask over a specified interval
ask_slippage The average percentage of price slippage for a market buy order over a specified interval.
bid_slippage The average percentage of price slippage for a market sell order over a specified interval.

Order Book Aggregations: Depth

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/ob_aggregations/depth?page_size=10&interval=1h'

Response Example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "interval": "1h",
        "slippage": 0,
        "slippage_ref": "mid_price",
        "sort": "desc",
        "aggregation": "depth",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T14:58:55.582Z"
    },
    "time": "2020-05-26T14:58:56.395Z",
    "timestamp": 1590505136395,
    "data": [
        {
            "poll_timestamp": 1590501600000,
            "bid_volume0_1": "31.31635593220339",
            "bid_volume0_2": "90.78996610169492",
            "bid_volume0_3": "144.16212711864407",
            "bid_volume0_4": "182.9676525423729",
            "bid_volume0_5": "219.1858220338983",
            "bid_volume0_6": "263.02182203389833",
            "bid_volume0_7": "296.666686440678",
            "bid_volume0_8": "322.5334237288136",
            "bid_volume0_9": "340.6282881355932",
            "bid_volume1": "356.4558474576271",
            "bid_volume1_5": "427.1106949152542",
            "bid_volume2": "475.76238135593223",
            "bid_volume4": "863.1048559322035",
            "bid_volume6": "1137.2281271186441",
            "bid_volume8": "1137.5447796610172",
            "bid_volume10": "1137.5447796610172",
            "ask_volume0_1": "22.772533898305085",
            "ask_volume0_2": "36.96916101694915",
            "ask_volume0_3": "78.57454237288135",
            "ask_volume0_4": "144.87783898305085",
            "ask_volume0_5": "195.61884745762714",
            "ask_volume0_6": "237.96824576271186",
            "ask_volume0_7": "282.3425338983051",
            "ask_volume0_8": "314.0606779661017",
            "ask_volume0_9": "330.76757627118644",
            "ask_volume1": "344.3153644067797",
            "ask_volume1_5": "413.4595423728814",
            "ask_volume2": "475.48172033898305",
            "ask_volume4": "886.8459152542373",
            "ask_volume6": "1272.5998644067795",
            "ask_volume8": "1371.7920847457626",
            "ask_volume10": "1371.7920847457626"
        },
      /* ... */
    ],
    "result": "success",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

This endpoint is identical to the Full endpoint but only returns metrics on average the depth of the order book (the cummulative volume of the base asset at 0.1%, 0.2%, 0.3%, 0.4%, 0.5%, 0.6%, 0.7%, 0.8%, 0.9%, 1%, 1.5%, 2%, 4%, 6%, 8% and 10% from the best ask & best bid) per snapshot. For each interval, the aggregates are calculated by taking the average metrics of each snapshot within that interval. For example, the aggregated 1 hour spread is calculated by taking all spreads of each snapshot within an hour and calculating the average. The Full specific parameters (such as slippage, slippage_ref) are disabled but won't yield any errors when used. All data is returned in descending order.

HTTP request

GET https://us.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/ob_aggregations/depth{?start_time,end_time,page_size,continuation_token,interval}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange Yes Exchange code. See Exchanges Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
interval No Interval period. Default 1h.
page_size1 No Number of snapshots to return data for. See Pagination (default: 10, max: 100).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc
start_time1 No Starting time in ISO 8601 (inclusive).

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Fields

Field Description
poll_timestamp The timestamp at which the interval begins
bid_volume_x The average volume of bids placed within 0 and x% of the best bid over a specified interval.
ask_volume_x The average volume of asks placed within 0 and x% of the best ask over a specified interval.

Order Book Aggregations: Slippage

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/ob_aggregations/slippage?page_size=10&slippage=100000&interval=1h'

Response Example

{
    "query": {
        "page_size": 10,
        "exchange": "krkn",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "interval": "1h",
        "slippage": 100000,
        "slippage_ref": "mid_price",
        "sort": "desc",
        "aggregation": "slippage",
        "data_version": "v1",
        "commodity": "order_book_snapshots",
        "request_time": "2020-05-26T15:07:06.840Z"
    },
    "time": "2020-05-26T15:07:07.260Z",
    "timestamp": 1590505627260,
    "data": [
        {
            "poll_timestamp": 1590505200000,
            "ask_slippage": "0.00012513598764468878",
            "bid_slippage": "0.0003678539692963374"
        },
        {
            "poll_timestamp": 1590501600000,
            "ask_slippage": "0.00030969034268815156",
            "bid_slippage": "0.00024353107110561094"
        },
      /* ... */
    ],
    "result": "success",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

This endpoint is identical to the Full endpoint but only returns the average slippage for a given order size, either calculated from the best bid/ask or calculated from the mid price. For each interval, the aggregates are calculated by taking the average metrics of each snapshot within that interval. For example, the aggregated 1 hour spread is calculated by taking all spreads of each snapshot within an hour and calculating the average. All data is returned in descending order.

HTTP request

GET https://us.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/ob_aggregations/depth{?start_time,end_time,page_size,continuation_token,interval,slippage,slippage_ref}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange2 Yes Exchange code. See Exchanges Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
interval No Interval period. Default 1h.
page_size1 No Number of snapshots to return data for. See Pagination (default: 10, max: 100).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc
start_time1 No Starting time in ISO 8601 (inclusive).
slippage No Order size (in quote asset) for which to calculate the percentage of slippage. Default: 0. When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref No Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best). Default: mid_price.

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token. 2: This endpoint serves both data from centralized as well as decentralized exchanges.

Fields

Field Description
poll_timestamp The timestamp at which the interval begins.
ask_slippage The average percentage of price slippage for a market buy order over a specified interval.
bid_slippage The average percentage of price slippage for a market sell order over a specified interval.

Aggregates

OHLCV (Candles)

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/ohlcv'

Response Example

{
    "query": {
        "page_size": 100,
        "exchange": "cbse",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "interval": "1d",
        "sort": "desc",
        "aggregation": "ohlcv",
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2020-05-26T17:25:56.221Z"
    },
    "time": "2020-05-26T17:26:00.160Z",
    "timestamp": 1590513960160,
    "data": [
        {
            "timestamp": 1590451200000,
            "open": "8900.0",
            "high": "9016.99",
            "low": "8694.23",
            "close": "8811.36",
            "volume": "9014.60281966"
        },
        {
            "timestamp": 1590364800000,
            "open": "8715.69",
            "high": "8977.0",
            "low": "8632.93",
            "close": "8899.31",
            "volume": "12091.06145914"
        },
  /* ... */
  ],
  "result": "success",
  "continuation_token": "rbd2bcDp35GmDscQbvZ9YzQHZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
  "next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/krkn/spot/btc-usd/aggregations/ohlcv?continuation_token=rbd2bcDp35GmDqdfaz3fZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
  "access": {
    "access_range": {
      "start_timestamp": null,
      "end_timestamp": null
    },
    "data_range": {
      "start_timestamp": null,
      "end_timestamp": null
    }
  }
}

This endpoint retrieves the OHLCV history for an instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc or descending desc order.

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/ohlcv{?interval,start_time,end_time,page_size,continuation_token}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange2 Yes Exchange code.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
interval No Interval period. Default 1d.
page_size1 No See Pagination (min: 1, default: 100, max: 100000).
start_time1 No Starting time in ISO 8601 (inclusive).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token. 2: This endpoint serves both data from centralized as well as decentralized exchanges.

Fields

Field Description
timestamp Timestamp at which the interval begins.
open Opening price of interval. null when no trades reported.
high Highest price during interval. null when no trades reported.
low Lowest price during interval. null when no trades reported.
close Closing price of interval. null when no trades reported.
volume Volume traded in interval. 0 when no trades reported.

Intervals

Any arbitrary value between one second and one day can be used as an interval, as long as it sums up to 1 day. The suffixes are s (second), m (minute), h (hour) and d (day).

VWAP (Prices)

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap'

Response Example

{
    "query": {
        "page_size": 100,
        "exchange": "cbse",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "interval": "1d",
        "sort": "desc",
        "aggregation": "vwap",
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2020-11-12T16:52:36.988Z"
    },
    "time": "2020-11-12T16:52:37.114Z",
    "timestamp": 1605199957114,
    "data": [
        {
            "timestamp": 1605139200000,
            "price": "15879.385939106618"
        },
        {
            "timestamp": 1605052800000,
            "price": "15664.643871798791"
        },
    /* ... */
  ],
  "result": "success",
  "continuation_token": "55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
  "next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap?continuation_token=55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
  "access": {
    "access_range": {
      "start_timestamp": 1546300800000,
      "end_timestamp": 1577836800000
    },
    "data_range": {
      "start_timestamp": 1417391000000,
      "end_timestamp": 1577836800000
    }
  }
}

This endpoint retrieves aggregated VWAP (volume-weighted average price) history for an instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc or descending desc (default) order.

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/vwap{?interval,start_time,end_time,page_size,continuation_token}

Parameters

Parameter Required Description
commodity Yes The data commodity. (trades)
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange2 Yes Exchange code. See Instruments Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
interval No Interval period. Default 1d.
page_size1 No See Pagination (min: 1, default: 100, max: 100000).
start_time1 No Starting time in ISO 8601 (inclusive).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token. 2: This endpoint serves both data from centralized as well as decentralized exchanges.

Fields

Field Description
timestamp Timestamp at which the interval begins.
price Volume-weighted average price. null when no trades reported.

Intervals

Any arbitrary value between one second and one day can be used as an interval, as long as it sums up to 1 day. The suffixes are s (second), m (minute), h (hour) and d (day).

Count-OHLCV-VWAP

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap'

Response Example

{
    "query": {
        "page_size": 100,
        "exchange": "cbse",
        "instrument_class": "spot",
        "instrument": "btc-usd",
        "interval": "1d",
        "sort": "desc",
        "aggregation": "count_ohlcv_vwap",
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2020-11-12T16:55:42.588Z"
    },
    "time": "2020-11-12T16:55:42.710Z",
    "timestamp": 1605200142710,
    "data": [
        {
            "timestamp": 1605139200000,
            "open": "15705.79",
            "high": "16185.87",
            "low": "15446.82",
            "close": "16139.93",
            "volume": "14829.124546730012",
            "price": "15880.01873841608",
            "count": 95111
        },
        {
            "timestamp": 1605052800000,
            "open": "15315.46",
            "high": "16000",
            "low": "15293.04",
            "close": "15705.79",
            "volume": "15123.844197729988",
            "price": "15664.643871798791",
            "count": 114205
        },
    /* ... */
  ],
  "result": "success",
  "continuation_token": "rbd1XbkjMwv2SyUfvJwsqFGmCKzg3WToTvqigui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
  "next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap?continuation_token=rbd1XbkjMwv2SyUfvJwsui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
  "access": {
    "access_range": {
      "start_timestamp": 1546300800000,
      "end_timestamp": 1577836800000
    },
    "data_range": {
      "start_timestamp": 1417391000000,
      "end_timestamp": 1577836800000
    }
  }
}

This endpoint retrieves the trade count, OHLCV and VWAP history for an instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/{commodity}.{data_version}/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/count_ohlcv_vwap{?interval,start_time,end_time,page_size,continuation_token}

Parameters

Parameter Required Description
commodity Yes The data commodity.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exchange2 Yes Exchange code.See Instruments Reference Data Endpoint.
instrument_class Yes Instrument class. See Instruments Reference Data Endpoint.
instrument Yes Instrument code. See Instruments Reference Data Endpoint.
interval No Interval period. Default 1d.
page_size1 No See Pagination (min: 1, default: 100, max: 100000).
start_time1 No Starting time in ISO 8601 (inclusive).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token. 2: This endpoint serves both data from centralized as well as decentralized exchanges.

Fields

Field Description
timestamp Timestamp at which the interval begins.
count Then number of trades. 0 when no trades reported.
open Opening price of interval. null when no trades reported.
high Highest price during interval. null when no trades reported.
low Lowest price during interval. null when no trades reported.
close Closing price of interval. null when no trades reported.
volume Volume traded in interval. 0 when no trades reported.
vwap The volume weighted price during the time interval. null when no trades reported.

Intervals

Any arbitrary value between one second and one day can be used as an interval, as long as it sums up to 1 day. The suffixes are s (second), m (minute), h (hour) and d (day).

Pricing Services

Asset Price - Aggregated VWAP

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/spot_direct_exchange_rate/btc/usd?include_exchanges=cbse,bfnx&sources=true'

Response Example

{
    "query": {
        "page_size": 100,
        "interval": "1d",
        "sort": "desc",
        "base_asset": "btc",
        "quote_asset": "usd",
        "sources": true,
        "ch": true,
        "include_exchanges": [
            "cbse",
            "bfnx"
        ],
        "exclude_exchanges": [],
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2020-05-26T20:09:13.000Z",
        "instruments": [
            "bfnx:spot:btc-usd",
            "cbse:spot:btc-usd"
        ]
    },
    "time": "2020-05-26T20:09:14.277Z",
    "timestamp": 1590523754277,
    "data": [
        {
            "timestamp": 1590451200000,
            "price": "8847.968719074968",
            "volume": "13589.95633007",
            "count": 122143,
            "sources": [
                {
                    "exchange_code": "cbse",
                    "count": 66991,
                    "price": "8848.388264128678",
                    "volume": "10187.26739386"
                },
                {
                    "exchange_code": "bfnx",
                    "count": 55152,
                    "price": "8846.712648441991",
                    "volume": "3402.68893621"
                }
            ]
        },
    /* ... */
],
    "result": "success",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}    

This endpoint generates an aggregated price for an asset pair across all exchanges with spot markets for the pair. Only asset combinations which are actively being traded on one of our covered exchanges are being taken into account for the calculation of the price. Unsupported asset combinations will return no data. To return data used as input for the calculation of the aggregated price, set the sources parameter to true. Setting the sources parameter to false (default) will yield a faster response time. By making use of the sort parameter, data can be returned in ascending asc or descending desc order (default).

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/spot_direct_exchange_rate/{base_asset}/{quote_asset}/{?include_exchanges,exclude_exchanges,start_time,end_time,interval,page_size,sources}

Parameters

Parameter Required Description
base_asset Yes The desired base asset code. See Instruments Reference Data Endpoint.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exclude_exchanges1 No List of exchanges' code to exclude from the calculation. See Instruments Reference Data Endpoint. Only available in API v2.
interval1 No Interval period. Default 1d.
include_exchanges1 No List of exchanges' code to include in the calculation. See Instruments Reference Data Endpoint. Only available in API v2.
page_size1 No See Pagination (min: 1, default: 100, max: 1000).
quote_asset Yes The desired quote asset code. See Instruments Reference Data Endpoint.
start_time1 No Starting time in ISO 8601 (inclusive).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default is asc in API v1, desc in API v2.
sources1 No boolean. If true, returns all prices which were used to calculate aggregated price. Default is false

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.*

This endpoint uses data from CEXs as well as DEXs

Fields

Field Description
timestamp Timestamp at which the interval begins.
price Aggregated VWAP. null when no trades reported.
volume Total volume traded in interval. 0 when no trades reported.
count Total amount of trades reported during interval. 0 when no trades reported.

Robust Pair Price

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/robust_pair_price/btc/eth?interval=1m&extrapolate_missing_values=true&start_time=2023-05-03T00:01:00.000Z&end_time=2023-05-04T00:00:00.000Z'

Response Example

{
    "query": {
        "start_time": "2023-05-03T23:50:00Z",
        "end_time": "2023-05-04T00:00:00Z",
        "base_asset": "btc",
        "quote_asset": "eth",
        "interval": "1m",
        "sort": "desc",
        "sources": false,
        "page_size": 10,
        "include_exchanges": [],
        "exclude_exchanges": [],
        "request_time": "2023-06-06T08:56:42.027624061Z",
        "data_version": "v1",
        "commodity": "trades",
        "extrapolate_missing_values": true,
        "instruments": [
            "bbsp:spot:eth-btc",
            "bfly:spot:eth-btc",
            "bfnx:spot:eth-btc",
            "bfrx:spot:eth-btc",
            "bgon:spot:eth-btc",
            "binc:spot:eth-btc",
            "bnus:spot:eth-btc",
            "cbse:spot:eth-btc",
            "cnex:spot:eth-btc",
            "huob:spot:eth-btc",
            "kcon:spot:eth-btc",
            "krkn:spot:eth-btc",
            "lmax:spot:eth-btc",
            "okex:spot:eth-btc",
            "polo:spot:eth-btc",
            "stmp:spot:eth-btc",
            "yobt:spot:eth-btc"
        ]
    },
    "time": "2023-06-06T08:56:42.146Z",
    "timestamp": 1686041802,
    "data": [
        {
            "timestamp": 1683158340000,
            "price": "15.235541471143884",
            "volume": "47.36280478892731",
            "count": 268,
            "extrapolate_missing_values": false
        },
        {
            "timestamp": 1683158280000,
            "price": "15.22579859313621",
            "volume": "33.41043244089322",
            "count": 194,
            "extrapolate_missing_values": false
        },
        /*...*/
    ],
    "result": "success",
    "continuation_token": "4AvcFTkJCC7UZdZoqmmqJW4ioi54E9jU68TdvhVjZFTSmWHhQ3oGN8hNbeniB2tZdNdFghvU6TqGzMZTHEsnKJGrnmYALAAXNzy6E74RMMc2TJvT6CMs5GPFvFUfrTSswJqEQM7Kk6HAvQtQnSiKf2JRWbdGm7r5tjxc1P4bXNznMxS6BKPqKzgqpqAgoVZRE9LJwxTKK74JGr7uSJS5gJVPRhJYniLsxFK",
    "next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/robust_pair_price/btc/eth?continuation_token=4AvcFTkJCC7UZdZoqmmqJW4ioi54E9jU68TdvhVjZFTSmWHhQ3oGN8hNbeniB2tZdNdFghvU6TqGzMZTHEsnKJGrnmYALAAXNzy6E74RMMc2TJvT6CMs5GPFvFUfrTSswJqEQM7Kk6HAvQtQnSiKf2JRWbdGm7r5tjxc1P4bXNznMxS6BKPqKzgqpqAgoVZRE9LJwxTKK74JGr7uSJS5gJVPRhJYniLsxFK",
    "access": {
        "access_range": {
            "start_timestamp": 1262995200000,
            "end_timestamp": 2186006399000
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

Retrieve Kaiko’s proprietary aggregated price. The new methodology aims to be more resilient and robust to outliers. The computation is based on two principles:

At the end of the algorithm, in case there are still no trades, a null value will be returned.

Setting extrapolate_missing_values parameter to true (false by default) will fill null values with the last available computedΒ price.

Calculation is performed by default over all instruments traded across all exchanges (including CEXs and DEXs) covered by Kaiko.

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/robust_pair_price/{base_asset}/{quote_asset}/{?start_time,end_time,interval,page_size,sort,page_size,include_exchanges,exclude_exchanges,extrapolate_missing_values}

Parameters

Parameter Required Description
base_asset Yes The desired base asset code.
See Instruments Reference Data Endpoint.
quote_asset Yes The desired quote asset code.
See Instruments Reference Data Endpoint.
start_time1 No Starting time in ISO 8601 (inclusive).
end_time1 No Ending time in ISO 8601 (exclusive).
interval1 Yes Interval period. Default 24h.
page_size1 No See Pagination.
Less or equal to 1m interval β†’ Default: 10. Max: 100.
]1m;1h] β†’ Default: 4. Max: 10.
Above 1h β†’ Default: 1. Max: 4.
sort1 No Return the data in ascending (asc) or descending (desc) order. Default is desc.
include_exchanges1 No List of exchanges' code to include in the calculation.
See Instruments Reference Data Endpoint.
exclude_exchanges1 No List of exchanges' code to exclude in the calculation.
See Instruments Reference Data Endpoint
extrapolate_missing_values2 No IfΒ true, reduce the amount of null values by extrapolating with last computed price available.
Suitable for pairs with low liquidity or short calculation intervals.

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.* 2: Some null values can still remain when turning the parameter to true. As this parameter extrapolates with last computed price available, at least one non-null value needs to be present within the queried time window.*

Fields

Field Description
timestamp Timestamp at which the interval begins.
price Aggregated RWM (Robust Weighted Median). null when no trades reported, except if extrapolate_missing_values is true.
volume Total volume in base asset traded in the interval. 0 when no trades are reported, except if extrapolate_missing_values is true.
count Total amount of trades reported during the interval. 0 when no trades are reported, except if extrapolate_missing_values is true.
extrapolate_missing_values true if the value has been extrapolated from the last computed value available, false if not.

Cross Price v1

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/spot_exchange_rate/btc/gbp?sources=true&include_exchanges=cbse,bfnx'

Response Example

{
    "query": {
        "page_size": 100,
        "interval": "1d",
        "sort": "desc",
        "base_asset": "btc",
        "sources": true,
        "ch": true,
        "include_exchanges": [
            "cbse",
            "bfnx"
        ],
        "exclude_exchanges": [],
        "quote_asset": "gbp",
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2021-04-07T17:40:25.708Z",
        "instruments": [
            "bfnx:spot:btc-usd",
            "cbse:spot:btc-usd",
            "bfnx:spot:btc-usdt",
            "bfnx:spot:usdt-usd",
            "oer:usd-gbp"
        ]
    },
    "time": "2021-04-07T17:40:25.829Z",
    "timestamp": 1617817225829,
    "data": [
        {
            "timestamp": 1617753600000,
            "price": "41345.58171835934",
            "sources": {
                "btc-usdt": {
                    "data": [
                        {
                            "exchange_code": "bfnx",
                            "count": 40771.0,
                            "price": "57117.19387654953",
                            "volume": "1710.9980164799917"
                        }
                    ],
                    "price": "57117.19387654953"
                },
                "usdt-usd": {
                    "data": [
                        {
                            "exchange_code": "bfnx",
                            "count": 45284.0,
                            "price": "0.9991284598874877",
                            "volume": "140245332.3178564"
                        }
                    ],
                    "price": "0.9991284598874877"
                }
            }
        }
    /* ... */
],
    "result": "success",
    "access": {
        "access_range": {
            "start_timestamp": null,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

This endpoint returns the price of any asset quoted in a Fiat currency within Open Exchange Rate. The USD price is calculated based on the path of the highest liquidity, with an additional step using forex rates to get the final fiat price. This means that, even though an asset might trade directly against all Open Exchange Rate currencies, the price might still be established by using cross-rates1. In cases where the most liquid path changed over time, this will be taken into account in the calculation of the price for each interval. To have an overview of what data was used to calculate the price, set the sources parameter to true. Setting the sourcesparameter to false (default) will yield a faster response time. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.

1: A cross rate is an intermediary currency pair that does not involve the target quote asset.

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/spot_exchange_rate/{base_asset}/{quote_asset}{?include_exchanges,exclude_exchanges,start_time,end_time,interval,page_size,sources}

Parameters

Parameter Required Description
base_asset Yes The desired base asset code. See Instruments Reference Data Endpoint.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
exclude_exchanges1 No List of exchanges' code to exclude from the calculation. See Instruments Reference Data Endpoint. Only available in API v2.
interval1 No Interval period. Default 1d.
include_exchanges1 No List of exchanges' code to include in the calculation. See Instruments Reference Data Endpoint. Only available in API v2.
outliers_strategy No Either median_perc, modified_zscore or zscore. See the Outlier Management section below.
outliers_min_data No Number of minimum data points needed to trigger the outlier detecton. Default to 4.
outliers_threshold No Threshold to use. Usage depends on the chosen outlier management strategy.
page_size1 No See Pagination (min: 1, default: 100, max: 1000).
quote_asset Yes The desired quote asset code. See Instruments Reference Data Endpoint.
start_time1 No Starting time in ISO 8601 (inclusive).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default is asc
sources1 No boolean. If true, returns all prices which were used to calculate aggregated price. Default is false
extrapolate_missing_values2 No boolean. If true, reduce the amount of null values within the given interval of time for low liquidity pairs. Default is false

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token. 2: Some null values can still remain when turning the parameter to true. As this parameter makes use of extrapolation of previous values, at least one non-null value needs to be present within the queried time window.

Outlier Management

Field Description
median_perc Computes the median of all prices and excludes values that are off a certain % from the median. This is the simplest and most intuitive strategy. As it makes use of the median, it's better suited against extreme outliers. Usage of outliers_threshold: 0.1 for 10%
zscore Computes the Z-score of each data point and excludes the ones for which zscore > outliers_threshold, where outliers_threshold is specified by the user (i.e a good rules of thumb would be a value between 1.5 and 3.5). Z-score signals how many standard deviations away a given observation is from the mean. This strategy is more susceptible to extreme values, as it makes use of the mean. More details here
modified_zscore Similar to zscore but using the median instead of the mean, and the MAD (median absolute deviation) instead of standard deviation. This makes it less susceptible to extreme values. Usage of outliers_threshold: generally between 2 and 4

This endpoint uses data from CEXs as well as DEXs

Fields

Field Description
timestamp Timestamp at which the interval begins.
price Aggregated VWAP. null when no trades reported.
volume Total volume traded in interval. 0 when no trades reported.
count Total amount of trades reported during interval. 0 when no trades reported.

Cross Price v2

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v2/spot_exchange_rate/dash/usd?interval=1m&extrapolate_missing_values=true&start_time=2023-05-03T00:01:00.000Z&end_time=2023-05-04T00:00:00.000Z'

Response Example

{
    "query": {
        "start_time": "2023-05-03T00:01:00Z",
        "end_time": "2023-05-04T00:00:00Z",
        "page_size": 10,
        "base_asset": "dash",
        "quote_asset": "usd",
        "interval": "1m",
        "sort": "desc",
        "sources": false,
        "include_exchanges": [],
        "exclude_exchanges": [],
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2023-06-06T09:04:15.730Z",
        "instruments": [
            "bbsp:spot:btc-usdt",
            "bfnx:spot:btc-usdt",
            "bfrx:spot:btc-usdt",
            "bgon:spot:btc-usdt",
            "binc:spot:btc-usdt",
            "bnus:spot:btc-usdt",
            "cbse:spot:btc-usdt",
            "cnex:spot:btc-usdt",
            "gmni:spot:btc-usdt",
            "huob:spot:btc-usdt",
            "kcon:spot:btc-usdt",
            "krkn:spot:btc-usdt",
            "okex:spot:btc-usdt",
            "polo:spot:btc-usdt",
            "stmp:spot:btc-usdt",
            "bfnx:spot:dash-btc",
            "bfrx:spot:dash-btc",
            "binc:spot:dash-btc",
            "cbse:spot:dash-btc",
            "cnex:spot:dash-btc",
            "yobt:spot:dash-btc",
            "bfnx:spot:usdt-usd",
            "bnus:spot:usdt-usd",
            "cbse:spot:usdt-usd",
            "gmni:spot:usdt-usd",
            "krkn:spot:usdt-usd",
            "stmp:spot:usdt-usd"
        ],
        "start_timestamp": 1683157800000,
        "end_timestamp": 1683158400000,
        "extrapolate_missing_values": true
    },
    "time": "2023-06-06T09:04:15.835Z",
    "timestamp": 1686042255835,
    "data": [
        {
            "timestamp": 1683158340000,
            "price": "49.260669080304275",
            "extrapolated": false
        },
        {
            "timestamp": 1683158280000,
            "price": "49.22761565015768",
            "extrapolated": false
        },
        /*...*/
    ],
    "result": "success",
    "continuation_token": "254BuRUF6KHS52CnLR9D5kynYD2DzyQv7aeohKXnMUjcCbcmmDDQPiSQFGmKBVPMNzX37wfyb8CUCoHWNDyz8Ptv7hugQN5hVzJNBTPnJpj69NCPSoQTnhE65rmeHBx7iFWA3CbA68JxnJtcpAGtQT397Zu3QhAtBAZHcV",
    "next_url": "https://ovh.market-api.kaiko.io/v2/data/trades.v2/spot_exchange_rate_staging/dash/usd?continuation_token=254BuRUF6KHS52CnLR9D5kynYD2DzyQv7aeohKXnMUjcCbcmmDDQPiSQFGmKBVPMNzX37wfyb8CUCoHWNDyz8Ptv7hugQN5hVzJNBTPnJpj69NCPSoQTnhE65rmeHBx7iFWA3CbA68JxnJtcpAGtQT397Zu3QhAtBAZHcV",
    "access": {
        "access_range": {
            "start_timestamp": 1262995200000,
            "end_timestamp": 2186006399000
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}    

Retrieve prices of an asset quoted in any other currency (fiat or crypto) using Kaiko’s optimal liquidity path engine and leveraging on Kaiko’s proprietary methodology aggregated price (derived from a weighted median methodology: full details available here).

For fiat-quoted asset, Open Exchange Rate is used to denominate final prices.

Turning sources to true (false by default) will give price details by cross rates1 used in the liquidity path.

Setting extrapolate_missing_values parameter to true (false by default) will fill null values with the last computedΒ price available.

1: A cross rate is an intermediary currency pair that does not involve the target quote asset.

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/trades.v2/spot_exchange_rate/{base_asset}/{quote_asset}{?include_exchanges,exclude_exchanges,start_time,end_time,interval,page_size,sources}

Parameters

Parameter Required Description
base_asset Yes The desired base asset code. See Instruments Reference Data Endpoint.
quote_asset Yes The data version. (v1, v2 ... or latest)
start_time1 No Start time in ISO 8601 (exclusive).
end_time1 No Ending time in ISO 8601 (exclusive).
interval1 No Interval period. Default 1d.
page_size1 No See Pagination.
Less or equal to 1m interval β†’ Default: 10. Max: 100.
]1m;1h] β†’ Default: 4. Max: 10.
Above 1h β†’ Default: 1. Max: 4.
sort1 No Return the data in ascending (asc) or descending (desc) order. Default is desc.
include_exchanges1 No List of exchanges' code to include in the calculation.
See Instruments Reference Data Endpoint.
exclude_exchanges1 No List of exchanges' code to exclude in the calculation.
See Instruments Reference Data Endpoint.
extrapolate_missing_values2 No IfΒ true, reduce the amount of null values by extrapolating with last computed price available.
Suitable for pairs with low liquidity or short calculation intervals.

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token. 2: Some null values can still remain when turning the parameter to true. As this parameter makes use of extrapolation of previous values, at least one non-null value needs to be present within the queried time window.

Fields

Field Description
timestamp Timestamp at which the interval begins.
price Aggregated RWM (Robust Weighted Median) using liquidity path1 engine. null when no trades reported, except if extrapolate_missing_values is true.
extrapolate_missing_values true if the value has been extrapolated from the last computed value available, false if not.

1: Liquidity path is calculated every 4 hours seeking for the most liquid pairs to convert from base asset to quote asset.

OANDA FX Rates

The OANDA FX Rates endpoint provides auditable, reliable and IFRS compliant FX rates for over 70 forex pairs.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/analytics.v2/oanda_fx_rates?base=eur&page_size=2&sort=desc&interval=1d&quote=jpy'

Response Example

{
    "query": {
        "base": "eur",
        "quote": "jpy",
        "interval": "1d",
        "page_size": "2",
        "sort": "desc",
        "start_time": "null",
        "end_time": "2022-08-31T08:38:25.883Z"
    },
    "time": "2022-08-31T08:38:25.905Z",
    "timestamp": 1661935105,
    "data": [
        {
            "timestamp": 1660780800000,
            "fx_rate": "137.38630485436903"
        },
        {
            "timestamp": 1660694400000,
            "fx_rate": "137.15155641205303"
        }
    ],
    "continuation_token": "4tvMKJPYA6ESWsE7s87P2ujFvr6XRNvegzst2eg1EpdyQEPKWpuNic5XPGrhz47RzbbqC598E3XusLo34Hivgw4sYrrvdmYxL7WQVtebjtYVMUPPd97vqo2VjL22A6cTSNojTQsvHh8T6MPRjuJAMfx5LWyVZQWYyzLrSE",
    "next_url": "https://us.market-api.kaiko.io/v2/data/analytics.v2/oanda_fx_rates?continuation_token=4tvMKJPYA6ESWsE7s87P2ujFvr6XRNvegzst2eg1EpdyQEPKWpuNic5XPGrhz47RzbbqC598E3XusLo34Hivgw4sYrrvdmYxL7WQVtebjtYVMUPPd97vqo2VjL22A6cTSNojTQsvHh8T6MPRjuJAMfx5LWyVZQWYyzLrSE"
}

HTTP request

GET https://us.market-api.kaiko.io/v2/data/analytics.{data_version}/oanda_fx_rates{?start_time,end_time,interval,base,quote,sort,continuation_token}

Parameters

Parameter Required Description
base1 Yes The base fiat currency.
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time1 No Ending time in ISO 8601 (exclusive).
interval1 No Interval period. Default 1h.
page_size1 No See Pagination (min: 1, default: 100, max: 1000).
quote1 Yes The quote fiat currency.
start_time1 No Starting time in ISO 8601 (inclusive).
sort1 No Return the data in ascending (asc) or descending (desc) order. Default desc

1: When paginating, these parameters should only be included in the first request. For subsequent requests, they are encoded in the continuation token.

Fields

Field Description
timestamp Timestamp at which the interval ends.
fx_rate Average fx rate over the interval.

Methodology

For each interval, the resulting fx rate is an average of all available fx rates over that period.

DEX Liquidity Pools

DEX liquidity pool data combines information from two API endpoints: - Mint and Burns: This includes event data related to the addition (mint) and removal (burn) of tokens from a liquidity pool. - Token Reserves: This indicates the amount of each token available for trading in a liquidity pool, identified through its blockchain pool address. A separate endpoint provides this data specifically for Uniswap V3 liquidity pools. This standardized data is accessible for various DEXs on multiple blockchains, as referenced in our instrument explorer. It is available for the entire history of each liquidity pool as well as in real-time.

Mints and Burns

Request Example

curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
  "https://eu.market-api.kaiko.io/v2/data/liquidity.v1/events"

Response Example

{
  "query": {
    "blockchain": "*",
    "exchange": "*",
    "pool_address": "0x7bea39867e4169dbe237d55c8242a8f2fcdcc387",
    "block_number": "*",
    "type": "*",
    "user_addresses": "*",
    "tx_hash": "*",
    "start_time": "2022-04-01 00:00:00 +0000 UTC",
    "end_time": "2022-05-01 00:00:00 +0000 UTC",
    "sort": "descending",
    "pool_contains": "*",
    "page_size": "1000"
  },
  "time": "2022-05-17T14:26:27.274Z",
  "timestamp": 1652797587,
  "data": [
    {
      "blockchain": "ethereum",
      "block_number": 14682526,
      "type": "mint",
      "pool_name": "USDC-WETH-0.010",
      "pool_address": "0x7bea39867e4169dbe237d55c8242a8f2fcdcc387",
      "exchange": "usp3",
      "transaction_hash": "0x02127cbf00c43fff6a1ec381703e66035b975e49f901ade55f1b12652e07b544",
      "log_index": 187,
      "user_address": "0x3cbd83d4a4ee504bf8b78d9c2927a9f22f27cce5",
      "price": 0.0003564194488230487,
      "amounts": [
        {"symbol": "USDC", "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "amount": 31.063585},
        {"symbol": "WETH", "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "amount": 0.5833806413127403}
      ],
      "datetime": 1651280001,
      "metadata": {"lower_ticker": 192600, "upper_ticker": 197000}
    }
    /* ... */
  ],
  "continuation_token": "xxx",
  "next_url": "https://eu.market-api.kaiko.io/v2/data/liquidity.v1/events?continuation_token=xxx"
}

HTTP request

GET https://eu.market-api.kaiko.io/v2/data/liquidity.v1/events

Parameters

Parameter Required Description Example
blockchain No Should be one of the currently supported blockchain. ethereum
protocol No Filter on a currently supported DEX. usp2
pool_address No Pool address related to the liquidity event. Default: all liquidity pools. 0x14de8287adc90f0f95bf567c0707670de52e3813
pool_contains No Mints and burns including the requested token. Default: all available tokens. weth or weth,usdt,usdc
block_number No Block height. 129876
user_addresses No Filter on specific user addresses (comma separated). 0x479bc**
live No Shows the data as soon as the block is validated. (Default: false, in case of block reorganization). true
tx_hash No Filter on a specific transaction hash. 0xe68b84740**
start_block No Starting block height (inclusive). 129870
end_block No Ending block height (inclusive). 130000
start_time No Starting time in ISO 8601 (inclusive). 2022-04-01T00:00:00.000Z
end_time No Ending time in ISO 8601 (inclusive). 2022-05-01T00:00:00.000Z
sort No Returns the data in ascending (asc) or descending (desc) order. Default: desc. asc
type No Event type. By default both burn and mint are shown. burn or mint
page_size1 No See Pagination (min: 1, default: 100, max: 1000).

Fields

Field Description Example
blockchain The blockchain on which the transaction happened. ethereum
block_number The height of the block in which the transaction happened. 129876
type Event type: mint or burn. burn or mint
pool_name Name of the pool as it is written on the blockchain. USDC-WETH-0.001
pool_address Address of the contract of the pool. 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
exchange Code of the DEX. usp3
transaction_hash Transaction hash 0x3d28ec9f35692ee6e9264735cd4f92c48bccda82487144d26ebc12376a418cdc
log_index The log index of the transaction (in base 10) 152
user_address Address that triggered the transaction. 0x479bc00624e58398f4cf59d78884d12fb515790a
price Price of the token at the moment of the event. 0.000358096
amounts Amounts of the tokens See example
datetime Timestamp at which the interval begins. In milliseconds. 1650441900000
metadata Only for Uniswap v3. Upper and lower ticker of the interval on which the liquidity is provided {"lower_ticker": 190650, "upper_ticker": 195610}

Token Reserves

Request Example

curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
  "https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots"

Response Example

{
  "query":
  {
    "blockchain": "*",
    "exchange": "*",
    "pool_address": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
    "start_block": "*",
    "end_block": "*",
    "start_time": "2016-02-02 00:00:00 +0000 UTC",
    "end_time": "2038-04-03 23:59:59 +0000 UTC",
    "sort": "descending",
    "page_size": "1000"
  },
  "time": "2022-05-17T14:33:56.432Z",
  "timestamp": 1652798036,
  "data": [
    {
      "blockchain": "ethereum",
      "block_number": 14737185,
      "pool_name": "3pool",
      "pool_address": "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7",
      "exchange": "curv",
      "transaction_hash": "0x837cf2d72008d6fd01840777f297555e84fa2ecf921e9b18b2431239391cf6fe",
      "amounts": [
        {"symbol": "DAI", "address": "0x6B175474E89094C44Da98b954EedeAC495271d0F", "amount": 844939427.8334135},
        {"symbol": "USDC", "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "amount": 812860376.59691},
        {"symbol": "USDT", "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7", "amount": 1348165795.920551}
      ],
      "datetime": 1652028160
    }
    /* ... */
  ],
  "continuation_token": "xxx",
  "next_url": "https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots?continuation_token=xxx"
}

HTTP request

GET https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots

Parameters

Parameter Required Description Example
blockchain No Should be one of the currently supported blockchain. ethereum
pool_address Yes Pool address. 0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7
live No Shows the data as soon as the block is validated. (Default: false, in case of block reorganization). true
start_block No Starting block height (inclusive). 129870
end_block No Ending block height (inclusive). 130000
start_time No Starting time in ISO 8601 (inclusive). 2022-04-01T00:00:00.000Z
end_time No Ending time in ISO 8601 (inclusive). 2022-05-01T00:00:00.000Z
sort No Returns the data in ascending (asc) or descending (desc) order. Default: desc. asc
page_size1 No See Pagination (min: 1, default: 100, max: 1000). 100

Fields

Field Description Example
blockchain The blockchain on which the transaction happened. ethereum
block_number The height of the block. 129876
pool_name Name of the pool as it is written on the blockchain. 3pool
pool_address Address of the contract of the pool. 0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7
exchange Code of the DEX. curv
amounts Snapshot of the liquidity pool's tokens. See example
datetime Timestamp at which the interval begins. In milliseconds. 1650441900000

Uniswap v3 Token Reserves

Uniswap’s v3 Token Reserves are represented by a distribution of liquidity amongst all possible price levels for a pair of tokens. Each price range is defined by the interval [lower_tick, upper_tick[. This dataset provides the amount of tokens and liquidity made available at each price level. The range of price levels is limited to Β±10% around the current price of each block. The data is provided in a block-by-block granularity.

Request Example

curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
  "https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots/usp3"

Response Example

{
  "query": 
  {
    "blockchain": "*",
    "protocol": "usp3",
    "pool_address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
    "start_block": "*",
    "end_block": "*",
    "start_time": "2022-12-15T00:00:00.000Z",
    "end_time": "2038-04-03T23:59:59.000Z",
    "sort": "descending",
    "page_size": "1",
    "price_range": "0.02"
  },
  "time": "2023-01-10T13:47:17.068Z",
  "timestamp": 1673358437,
  "data": [
    {
      "blockchain": "ethereum",
      "block_number": 16376727,
      "pool_name": "USDC-WETH-0.001",
      "pool_address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
      "current_tick": 204408,
      "current_price": 0.0007531523038978548,
      "datetime": 1673357555,
      "snapshots": [
        {"amount0": 0,
        "amount1": 319.31621601508493,
        "amount": 23497518858492568000,
        "lower_tick": 204210,
        "upper_tick": 204220},
        {"amount0": 0,
        "amount1": 320.5286369101081,
        "amount": 23574947430043783000,
        "lower_tick": 204220,
        "upper_tick": 204230},

        /* ... */

        {"amount0": 341263.63629985636,
        "amount1": 0,
        "amount": 18917367912032326000,
        "lower_tick": 204600,
        "upper_tick": 204610}
      ],
      "exchange": "usp3"
    }
  ],
  "continuation_token": "xxx",
  "next_url": "https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots/usp3?continuation_token=xxx"
}

HTTP request

GET https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots/usp3

Parameters

Parameter Required Description Example
pool_address Yes Pool address. 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
blockchain No Should be one of the currently supported blockchain. ethereum
live No Shows the data as soon as the block is validated. (Default: false, in case of block reorganization). true
start_block No Starting block height (inclusive). 129870
end_block No Ending block height (inclusive). 130000
start_time No Starting time in ISO 8601 (inclusive). 2022-04-01T00:00:00.000Z
end_time No Ending time in ISO 8601 (inclusive). 2022-05-01T00:00:00.000Z
price_range No The interval of price around the current price, in % (min: 0, default: 0.1, max: 0.2). 0.05
page_size1 No See Pagination (min: 1, default: 10, max: 100). 100

Fields

Field Description Example
blockchain The blockchain on which the transaction happened. ethereum
block_number The height of the block. 16028979
pool_name Name of the pool as it is written on the blockchain. USDC-WETH-0.001
pool_address Address of the contract of the pool. 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
current_tick The current tick at this block. -58580
current_price The current price at this block, normalized using the pool’s tokens decimals. 0.0028577887443084
datetime The timestamp of the block. 1669161611000
snapshots The snapshot of the liquidity at each tick of the pool. See below.

Field snapshots details

Field Description Example
amount0 The amount of token0 in the specified tick range, normalized using the token0 decimals. 0
amount1 The amount of token1 in the specified tick range, normalized using the token1 decimals. 26.4381078606
amount The amount of liquidity in the specified tick range. 1.7305248294559624e+23
lower_tick The lower tick of the range. -59580
upper_tick The upper tick of the range. -59520

Methodology

Link to our methodology paper: https://www.kaiko.com/pages/dex-liquidity-pool-data

Lending & Borrowing Protocols

Lending & Borrowing Events

Transactions (borrows, repayments, withdrawals, deposits and liquidations) registered on-chain, for the main L&B protocols.

Request Example

curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
  "https://eu.market-api.kaiko.io/v2/data/lending.v1/events"

Response Example

{
  "query": {
        "blockchain": "*",
        "block_number": "*",
        "asset": "*",
        "user_address": "*",
        "tx_hash": "*",
        "type": "*",
        "start_time": "*",
        "end_time": "*",
        "protocol": "*",
        "sort": "descending",
        "page_size": "1000",
        "start_block": "*",
        "end_block": "*"
    },
    "time": "2022-05-17T14:26:27.274Z",
    "timestamp": 1652797587,
    "data":
    [
        {
            "blockchain": "ethereum",
            "block_number": 16025918,
            "datetime": 1669124591,
            "transaction_hash":"0xa49cfa9c026e728614ca0bdf7272eaaad5b3dd8881fd263ea19ef7d648d9c941",
            "exchange_code": "aave/v2",
            "type": "repayment",
            "user_address": "0x4f381fb46dfde2bc9dcae2d881705749b1ed6e1a",
            "asset_symbol": "crv",
            "asset_address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
            "asset_decimals": 18,
            "receipt_symbol": "acrv",
            "receipt_address": "0x8dae6cb04688c62d939ed9b68d32bc62e49970b1",
            "receipt_decimals": 18,
            "amount": 299894.78,
            "metadata": {
                "borrowRateMode": 2,
                "amountInReceiptAsset": "299894.77",
                "onBehalfOf": "0x4f381fb46dfde2bc9dcae2d881705749b1ed6e1a"
            }
        }
        /* ... */
    ],
    "continuation_token": "xxx",
    "next_url": "https://eu.market-api.kaiko.io/v2/data/lending.v1/events?continuation_token=xxx"
}

HTTP request

GET https://eu.market-api.kaiko.io/v2/data/lending.v1/events

Parameters

Parameter Required Description Example
blockchain No Should be one or several of the currently supported blockchain. ethereum
protocol No Should be one or several of the currently supported L&B protocols. aav1,aav2
user_address No Filter on a specific wallet addresses (comma separated). 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
live No Shows the data as soon as the block is validated. (Default: false, in case of block reorganization). true
tx_hash No Filter on a specific transaction hash. 0xe68b84740**
asset No L&B events including the requested token. Default: all available tokens. weth or weth,usdt,usdc
type No Event type: borrow, deposit, withdraw, repayment or liquidation. borrow,withdraw
block_number No Block height. 10795593
start_block No Starting block height (inclusive). 129870
end_block No Ending block height (inclusive). 130000
start_time No Starting time in ISO 8601 (inclusive). 2022-04-01T00:00:00.000Z
end_time No Ending time in ISO 8601 (inclusive). 2022-05-01T00:00:00.000Z
sort No Returns the data in ascending or descending order. Default: desc. ascending
page_size1 No See Pagination (min: 1, default: 100, max: 1000). 1000

Fields

Field Description Example
blockchain The blockchain on which the transaction happened. ethereum
block_number The height of the block in which the transaction happened. 16025918
datetime The timestamp of the block in which the transaction happened. 1669124591
transaction_hash Transaction hash ---
log_index Log index of the transaction 152
protocol Code of the L&B protocol. aave/v2
type Event type: Borrow, deposit, withdraw, repayment or liquidation. borrow, deposit, etc
user_address Address of the user. 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
asset_symbol Symbol of the underlying asset. crv
asset_address Address of the underlying asset. 0xd533a949740bb3306d119cc777fa900ba034cd52
asset_decimals Decimals of the underlying asset. 18
receipt_symbol Symbol of the receipt asset. acrv
receipt_address Address of the receipt asset. 0x8dae6cb04688c62d939ed9b68d32bc62e49970b1
receipt_decimals Decimals of the receipt asset. 18
amount Amounts of the borrowed token. 299894.78
metadata Metadata linked to the event type and protocol. More information below.

Metadata

Borrow Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
rate Borrow rate (at the event level or at the contract level depending on the protocol). 0.02820253961814756
rate_type Stable (1) or Variable (2) 1 or 2
on_behalf_of The address of user who will incur the debt. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31

Deposit Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
rate Supply rate of the overall lending pool. 0.000203088325657998768898798
on_behalf_of The address that will receive the receipt tokens. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31

Withdraw Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
on_behalf_of The address that will receive the underlying token. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31

Repayment Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
on_behalf_of The address of user who will incur the debt. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31
borrow_rate_mode Stable (1) or Variable (2) 1 or 2

Liquidation Event

Field Description Example
liquidation_debt_asset_symbol Symbol of the debt asset. renfil
liquidation_debt_asset_address Address of the debt asset. 0xd5147bc8e386d91cc5dbe72099dac6c9b99276f5
liquidation_debt_asset_decimals Decimals of the debt asset. 18
liquidation_debt_amount_in_asset Amount of the debt asset. 1899
liquidation_caller_address The address that triggered the liquidation transaction. 0xdfd3bd446f1b7fd96dc995126ee845af0b1254cd
receive_receipt_token The liquidator chooses to receive the collateral's asset (False) or recept token (True). True or False
liquidation_type Debt (1) or Collateral (2) 1

Lending & Borrowing Rates and Liquidity

This endpoint provides information about lending pools. It shows data such as how many tokens has been deposited and borrowed, as well as the interest rates for lending and borrowing at each block.

Request Example

curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
  "https://eu.market-api.kaiko.io/v2/data/lending.v1/snapshots"

Response Example

{
  "query": {
        "block_number": "*",
        "blockchain": "*",
        "asset": "usdt",
        "start_time": "*",
        "end_time": "*",
        "interval": "*",
        "protocol": "aav1",
        "sort": "descending",
        "page_size": "100",
        "start_block": "*",
        "end_block": "*"
    },
    "time": "2023-04-04T14:20:50.387Z",
    "timestamp": 1680618050,
    "data":
    [
        {
            "blockchain": "ethereum",
            "block_number": 16974429,
            "datetime": 1680597815,
            "protocol": "aav1",
            "asset_symbol": "usdt",
            "asset_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "asset_decimals": 6,
            "receipt_symbol": "ausdt",
            "receipt_address": "0x71fc860f7d3a592a4a98740e39db31d25db65ae8",
            "receipt_decimals": 6,
            "total_liquidity": 1486161.683036,
            "available_liquidity": 1279626.811227,
            "total_borrowed": 206534.871809,
            "supply_rate": 0.0028918593043333676,
            "stable_borrow_rate": 0.04426480046626246,
            "variable_borrow_rate": 0.0208089338773062,
            "metadata":
            {
                "total_borrowed_stable": "0",
                "total_borrowed_variable": "206534.871809"
            }
        }
        /* ... */
    ],
    "continuation_token": "xxx",
    "next_url": "https://eu.market-api.kaiko.io/v2/data/lending.v1/snapshots?continuation_token=xxx"
}

HTTP request

GET https://eu.market-api.kaiko.io/v2/data/lending.v1/snapshots

Parameters

Parameter Required Description Example
blockchain No One or several of the currently supported blockchain. Default: ethereum. ethereum
protocol Yes One or several of the currently supported L&B protocols. aav1,aav2
asset Yes L&B events including the requested token. Default: all available tokens. weth or weth,usdt,usdc
live No Shows the data as soon as the block is validated. (Default: false, in case of block reorganization). true
block_number No Block height. 10795593
start_block No Starting block height (inclusive). 129870
end_block No Ending block height (inclusive). 130000
start_time No Starting time in ISO 8601 (inclusive). 2022-04-01T00:00:00.000Z
end_time No Ending time in ISO 8601 (inclusive). 2022-05-01T00:00:00.000Z
interval No Interval between each snapshot. The suffixes are s (second), m (minute), h (hour), d (day), b (block), change (whenever a change happens). Default: 1b. 152s
sort No Returns the data in ascending or descending order. Default: desc. ascending
page_size1 No See Pagination (min: 1, default: 100, max: 1000). 1000

Fields

Field Description Example
blockchain The blockchain on which the transaction happened. ethereum
block_number The height of the block in which the transaction happened. 16025918
datetime The timestamp of the block in which the transaction happened. 1669124591
protocol Code of the L&B protocol. aave/v2
asset_symbol Symbol of the underlying asset. crv
asset_address Address of the underlying asset. 0xd533a949740bb3306d119cc777fa900ba034cd52
asset_decimals Decimals of the underlying asset. 18
receipt_symbol Symbol of the receipt asset. acrv
receipt_address Address of the receipt asset. 0x8dae6cb04688c62d939ed9b68d32bc62e49970b1
receipt_decimals Decimals of the receipt asset. 18
total_liquidity The total amount of liquidity for this pool. 1486160
available_liquidity The total amount of available liquidity for this pool. 1279630
total_borrowed The total amount of tokens borrowed for this pool. 206535
supply_rate The supply rate. 0.00289186
stable_borrow_rate The stable borrow rate. 0.0442648
variable_borrow_rate The variable borrow rate. 0.0208089
metadata Metadata specific to each protocol. { }

Metadata

AAVE v1

Field Description Example
total_borrowed_stable The total amount of assets borrowed with a stable rate for this pool. 0
total_borrowed_variable The total amount of assets borrowed with a variable rate for this pool. 41872.928778

AAVE v2

Field Description Example
total_borrowed_stable The total amount of assets borrowed with a stable rate for this pool. 4162389.524515
total_borrowed_variable The total amount of assets borrowed with a variable rate for this pool. 345075360.304631
total_reserves Total liquidity - All of the debt tokens supply. 51387128.92415

Compound

Field Description Example
total_reserves Total liquidity - All of the debt tokens supply. 3486037.365878

Cream

Field Description Example
total_reserves Total liquidity - All of the debt tokens supply. 033661.402437

Maker

Field Description Example
collateral_ratio Minimum ratio of collateral before liquidation. 1.5
debt_ceiling Maximum amount of DAI that can be emitted on this type of vault. 2500000
debt_floor Minimum amount of DAI that can be minted for this type of Vault. 2000

Portfolio Solutions

Custom Valuation

The Custom Valuation endpoint allows you to build completely customizable single-asset or multi-asset price feeds for NAV calculations, portfolio valuation, asset allocation strategies, and indices.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/trades.v1/valuation?start_time=2021-04-01T16:00:00.000Z&end_time=2021-04-15T16:00:00.000Z&interval=1d&semi_length_window=30m&exchanges=cbse,stmp,bfnx,gmni&bases=btc,ltc,pdot,eth,ada&weights=0.4,0.2,0.1,0.2,0.1&percentages=0.9&quote=usd&sources=true'

Response Example

{
    "query": {
        "start_time": "2021-04-01T16:00:00.000Z",
        "end_time": "2021-04-15T16:00:00.000Z",
        "page_size": 100,
        "interval": "1d",
        "semi_length_window": "30m",
        "exchanges": [
            "cbse",
            "stmp",
            "bfnx",
            "gmni"
        ],
        "sources": false,
        "bases": [
            "btc",
            "ltc",
            "pdot",
            "eth",
            "ada"
        ],
        "weights": [
            "0.4",
            "0.2",
            "0.1",
            "0.2",
            "0.1"
        ],
        "percentages": [
            "0.9",
            "1"
        ],
        "quote": "usd",
        "data_version": "v1",
        "commodity": "trades",
        "request_time": "2021-08-05T15:29:01.797Z",
        "start_timestamp": 1617292800000,
        "end_timestamp": 1618502400000
    },
    "time": "2021-08-05T15:29:02.480Z",
    "timestamp": 1628177342480,
    "data": [
        {
            "datetime": "2021-04-01 16:00:00 UTC",
            "timestamp": 1617292800000,
            "response_by_percentages": [
                {
                    "percentage": 0.9,
                    "price": "100.0",
                    "response_by_pairs": [
                        {
                            "pair": "ada-usd",
                            "contribution": "10.0",
                            "ref_price": "1.1952953546487899",
                            "weight": 0.1
                        },
                        {
                            "pair": "btc-usd",
                            "contribution": "40.0",
                            "ref_price": "58975.26519568538",
                            "weight": 0.4
                        },
                        {
                            "pair": "eth-usd",
                            "contribution": "20.0",
                            "ref_price": "1944.7174052029602",
                            "weight": 0.2
                        },
                        {
                            "pair": "ltc-usd",
                            "contribution": "20.0",
                            "ref_price": "203.41030791068567",
                            "weight": 0.2
                        },
                        {
                            "pair": "pdot-usd",
                            "contribution": "10.000000000000002",
                            "ref_price": "37.88622037567283",
                            "weight": 0.1
                        }
                    ]
                },
                {
                    "percentage": 1.0,
                    "price": "100.0",
                    "response_by_pairs": [
                        {
                            "pair": "ada-usd",
                            "contribution": "10.0",
                            "ref_price": "1.1950047448446344",
                            "weight": 0.1
                        },
                        {
                            "pair": "btc-usd",
                            "contribution": "40.0",
                            "ref_price": "58967.98807937056",
                            "weight": 0.4
                        },
                        {
                            "pair": "eth-usd",
                            "contribution": "20.0",
                            "ref_price": "1945.0143276289953",
                            "weight": 0.2
                        },
                        {
                            "pair": "ltc-usd",
                            "contribution": "20.0",
                            "ref_price": "203.3154778118961",
                            "weight": 0.2
                        },
                        {
                            "pair": "pdot-usd",
                            "contribution": "10.0",
                            "ref_price": "37.88470890631195",
                            "weight": 0.1
                        }
                    ]
                }
            ]
        },
        {
            "datetime": "2021-04-02 16:00:00 UTC",
            "timestamp": 1617379200000,
            "response_by_percentages": [
                {
                    "percentage": 0.9,
                    "price": "102.65406334012563",
                    "response_by_pairs": [
                        {
                            "pair": "ada-usd",
                            "contribution": "10.157886022869157",
                            "ref_price": "1.2141673976187375",
                            "weight": 0.1
                        },
                        {
                            "pair": "btc-usd",
                            "contribution": "40.30999169598325",
                            "ref_price": "59432.31125766219",
                            "weight": 0.4
                        },
                        {
                            "pair": "eth-usd",
                            "contribution": "21.25300137809248",
                            "ref_price": "2066.5540846389476",
                            "weight": 0.2
                        },
                        {
                            "pair": "ltc-usd",
                            "contribution": "20.41100604813737",
                            "ref_price": "207.5904512509245",
                            "weight": 0.2
                        },
                        {
                            "pair": "pdot-usd",
                            "contribution": "10.522178195043386",
                            "ref_price": "39.864556192951305",
                            "weight": 0.1
                        }
                    ]
                },
                {
                    "percentage": 1.0,
                    "price": "102.67165672438934",
                    "response_by_pairs": [
                        {
                            "pair": "ada-usd",
                            "contribution": "10.16399109677373",
                            "ref_price": "1.2146017587203226",
                            "weight": 0.1
                        },
                        {
                            "pair": "btc-usd",
                            "contribution": "40.31602493751589",
                            "ref_price": "59433.871948076085",
                            "weight": 0.4
                        },
                        {
                            "pair": "eth-usd",
                            "contribution": "21.25496657463498",
                            "ref_price": "2067.060726047021",
                            "weight": 0.2
                        },
                        {
                            "pair": "ltc-usd",
                            "contribution": "20.419550174222547",
                            "ref_price": "207.58053001880216",
                            "weight": 0.2
                        },
                        {
                            "pair": "pdot-usd",
                            "contribution": "10.517123941242193",
                            "ref_price": "39.843817904556474",
                            "weight": 0.1
                        }
                    ]
                }
            ]
        },
  /* ... */
],
    "result": "success",
    "continuation_token": "6zEL19kG8ZZehSMyiuQ7Xir9uWneTvkPUAopSsPFZZ89BfGjGprvwjTQxSk1kMuHWE9dW4atmhckBeT1jXvTcUBhqgy4v6wXj3nD1kBqJtfmy1GJjpnNTMcJ5FpnpHYtRRkzPtcFGccnnbNGxmAcQaqyF7hrZFziaqR8CBUcqY9p7Z6mEQkZxmwL5Dc1soKfNvvDfu8JdE5mkZgimxQRx7zVnZG2Xaoz8MfjYA2TjiEjKJZ858dwsCkdWktKee22iBJrNwCX3KGMAvZd1pMYX98w3umATw8SfbqFsZZ1BRZDwRUAaF4sn3tufjKX6RirUUACWeqtfeZp1DWdfKrbXo3hckpMmZC3yVndjvfb5sFHBy73gkoSvJsQTsqnibgoR3dCQQq4cfmX6NWRe4Vucc5Qn6jUjvodqysCRnJjp",
    "next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/valuation?continuation_token=6zEL19kG8ZZehSMyiuQ7Xir9uWneTvkPUAopSsPFZZ89BfGjGprvwjTQxSk1kMuHWE9dW4atmhckBeT1jXvTcUBhqgy4v6wXj3nD1kBqJtfmy1GJjpnNTMcJ5FpnpHYtRRkzPtcFGccnnbNGxmAcQaqyF7hrZFziaqR8CBUcqY9p7Z6mEQkZxmwL5Dc1soKfNvvDfu8JdE5mkZgimxQRx7zVnZG2Xaoz8MfjYA2TjiEjKJZ858dwsCkdWktKee22iBJrNwCX3KGMAvZd1pMYX98w3umATw8SfbqFsZZ1BRZDwRUAaF4sn3tufjKX6RirUUACWeqtfeZp1DWdfKrbXo3hckpMmZC3yVndjvfb5sFHBy73gkoSvJsQTsqnibgoR3dCQQq4cfmX6NWRe4Vucc5Qn6jUjvodqysCRnJjp",
    "access": {
        "access_range": {
            "start_timestamp": 1601251200000,
            "end_timestamp": 1898639999000
        },
        "data_range": {
            "start_timestamp": 1514764800000,
            "end_timestamp": 1893542399000
        }
    }
}

HTTP request

GET https://us.market-api.kaiko.io/v2/data/trades.{data_version}/valuation{?start_time,end_time,interval,semi_length_window,exchanges,bases,quote,weights,percentages,sources,continuation_token}

Parameters

Parameter Required Description
bases Yes List of base components. Min. 1, max. 5
continuation_token No See Pagination.
data_version Yes The data version. (v1, v2 ... or latest)
end_time No Last fixing of the calculation in ISO 8601 (exclusive).
exchanges No List of exchanges to source data from. See Instruments Reference Data Endpoint. Default: all exchanges
interval No Frequency in time unit after the first fixing. Default: 1d.
percentages Yes List of percentages for outlier management. To not enforce any outlier management, use 1
start_time No First fixing of the calculation in ISO 8601 (inclusive).
semi_length_window Yes The time interval to compute the transaction.
sources No boolean. If true, returns all prices and volumes which were used to calculate valuation price. Default: false
quote Yes The fiat pricing currency.
weights Yes Weighting list of base assets. For single-asset price feeds use an asset weighting of β€œ1”

This endpoint uses data from CEXs as well as DEXs

Fields

Field Description
timestamp Timestamp at which the interval begins.
percentage Percent of the price distribution centered around the median price.
price The composite price, with a base of 100.
pair The constituent pair.
contribution The asset contribution to the composite price.
ref_price The reference price per asset.
weight The weight per asset.

Computation and Constraints

Considering the volume of data points processed for the computation of each data point, some parameter constraints have been implemented in order to optimize computation time:

Value at Risk

Daily Value at Risk (VaR) estimator for single and multi-asset portfolios. Computed by a proprietary and thoroughly backtested methodology that accounts for the idiosyncrasies of crypto market structure.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/value_at_risk?bases=eth,btc,ltc&exchanges=krkn,bfnx,cbse&quantities=3,2,5&quote=usd&risk_level=0.95&start_time=2021-12-01T00:00:00.000Z&end_time=2022-01-31T00:00:00.000Z&sources=true'

Response Example


{"query": {
        "bases": "eth,btc,ltc",
        "quote": "usd",
        "quantities": "3,2,5",
        "exchanges": "krkn,bfnx,cbse",
        "risk_level": "0.95",
        "sources": true,
        "data_version": "v2",
        "commodity": "analytics",
        "request_time": "2023-12-04T14:14:34.900Z"
    },
    "time": "2023-12-04T14:15:04.006Z",
    "timestamp": 1701699304006,
    "data": [
        {
            "var_time": 1638316800000,
            "value_at_risk": {
                "value": 7648.7047074783195,
                "risk_level": 0.95
            },
            "additional_vars": [
                {
                    "value": 5216.766810005925,
                    "risk_level": 0.9
                },
                {
                    "value": 7648.7047074783195,
                    "risk_level": 0.95
                },
                {
                    "value": 10695.15881312369,
                    "risk_level": 0.975
                },
                {
                    "value": 11521.662805074642,
                    "risk_level": 0.99
                }
            ]
        },
        {
            "var_time": 1638403200000,
            "value_at_risk": {
                "value": 7608.531141127444,
                "risk_level": 0.95
            },
            "additional_vars": [
                {
                    "value": 5172.594890449372,
                    "risk_level": 0.9
                },
                /*...*/ 
            ]
        },,
    /*...*/ 
    ]
 "sources": {
        "prices": [
            {
                "pair": "btc-usd",
                "prices": [
                    {
                        "ref_price": 19654.5436737572,
                        "date": {
                            "seconds": 1606780800
                        }
                    },
                    /*...*/ 
                ]
            },
            {
                "pair": "eth-usd",
                "prices": [
                    {
                        "ref_price": 614.7309583666058,
                        "date": {
                            "seconds": 1606780800
                        }
                    },
                    /*...*/ 
                ]
            },
            /*...*/ 
        ]
    }
  "quantities": [3, 2, 5],
  "start_date": {"seconds": 1638316800},
  "end_date": {"seconds": 1643587200},
  "risk_level": 0.95,
  "additional_risk_levels": [0.9, 0.95, 0.975, 0.99],
  "decay": 30,
  "bases": ["eth", "btc", "ltc"]}   

HTTP request

GET https://us.market-api.kaiko.io/v2/data/analytics.v2/value_at_risk?bases=eth,btc,ltc&exchanges=krkn,bfnx,cbse&quantities=3,2,5&quote=usd&risk_level=0.95&start_time=2021-12-01T00:00:00.000Z&end_time=2022-01-31T00:00:00.000Z&sources=true

Parameters

Parameter Required Description
bases Yes List of portfolio base components. Min 1, max 5.
quote Yes The fiat currency.
quantities Yes Quantities list of base asset in the portfolio.
risk_level Yes The Value at Risk confidence level. Between 0.90 (included) and 1 (excluded).
start_time Yes First fixing of the calculation in ISO 8601 (inclusive).
end_time Yes Last fixing of the calculation in ISO 8601 (inclusive).
exchanges Yes List of exchanges to source data from. SeeΒ Instruments Reference Data Endpoint
sources No boolean. If true, returns all pair prices which were used to compute the Value at Risk. (Default:Β false)
data_version Yes The data version. (v1, v2 ... or latest)

This endpoint uses data from CEXs as well as DEXs.

Fields

Parameter Description
var_time The time at which the VaR is computed.
value_at_risk Composed of two fields: value and risk_level (the Value at Risk estimator at the specified risk_level.)
additional_vars List of additional VaRs for standard risk levels.
pair The constituent pair. (showing only when sources is set to be true)
ref_price The reference price per asset. (showing only when sources is set to be true)
date The date of the reference price. (showing only when sources is set to be true)

Computation and constraints

Considering the volume of data points processed for the computation of each data point, some parameter constraints have been implemented in order to optimize computation time:

Derivatives Metrics

Derivatives Metrics API endpoint provides derivatives-specific data of futures, options, and perpetual futures. We currently provide historical derivatives data - beginning in July 2020 - updated once per minute. List of 8 supported exchanges are as follows: Binance, BitMEX, Bybit, Delta Exchange, Deribit, Huobi, OKEx, and Kraken (under the name of Crypto Facilities). More to be added soon.

It is comprised of 3 endpoints: reference, risk, and price. The reference endpoint provides details of the contracts, including base asset, quote asset, contract size, contract size unit, listing_timestamp, expiry, strike price, and underlying index. The risk endpoint indicates data that can be used to analyze risks related with derivatives, such as open interest, funidng rates, and option greeks. The price endpoint shows the mark price, index price, and price (last traded price).

Reference

The reference API endpoint provides details of a contract, which is the smallest unit of derivatives trading in most cases. The details include base asset, quote asset, contract size, contract size unit for all the types of derivatives, expiry for futures and options, and strike price for options. You can find a list of instruments using a parameter or several parameters. For example, you can find all the instruments whose base_assets is btc and quote_assets is usdt, if you put btc as an base_assets and usdt as an quote_assets.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/derivatives.v2/reference?exchange=drbt&instrument_class=option&base_assets=btc&page_size=50'

Response Example

{
    "query": {
        "exchange": "drbt",
        "instrument_class": "option",
        "base_assets": [
            "btc"
        ],
        "page_size": "50",
        "data_version": "v2",
        "commodity": "derivatives",
        "request_time": "2022-11-30T15:26:49.66Z"
    },
    "time": "2022-11-30T15:26:55.623Z",
    "timestamp": 1669822015623,
    "data": [
        {
            "exchange": "drbt",
            "instrument_class": "option",
            "instrument": "btc10apr204750c",
            "base": "btc",
            "quote": "usd",
            "contract_size": "1",
            "contract_size_unit": "btc",
            "listing_timestamp": "2020-03-28 03:21:00 UTC",
            "expiry": "2020-04-10 08:00:00 UTC",
            "strike_price": "4750",
            "underlying_index": "SYN.BTC-10APR20"
        },
        /*---*/
    ],
    "result": "success",
    "continuation_token": "VHoT1C16LjCmtrfParGdwd4mVJnV1Qaqx5AMgXWsYawuiw68Qfymdf215NBcg9LzPJNxA9cZsBjB5S8JBHd8Giw2qoFDFvJ1tP3M5",
    "next_url": "https://us.market-api.kaiko.io/v2/data/derivatives.v2/reference?continuation_token=VHoT1C16LjCmtrfParGdwd4mVJnV1Qaqx5AMgXWsYawuiw68Qfymdf215NBcg9LzPJNxA9cZsBjB5S8JBHd8Giw2qoFDFvJ1tP3M5",
    "access": {
        "access_range": {
            "start_timestamp": 1646006400000,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

HTTP request

GET https://<eu|us>.market-api.kaiko.io/v2/data/derivatives.v2/reference

Parameters

Parameter Required Description Example
exchange Yes Should be one of the exchanges currently supported okex
instrument_class Yes future, perpetual-future, or option future
instrument No Instrument code. See Instruments Reference Data Endpoint. ethusd220624, btc*220624, *usdt, btc*may22*
base_assets No For finding the instruments with the certain base asset btc, eth
quote_assets No For finding the instruments with the certain quote asset usd, usdt
option_type No option only. For finding either only the call options or put options C, P
start_time No future & option only. Used to retrieve futures and options that expire after this date and time (inclusive) 2022-06-23T00:01:00.000Z
end_time No future & option only. Used to retrieve futures and options that are listed before this date and time (exclusive) 2022-06-25T23:59:00.000Z
page_size No See Pagination (min: 1, default: 1000, max: 1000) 500

Fields

Field Description Example
exchange The exchange where the specified instrument is being traded okex
instrument_class Shows wether the specified instrument is future, perpetual-future or option future
instrument The specified instrument btcusd220624
base The base asset of the instrument btc
quote The unit in which the instrument is quoted usdt
contract_size Size of the contract 0.01
contract_size_unit Unit in which contract is denominated btc
funding_rate_frequency perpetual-future only. Interval at which the funding rate is paid 8h
listing_timestamp future & option only. The timestamp when a certain option instrument is listed on the exchange 2020-03-28 03:21:00 UTC
expiry future & option only. Expiration date of the contract 2022-06-24 08:00:00 UTC
strike_price option only. The strike price of the contract in USD. 60000
underlying_index option only. Name of the underlying asset SYN.BTC-10APR20

Risk

The risk API endpoint indicates the information that can be used to analyze risks related with derivatives, such as open interest, funding rates, and option greeks. As instrument is a required parameter, the data of a single instrument is returned per query. When interval is greater than 1m (1 minute), the last minutely value is shown as an output. For instance, when interval is 1h, the data for 09:00 timestamp is the data from 09:59 timestamp with interval 1m.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v2/data/derivatives.v2/risk?exchange=okex&instrument_class=perpetual-future&instrument=btc-usdt&page_size=2'

Response Example

{
    "query": {
        "page_size": "2",
        "exchange": "okex",
        "instrument_class": "perpetual-future",
        "instrument": "btc-usdt",
        "sort": "desc",
        "data_version": "v2",
        "commodity": "derivatives",
        "request_time": "2022-04-28T10:17:48.180Z"
    },
    "time": "2022-04-28T10:17:48.698Z",
    "timestamp": 1651141068698,
    "data": [
        {
            "timestamp": 1651141020000,
            "24h_volume": "10428503",
            "open_interest": "1084816",
            "funding_rate": "-0.0001225804461251",
            "predicted_funding_rate": "-0.0000652655998942"
        },
        {
            "timestamp": 1651140960000,
            "24h_volume": "10423219",
            "open_interest": "1086823",
            "funding_rate": "-0.0001225804461251",
            "predicted_funding_rate": "-0.0000654154039082"
        },

    ],

    /* ... */

    "access": {
        "access_range": {
            "start_timestamp": 1646006400,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

HTTP request

GET https://eu.market-api.kaiko.io/v2/data/derivatives.v2/risk

Parameters

Parameter Required Description Example
exchange Yes Should be one of the exchanges currently supported okex
instrument_class Yes future, perpetual-future, or option future
instrument Yes Instrument code. See Instruments Reference Data Endpoint btcusd220624
interval No Interval period (can be one of 1m, 1h, 4h, and 1d). Default 1m 1h
page_size No See Pagination (min: 1, default: 100, max: 1000). 10
sort No Return the data in ascending (asc) or descending (desc) order. Default desc asc
start_time No Starting time in ISO 8601 (inclusive). 2022-04-20T00:03:00.000Z
end_time No Ending time in ISO 8601 (exclusive). 2022-04-20T08:05:00.000Z

Fields

Field Description Example
timestamp Timestamp at which the interval begins. In milliseconds. 1650441900000
24h_volume The volume of the trades executed in the last 24 hours (can be in base_asset, quote_asset or the number of contracts) 5270648
open_interest The total oustanding number of contracts (units in which open interest metrics are quoted vary by exchange) 1127623
funding_rate perpetual-future only. The current funding rate. -0.0000756735759807
predicted_funding_rate perpetual-future only. The predicted funding rate for the next period. -0.0000845044644161
time_to_expiry future & option only. The number of minutes remaining before expiry. 41504
nearby future & option only. The soonest expiring contract with the same base & quote asset on the specified exchange boolean value
quarterly_nearby future & option only. The soonest expiring quarterly contract with the same base & quote asset on the specified exchange boolean value
ask_iv option only. Implied volatility for the best ask. 57.5
bid_iv option only. Implied volatility for the best bid. 65.4
mark_iv option only. The implied volatility for the mark price. 69.42
delta option only. The delta value for the option. 0.8841
gamma option only. The gamma value for the option. 0.00003
rho option only. The rho value for the option. 21.26122
theta option only. The theta value for the option. -26.18193
vega option only. The vega value for the option. 2.36321

Price

The price API endpoint shows the mark price, index price, and price (last traded price). These prices are collected once every minute. As instrument is a required parameter, the data of a single instrument is returned per query. When interval is greater than 1m (1 minute), the last minutely value is shown as an output. For instance, when interval is 1h, the data for 09:00 timestamp is the data from 09:59 timestamp with interval is 1m.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
  'https://eu.market-api.kaiko.io/v2/data/derivatives.v2/price?exchange=okex&instrument_class=perpetual-future&instrument=btc-usdt&page_size=2'

Response Example

{
    "query": {
        "exchange": "okex",
        "instrument_class": "perpetual-future",
        "instrument": "btc-usdt",
        "interval": "1m",
        "page_size": 2,
        "sort": "desc",
        "data_version": "v2",
        "commodity": "derivatives",
        "request_time": "2022-04-28T12:36:34.981Z"
    },
    "time": "2022-04-28T12:36:37.166Z",
    "timestamp": 1651149397166,
    "data": [
        {
            "timestamp": 1651149360000,
            "index_price": null,
            "mark_price": "39707.8",
            "price": "39709.7"
        },
        {
            "timestamp": 1651149300000,
            "index_price": "39713.3",
            "mark_price": "39745.9",
            "price": "39767"
        }
    ],

    /*---*/

    "access": {
        "access_range": {
            "start_timestamp": 1646006400000,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

HTTP request

GET https://eu.market-api.kaiko.io/v2/data/derivatives.v2/price

Parameters

Parameter Required Description Example
exchanges Yes Should be one of the exchanges currently supported okex
instrument_class Yes future, perpetual-future, or option future
instrument Yes Instrument code. See Instruments Reference Data Endpoint btcusd220624
interval No Interval period (can be one of 1m, 1h, 4h, and 1d). Default 1m 1h
page_size No See Pagination (min: 1, default: 100, max: 1000). 10
sort No Return the data in ascending (asc) or descending (desc) order. Default desc asc
start_time No Starting time in ISO 8601 (inclusive). 2022-04-20T00:03:00.000Z
end_time No Ending time in ISO 8601 (exclusive). 2022-04-20T08:05:00.000Z

Fields

Field Description Example
timestamp Timestamp at which the interval begins. In milliseconds. 1650441900000
index_price The price of the underlying index, often as a weighted average across multiple exchanges' spot prices 39713.3
mark_price The mark price of the contract. It is used for calculating profit and loss (PnL) and liquidation price. Designed to be fair and avoid price manipulation. 39745.9
price Most recent traded price of derivative contract 39767

Derivatives Analytics

Implied Volatility Smile

This analytics API suite provides calibrated implied volatilities extracted from options market prices. The implied_volatility_smile endpoint returns a volatility curve for a listed expiry date computed on a set of strike prices. The computation includes space interpolation and allows users to compute consistent volatilities on non-listed strikes. Implied volatilities for non-listed expiries will be coming soon.

Data from Deribit & OKX can be included in the computation of implied volatility.

List of currently supported assets: BTC, ETH. More to be added soon.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile?base=btc&quote=usd&exchanges=drbt&time=2022-09-20T16:15:00.000Z&expiry=2022-12-30T00:00:00.000Z&strikes=10000,15000,20000,40000'

Response Example

{
    "query": {
        "base": "btc",
        "quote": "usd",
        "exchanges": "drbt",
        "time": "2022-11-28T16:15:00.000Z",
        "expiry": "2022-12-30T00:00:00.000Z",
        "data_version": "v2",
        "commodity": "analytics",
        "request_time": "2022-12-06T09:34:30.239Z"
    },
    "time": "2022-11-28T16:15:00.000Z",
    "expiry": "2022-12-30T00:00:00.000Z",
    "time_to_expiry": 0.08679977796739592,
    "implied_volatilities": [
        {
            "strike": 10000,
            "forward_log_moneyness": -0.4776318615692172,
            "implied_volatility": 1.0740308058964807,
            "delta": -0.04769169501102011,
            "gamma": 0.000019523790284227208
        },
        {
            "strike": 20000,
            "forward_log_moneyness": 0.21551531899072807,
            "implied_volatility": 0.5854937657743687,
            "delta": 0.12238690311373696,
            "gamma": 0.00007314557734786866
        },
        {
            "strike": 40000,
            "forward_log_moneyness": 0.9086624995506734,
            "implied_volatility": 0.9088355521899045,
            "delta": 0.0005576514757374973,
            "gamma": 4.567434848993305e-7
        },
        {
            "strike": 15000,
            "forward_log_moneyness": -0.07216675346105281,
            "implied_volatility": 0.6234182556166117,
            "delta": -0.3139268868260898,
            "gamma": 0.00012013816990700113
        }
    ]
}

HTTP request

GET https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile?base=btc&quote=usd&exchange=drbt&time=2022-09-20T16:15:00.000Z&expiry=2022-12-30T00:00:00.000Z&strikes=10000,15000,20000,40000

Parameters

Parameter Required Description Comments Example
base Yes The desired base as the underlying of the options. btc and eth only available for now. btc, eth
quote Yes The desired quote as the underlying of the options. usd only available for now. usd
exchanges No The desired exchange as source of options data. drbt only or drbt,okex available for now. drbt
time Yes The time at which to compute implied volatilities The time t should be smaller than the expiry T 2022-09-20T16:15:00.000Z
expiry Yes The expiry for which the implied volatilities are to be computed - It must be an existing expiry on the selected exchange and tradable at the time of the computation.
- The time to expiry must be higher than 1 full week.
2022-12-30T08:00:00.000Z
strikes Yes, if forward_log_moneynesses parameter is not used. The strike prices for which the implied volatilities are to be computed. Strike prices can be exiting or non existing ones (space interpolation included) Either strikes or forward_log_moneynesses should be filled.

singular: 10000
plural: 10000,15000,20000

forward_log_moneynesses Yes, if strikes is not used. The forward log moneyness for which the implied volatilities are to be computed Either strikes or forward_log_moneynesses should be filled.

singular: 1
plural: 0.5,1,1.5

Fields

Field Description Example
time The time in parameter 2022-09-20T16:15:00.000Z
expiry The expiry in parameter 2022-12-30T00:00:00.000Z
time_to_expiry The associated time to expiry in year 0.27580868156450355
implied_volatilities The list of requested implied volatilities [{"strike": 40000,
"forward_log_moneyness": 0.7348555803648208,
"implied_volatility": 0.7341747093260883,
"delta": 0.04334612697660922,
"gamma": 0.000012437991693543254},
{"strike": 20000,
"forward_log_moneyness": 0.041708399804875465,
"implied_volatility": 0.6670092468551713,
"delta": 0.5223606946028295,
"gamma": 0.00005929353471794603}, ... ]
delta The first derivative of the price with regards to the underlying price 2.8863019124747424e-7
gamma The second derivative of the price with regards to the underlying price 2.416523346501216e-10

Implied Volatility Surface

Retrieve calibrated and interpolated implied volatilities from options market prices. TheΒ implied_volatility_surface endpoint returns a volatility surface for a given list of expiries or time-to-expiries grid and a given set of strike prices or forward log moneyness grid. The computation includes space and time interpolation and allows users to compute consistent volatilities on non-listed strikes and non-listed expiries.

Data from Deribit & OKX can be included in the computation of implied volatility.

List of currently supported assets: BTC, ETH. More to be added soon.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_surface?base=eth&quote=usd&time=2022-06-25T16:00:00.000Z&f_log_m_min=-1.5&f_log_m_max=1.5&f_log_m_step=0.05&expiry_list=2023-03-31T02:00:00.000Z,2022-08-28T08:00:00.000Z,2022-08-30T08:00:00.000Z,2022-09-01T08:00:00.000Z&exchanges=drbt,okex'

Response Example

{
    "query": {
        "base": "eth",
        "quote": "usd",
        "time": "2022-06-25T16:00:00.000Z",
        "data_version": "v2",
        "commodity": "analytics",
        "request_time": "2023-04-06T08:37:04.051Z"
    },
    "time": "2023-04-06T08:37:05.456Z",
    "timestamp": 1680770225456,
    "data": [
        {
            "expiry": "2022-08-28T08:00:00.000Z",
            "time_to_expiry": 0.17442922374429223,
            "strike": 265.88827409960714,
            "forward_log_moneyness": -1.5,
            "implied_volatility": 1.8088997727784055,
            "delta": -0.009058250602524742,
            "gamma": 0.000027152549142705487
        },
        {
            "expiry": "2022-08-28T08:00:00.000Z",
            "time_to_expiry": 0.17442922374429223,
            "strike": 279.52065742622284,
            "forward_log_moneyness": -1.45,
            "implied_volatility": 1.7845929767916238,
            "delta": -0.01022163771763096,
            "gamma": 0.000030587874591936054
        },
        {
            "expiry": "2022-08-28T08:00:00.000Z",
            "time_to_expiry": 0.17442922374429223,
            "strike": 293.85198799221234,
            "forward_log_moneyness": -1.4,
            "implied_volatility": 1.7600100465171926,
            "delta": -0.011539347423429991,
            "gamma": 0.00003446720778881564
        },
        {
            "expiry": "2022-08-28T08:00:00.000Z",
            "time_to_expiry": 0.17442922374429223,
            "strike": 308.91810158884726,
            "forward_log_moneyness": -1.35,
            "implied_volatility": 1.7351444179560156,
            "delta": -0.013032741725007235,
            "gamma": 0.00003884923744431701
        },
        {
            "expiry": "2022-08-28T08:00:00.000Z",
            "time_to_expiry": 0.17442922374429223,
            "strike": 324.7566713477074,
            "forward_log_moneyness": -1.3,
            "implied_volatility": 1.7099896053160146,
            "delta": -0.01472630482905779,
            "gamma": 0.000043800533412823644
        },
        {
            "expiry": "2022-08-28T08:00:00.000Z",
            "time_to_expiry": 0.17442922374429223,
            "strike": 341.4073019431325,
            "forward_log_moneyness": -1.25,
            "implied_volatility": 1.6845392816389113,
            "delta": -0.016648129709696202,
            "gamma": 0.00004939658874760391
        },
        /* ... */
    ]
}

HTTP request

GET https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_surface?base=eth&quote=usd&time=2022-06-25T16:00:00.000Z&f_log_m_min=-1.5&f_log_m_max=1.5&f_log_m_step=0.05&expiry_list=2023-03-31T02:00:00.000Z,2022-08-28T08:00:00.000Z,2022-08-30T08:00:00.000Z,2022-09-01T08:00:00.000Z&exchange=drbt,okex

Parameters

Parameter Required Description Comments Example
base Yes The desired base as the underlying of the options. btc and eth only available for now. btc, eth
quote Yes The desired quote as the underlying of the options. usd only available for now. usd
exchanges Yes The desired exchange as source of options data. drbt only or drbt,okex available for now. drbt
time Yes The time at which to compute implied volatilities The time t should be smaller than the lowest requested expiry. 2022-06-25T16:00:00.000Z
expiry_list Yes, if the set of parameters (tte_min, tte_max, tte_step) is not used. The expiries for which the implied volatilities are to be computed. Expiries can be listed or non-listed ones. - Expiries must be between minimum and maximum listed maturities on exchanges.
- Either expiry_list orΒ (tte_min, tte_max, tte_step) should be filled.
expiry_list=2022-08-28T08:00:00.000Z, 2022-08-30T08:00:00.000Z
or tte_min=0.034288&tte_max=1&tte_step=0.02
tte_min Yes, if expiry_list is not used. To be used along with tte_max, tte_step. Minimum time-to-expiry on the time grid. - Strictly positive value allowed.
- EitherΒ expiry_list orΒ (tte_min, tte_max, tte_step) should be filled.
0.034288
tte_max Yes, if expiry_list is not used. To be used along with tte_min, tte_step. Maximum time-to-expiry on the time grid. - Maximum value is the highest time-to-maturities listed on exchanges.
- EitherΒ expiry_list orΒ (tte_min, tte_max,tte_step) should be filled.
1
tte_step Yes, if expiry_list is not used. To be used along with tte_min, tte_max. Step between two time-to-expiries in time grid. - Strictly positive value allowed.
EitherΒ expiry_list orΒ (tte_min, tte_max, tte_step) should be filled.
0.02
strike_list Yes, if the set of parameters (f_log_min, f_log_max, f_log_step) is not used. The strike prices for which the implied volatilities are to be computed. Strike prices can be listed or non-listed ones. - Strictly positives values allowed.
- EitherΒ strike_list orΒ (f_log_m_min, f_log_m_max, f_log_m_step) should be filled.
strike_list=25000, 29150, 29155, 29160
or f_log_m_min=-1.5&f_log_m_max=1.5&f_log_m_step=0.05
f_log_m_min Yes, if strike_list is not used. To be used along with f_log_m_max, f_log_m_step. Minimum forward log-moneyness on the space grid. EitherΒ strike_list orΒ (f_log_m_min, f_log_m_max, f_log_m_step) should be filled. -1.5
f_log_m_max Yes, if strike_list is not used. To be used along with f_log_m_min, f_log_m_step. Maximum forward log-moneyness on the space grid. EitherΒ strike_list orΒ (f_log_m_min, f_log_m_max, f_log_m_step) should be filled. 1
f_log_m_step Yes, if strike_list is not used. To be used along with f_log_m_min, f_log_m_max. Step between two forward log moneyness in space grid. EitherΒ strike_list orΒ (f_log_m_min, f_log_m_max, f_log_m_step) should be filled. 0.02

Fields

Below information will be returned for each couple of strike/forward log-moneyness and expiry/time-to-expiry :

Field Description Example
time The time in parameter 2022-06-25T16:00:00Z
expiry The expiry at which the IV has been interpolated. 2022-08-28T08:00:00Z
time_to_expiry The associated time-to-expiry (in year). 0.17442922374429223
strike The strike at which the IV has been computed. 265.88827409960714
forward_log_moneyness The associated forward log-moneyness. -1.5
implied_volatility The calibrated and interpolated implied volatilities. 1.8088997727784055
delta The first derivative of the price with regards to the underlying price -0.009058250602524742
gamma The second derivative of the price with regards to the underlying price 0.000027152549142705487

Market & Asset Analytics

Asset Metrics

Retrieve off-chain and on-chain metrics that help performing asset analysis. Data is aggregated across all instruments trading the given asset (See Instruments Reference Data Endpoint).

Trading activity includes total volume (in USD and asset unit), total trade count, total CeX volume (in USD and asset unit), total CeX trade count, total DeX volume (in USD and asset unit), and total DeX trade count and detailed information by exchange. Trades data is aggregated accross all instruments including the token as base or quote asset.

Liquidity information includes total buy market depth (CeX only) for several price deviations (from 0.1% to 10%), total sell market depth (CeX only) for several price deviations (from 0.1% to 10%) and detailed information by exchange. Liquidity data is aggregated accross all instruments including the token as base asset only. Market Depth for DeXs available soon.

Token’s information include token’s address, total supply, number of holders (addresses), main holders (who owns more than 1% of the total supply). Only available for some ERC-20 tokens (new tokens can be added on demand).

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/asset_metrics?interval=1d&asset=agix&start_time=2023-01-25T00:00:00.000Z&end_time=2023-01-26T00:00:00.000Z&page_size=100&sources=true'

Response Example

{
    "data": [
        {
            "timestamp": "2023-01-25T00:00:00.000Z",
            "price": 0.1699233217119519,
            "total_volume_usd": 30508181.43789653,
            "total_volume_asset": 179540872.49784896,
            "total_trade_count": 159684,
            "off_chain_liquidity_data": {
                "total_off_chain_volume_usd": 30038710.382665947,
                "total_off_chain_volume_asset": 176778031.87949985,
                "total_off_chain_trade_count": 159115,
                "trade_data": [
                    {
                        "exchange": "binc",
                        "volume_usd": 27539301.29722444,
                        "volume_asset": 162068991,
                        "trade_count": 125188
                    },
                    /* ... */
                ],
                "buy_market_depths": [
                    {
                        "exchange": "binc",
                        "volume_assets": {
                            /* ... */
                        },
                        "volume_usds": {
                            /* ... */
                        }
                    }, 
                    /* ... */
                ],
                "sell_market_depths": [
                    {
                        "exchange": "binc",
                        "volume_assets": {
                           /* ... */
                        },
                        "volume_usds": {
                           /* ... */
                        }
                    }, 
                    /* ... */
                ],
                "total_buy_market_depth": {
                    "volume_assets": {
                       /* ... */
                    },
                    "volume_usds": {
                       /* ... */
                    }
                },
                "total_sell_market_depth": {
                    "volume_assets": {
                       /* ... */
                    },
                    "volume_usds": {
                       /* ... */
                    }
                }
            },
            "on_chain_liquidity_data": {
                "total_on_chain_volume_usd": 2762840.6183491,
                "total_on_chain_volume_asset": 2762840.6183491,
                "total_on_chain_trade_count": 569,
                "trades_data": [
                    {
                        "exchange": "usp2",
                        "volume_usd": 327680.4492221988,
                        "volume_asset": 1928401.8575017697,
                        "trade_count": 448
                    },
                    /* ... */
                ],
                "token_information": [
                    {
                        "blockchain": "ethereum",
                        "token_address": "0x5B7533812759B45C2B44C19e320ba2cD2681b542",
                        "nb_of_holders": 38231,
                        "main_holders": [
                            {
                                "address": "0xf977814e90da44bfa03b6295a0616a897441acec",
                                "amount": 250774980,
                                "percentage": 22.61839
                            },
                            {
                                "address": "0x13e1367a455c45aa736d7ff2c5656ba2bd05ad46",
                                "amount": 112149660,
                                "percentage": 10.11522
                            }, 
                            /* ... */
                        ],
                        "total_supply": 1108721700
                    }
                ]
            }
        }
    ]
}

HTTP request

GET https://us.market-api.kaiko.io/v2/data/analytics.v2/asset_metrics?interval=1d&asset=agix&start_time=2023-01-25T00:00:00.000Z&end_time=2023-01-26T00:00:00.000Z&page_size=100

Parameters

Parameter Required Description Comments Example
asset Yes The desired asset code. See Instruments Reference Data Endpoint. agix
start_time Yes Starting time in ISO 8601 (inclusive). 2023-01-25T00:00:00.000Z
end_time Yes Ending time in ISO 8601 (exclusive). 2023-01-26T00:00:00.000Z
interval Yes The interval at which we want information 1h (available intervals: 1h/1d) 1h
sources No boolean. If true, returns trading information and market depths detailed by exchanges as well as main holders. (Default:Β false)
page_size No See Pagination (min: 1, default: 10, max: 100). Default: 10 100

Fields

Field Category Description Example
timestamp Trading activity Timestamp at which the interval begins. 2023-01-25T00:00:00.000Z
price Trading activity Average price in usd.Β nullΒ when no trades are reported. 0.1699233217119519
total_volume_usd Trading activity Total volume in usd traded in the interval.Β 0Β when no trades are reported. 30508181.43789653
total_volume_asset Trading activity Total volume in number of assets traded in the interval.Β 0Β when no trades are reported. 179540872.49784896
total_trade_count Trading activity The total amount of trades reported during the interval.Β 0Β when no trades are reported. 159684
total_off_chain_volume_usd Trading activity Total off-chain volume in usd traded in the interval.Β 0Β when no trades are reported. 30038710.382665947
total_off_chain_volume_asset Trading activity Total off-chain volume in number of assets traded in the interval.Β 0Β when no trades are reported. 176778031.87949985
total_off_chain_trade_count Trading activity The total amount of trades reported off-chain during the interval.Β 0Β when no trades are reported. 159115
trades_data Trading activity List of volume in usd, volume in number of assets and total amount of trades by centralized exchange. [{"exchange": "binc",
"volume_usd": 27539301.29722444,
"volume_asset": 162068991,
"trade_count": 125188}, ...]
total_on_chain_volume_usd Trading activity Total on-chain volume in usd traded in the interval.Β 0Β when no trades are reported. 1036710779.1918713
total_on_chain_volume_asset Trading activity Total on-chain volume in number of assets traded in the interval.Β 0Β when no trades are reported. 1036710779.1918713
total_on_chain_trade_count Trading activity The total amount of trades reported on-chain during the interval.Β 0Β when no trades are reported. 20513
trades_data Trading activity List of volume in usd, volume in number of assets and total amount of trades by decentralized exchange. [{'exchange': 'blc2',
'volume_usd': 673716.6525764248,
'volume_asset': 674153.2032810001,
'trade_count': 129}, ...]
market_depth Liquidity information Dictionary from 0.1% to 10% market depth. Base asset aggregation only.
blockchain Token information Blockchain name. ethereum
token_address Token information Token address. 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
number_of_holders Token information Total amount of holders. 1622286
main_holders Token information List of addesses holding at least 1% of the total supply and the amounts of tokens. [{'address': '0x0a59649758aa4d66e25f08dd01271e891fe52199',
'amount': 3262712000,
'percentage': 7.91745}, ...]
total_supply Token information Blockchain total supply. 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

Exchange Metrics

Retrieve off-chain and on-chain metrics that help performing exchange analysis. Data is aggregated across all instruments trading on given exchange (See Exchanges Reference Data Endpoint).

Trading activity includes data such as total volume in USD, total trade count, number of listed assets, number of listed pairs, trade count by asset, total volume in USD by asset, volume proportion over exchange per asset. Switching sources to true will display trade count by pair, total volume in USD by pair and volume proportion over asset per pair.

Only base assets are taken into account in computations.

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/exchange_metrics?exchange=cbse&sort=desc&sources=true&start_time=2023-11-29T14:00:00.0000000Z&end_time=2023-11-29T15:00:00.0000000Z&interval=1h&page_size=100'

Response Example

{
    "data": [
        {
            "timestamp": "2023-11-29T14:00:00.000Z",
            "total_volume_usd": 139803179.89191553,
            "total_trade_count": 121748,
            "nb_listed_assets": 235,
            "nb_listed_pairs": 379,
            "assets_volumes": [
                {
                  "asset_code": "btc",
                  "asset_trade_count": 22772,
                  "asset_total_volume_usd": 61612344.01769975,
                  "asset_price_usd": 37994.62623807689,
                  "asset_contribution": 0.4407077440250888,
                  "pairs_volumes": [
                        {
                          "pair_code": "btc-usd",
                          "pair_trade_count": 19193,
                          "pair_volume_usd": 57484171.99063697,
                          "pair_contribution": 0.9329976469345679
                        },
                        {
                          "pair_code": "btc-eur",
                          "pair_trade_count": 1686,
                          "pair_volume_usd": 1722929.4947314486,
                          "pair_contribution": 0.027964030945430225
                        },
                        {
                          "pair_code": "btc-usdt",
                          "pair_trade_count": 807,
                          "pair_volume_usd": 1590807.5262940996,
                          "pair_contribution": 0.02581962351305931
                        },
                        {
                          "pair_code": "btc-gbp",
                          "pair_trade_count": 1086,
                          "pair_volume_usd": 814435.0060372388,
                          "pair_contribution": 0.013218698606942646
                        }
                    ]
                },
              /* ... */
            ]
        },
        /* ... */
    ]  
}

HTTP request

GET https://us.market-api.kaiko.io/v2/data/analytics.v2/exchange_metrics?exchange=cbse&sort=desc&sources=true&start_time=2023-11-29T14:00:00.0000000Z&end_time=2023-11-29T15:00:00.0000000Z&interval=1h&page_size=100

Parameters

Parameter Required Description Comments Example
exchange Yes The desired exchange code. See Exchange Reference Data Endpoint. cbse
start_time Yes Starting time in ISO 8601 (inclusive). First time at which we want to have exchange metrics. 2023-11-29T14:00:00.0000000Z
end_time Yes Ending time in ISO 8601 (exclusive). Last time at which we want to have exchange metrics. 2023-11-29T15:00:00.0000000Z
interval Yes The interval at which we want information. 1h (available intervals: 1h/1d) 1h
sources No If true, returns trading information detailed by pair. (Default:Β false)
page_size No See Pagination (min: 1, default: 10, max: 100). Default: 10 100
sort No If asc, sort time-series in ascending. If desc, sort time-series in descending. Default: desc 100

Fields

Field Category Description Example
timestamp Trading activity Timestamp at which the interval begins. 2023-11-29T14:00:00.000Z
total_volume_usd Trading activity Total volume in USD traded in the interval.Β 0Β when no trades are reported. 139803179.89191553
total_trade_count Trading activity Total trade count in the interval.Β 0Β when no trades are reported. 121748
nb_listed_assets Trading activity Number of listed assets in the interval.Β 0Β when no trades are reported. 235
nb_listed_pairs Trading activity Number of listed pairs in the interval.Β 0Β when no trades are reported. 379
asset_volumes Trading activity Trading information details by asset. [{"asset_code": "btc",
"asset_trade_count": 22772,
"asset_total_volume_usd": 61612344.01769975,
"asset_price_usd": 37994.62623807689,
"asset_contribution": 0.4407077440250888,
"pairs_volumes": []]}, ...]
asset_code Trading activity Asset code. btc
asset_trade_count Trading activity Trade count in the interval by asset.Β 0Β when no trades are reported. 159115
asset_total_volume_usd Trading activity Volume in USD traded in the interval by asset.Β 0Β when no trades are reported. 61612344.01769975
asset_price_usd Trading activity Asset cross-price in USD used to compute volume in USD. 37994.62623807689
asset_contribution Trading activity Asset volume percentage over total volume. 0.4407077440250888
pairs_volumes Trading activity Trading information details by pair. [{"pair_code": "btc-usd",
"pair_trade_count": 19193,
"pair_volume_usd": 57484171.99063697,
"pair_contribution": 0.9329976469345679}, ...]
pair_code Trading activity Pair code. btc-usd
pair_trade_count Trading activity Trade count in the interval by pair.Β 0Β when no trades are reported. 1686
pair_volume_usd Trading activity Volume in USD traded in the interval by pair.Β 0Β when no trades are reported. 57484171.99063697
pair_contribution Trading activity Pair volume percentage over asset volume. 0.9329976469345679

Indices Data API

Replication data

Rates Replication data offers the ability to accurately reconstruct and replicate the price of an asset at any given time. It achieves this by providing access to all the underlying trades included in the calculation window for each publication.

Rates Replication Data covers any live rate through two distribution channels:

Request Example

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v1/data/index_replication.v1/rates?sequence_id=cnb0k3vvavm8ib6863qg&sort=desc'

Response Example

{
    "query":
    {
        "time": "2024-02-21T14:34:55.000Z",
        "request_time": "2024-02-21T14:35:26.750Z",
        "sequence_id":
        [
            "cnb0k3vvavm8ib6863qg"
        ],
        "sort": "desc",
        "commodity": "trades",
        "data_version": "v1"
    },
    "time": "2024-02-21T14:35:26.750Z",
    "timestamp": 1708526126750,
    "data":
    [
        {
            "index_code": "KK_PR_BTCUSD",
            "index_type": "SIC_REAL_TIME",
            "sequence_id": "cnb0k3vvavm8ib6863qg",
            "underlying_data":
            [
                "https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
                "https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/cbse/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
                "https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/krkn/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
                "https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/lmax/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
                "https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/stmp/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z"
            ]
        }
    ],
    "result": "success",
    "continuation_token": "",
    "next_url": "",
    "access":
    {
        "access_range":
        {
            "start_timestamp": 1262995200000,
            "end_timestamp": 2186006399000
        },
        "data_range":
        {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

HTTP request

GET https://us.market-api.kaiko.io/v1/data/index_replication.v1/rates?sequence_id=cnb0k3vvavm8ib6863qg&sort=desc"

Parameters

Parameter Required Description Comments Example
sequence_id Yes List of publication ID to explore. A publication is defined by event occurring on a specific instrument at a given point in time. Publication IDs can be retrieved from publication stream response. cmrqt2dugrtbh9jbhlk0,cmt40b74tfbpmrtbk180
sort No If asc, sort time-series in ascending. If desc, sort time-series in descending. asc
page_size No See Pagination (min: 1, default: 100, max: 100). 100

Fields

Field Description Example
index_code Ticker identifying the rate. KK_PR_BTCUSD
index_type Type of publication: real-time or fixings. SIC_REAL_TIME
sequenceID The publication ID to explore. A publication is defined by event occurring on a specific instrument at a given point in time. Publication IDs can be retrieved from publication stream response. cnb0k3vvavm8ib6863qg
underlying_data List of linksΒ to specific pre-filtered queries on the REST API trades endpoint for the selected SequenceID. [
"https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
"https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/cbse/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
"https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/krkn/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
"https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/lmax/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z",
"https://us.market-api.kaiko.io/v1/data/trades.v1/exchanges/stmp/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863Z"
]

CSV Files

Trade data

A CSV file of tick-by-tick trades.

File Structure Details

Column Description Example
id Unique trade ID (unique to the exchange). In case the exchange does not provide an ID, we generate it ourselves. 1661990400274591751
exchange Kaiko legacy slug for an exchange bw
symbol Data feed code in lower case btcusd_perp
date The timestamp provided by the exchange in Unix Timestamp (in milliseconds) 1676246400344
price Executed price 21779.5
amount Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts). 402
sell See Taker Side Sell true

Order Book Snapshots (Raw)

A CSV file of Order Book Snapshots: Raw.

File Structure Details

Column Description Example
date The timestamp when we send the REST API requests to exchanges in Unix Timestamp (in milliseconds) 1676246400344
type Type(side) of the limit orders on the orderbook snapshot. a: ask. b: bid. a
price Quoted price 21779.5
amount Amount of limit orders at the specific price (can be in base_asset, quote_asset or the number of contracts). 402

Tick-Level Order Book

CSV tick by tick full order book files are designed for institutional clients engaged in strategy backtesting and quantitative modeling, with a precision level that order book snapshots cannot provide. All data is normalized and the exchange format is independent making file integration quick and easy. The data includes all necessary information to rebuild an exchange order book for a given instrument:

File Structure Details

Column Description Example
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 List of [ask price, volume] [[20103,0],[20207,0],[20057,1.00111351]]
bids List of [bid price, volume] [[19584,0],[19904,21.9973]]

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.
  3. 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.
  4. If the prices in the updates do not exist in the locally managed order book, insert that price level in the order book.
  5. 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.

Top of Book

A CSV file of tick-level updates of the best bid and best ask on an order book (quotes).

File Structure Details

Column Description Example
ts_exchange Timestamp when the exchanges send the data. In the epoch format. 1661990400274591751
ts_collection Timestamp when we collect the data. In the epoch format. 1661990400274591751
exchange Exchange code. See Exchanges Reference Data Endpoint binc
class The instrument class of the instrument 1676246400344
symbol Kaiko identifier for the instrument 21779.5
type a stands for ask, while b stands for bid. Tells which side has an update on price or size a
price Price displayed in quote currency 20289.2
size Limit order size of the quotes 0.8

Derivatives Metrics

A CSV file of derivatives metrics, with the data from Risk and Price endpoints.

File Structure Details

Column Description Example
timestamp The starting timestamp of the time interval, expressed in Unix Timestamp (in seconds) 1685405460
24h_volume The volume of the trades executed in the last 24 hours (can be in base_asset, quote_asset or the number of contracts) 1849370
ask The price of the best ask within one minute interval 0.4941
bid The price of the best bid within one minute interval 0.4940
ask_amount The amount of the best ask, associated with the best ask price.
bid_amount The amount of the best bid, associated with the best bid price.
funding_rate perpetual-future only. The current funding rate. 0.00020546
mark_price The mark price of the contract. It is used for calculating profit and loss (PnL) and liquidation price. Designed to be fair and avoid price manipulation. 39713.5
predicted_funding_rate perpetual-future only. The predicted funding rate for the next period. 0.00010447
price Most recent traded price of derivative contract 39767
index_price The price of the underlying index, often as a weighted average across multiple exchanges' spot prices 39745.9

OHLCV candles

A CSV file of OHLCV candles.

File Structure Details

Column Description Example
timestamp The starting timestamp of the time interval, expressed in Unix Timestamp (in milliseconds) 1672531200000
open The opening price of a candle 0.4935
high The highest price of a candle 0.4941
low The lowest price of a candle 0.4930
close The closing price of a candle 0.4937
volume The volume of the trades executed within the time interval of a candle (can be in base_asset, quote_asset or the number of contracts) 86092.08

VWAP

A CSV file of VWAP.

File Structure Details

Column Description Example
timestamp The starting timestamp of the time interval, expressed in Unix Timestamp (in milliseconds) 1672531200000
vwap The volume weighted price during the time interval. null when no trades reported. 0.4935

Count-OHLCV-VWAP

A CSV file of Count-OHLCV-VWAP.

File Structure Details

Column Description Example
timestamp The starting timestamp of the time interval, expressed in Unix Timestamp (in milliseconds) 1672531200000
count Then number of trades. 0 when no trades reported. 321
open Opening price of interval. null when no trades reported. 0.4935
high Highest price during interval. null when no trades reported. 0.4951
low Lowest price during interval. null when no trades reported. 0.4911
close Closing price of interval. null when no trades reported. 0.4939
volume Volume traded in interval. 0 when no trades reported. 62.32
vwap The volume weighted price during the time interval. null when no trades reported. 0.4945

DEX Mints and Burns

File Structure Details

Field Description Example
block_number The height of the block. 16028979
timestamp The timestamp of the block. 1669161611000
datetime 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 liquidity of each token, separated by a semi-colon. 4.3800141550673e+07;28449.56266562047

DEX Token Reserves

File Structure Details

Field Description Example
block_number The height of the block. 16028979
timestamp The timestamp of the block. 1669161611000
datetime The date equivalent. 2023-02-12T00:00:11Z
pool_name Name of the pool as it is written on the blockchain. USDC-WETH
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 liquidity of each token, separated by a semi-colon. 4.3800141550673e+07;28449.56266562047

Uniswap v3 Token Reserves

Uniswap’s v3 token reserves are represented by a distribution of liquidity amongst all possible price levels for a pair of tokens. Each price range is defined by the interval [lower_tick, upper_tick[. This dataset provides the amount of tokens and liquidity made available at each price level. The range of price levels is limited to Β±10% around the current price of each block. The data is provided in a block-by-block granularity.

File Structure Details

Field Description Example
block_number The height of the block. 16028979
timestamp The timestamp of the block. 1669161611000
lower_tick The lower tick of the range. -59580
upper_tick The upper tick of the range. -59520
current_price The current price at this block, normalized using the pool’s tokens decimals. 0.0028577887443084
current_tick The current tick at this block. -58580
amount The amount of liquidity in the specified tick range. 1.7305248294559624e+23
amount0 The amount of token0 in the specified tick range, normalized using the token0 decimals. 0
amount1 The amount of token1 in the specified tick range, normalized using the token1 decimals. 26.4381078606

Lending and Borrowing Protocols Events

File Structure Details

Field Description Example
blockchain The blockchain on which the transaction happened. ethereum
protocol Code of the L&B protocol. aave/v2
block_number The height of the block in which the transaction happened. 16025918
datetime The timestamp of the block in which the transaction happened. 1669124591
transaction_hash Transaction hash ---
log_index Log index of the transaction 152
type Event type: Borrow, deposit, withdraw, repayment or liquidation. borrow, deposit, etc
user_address Address of the user. 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
asset_symbol Symbol of the underlying asset. crv
asset_address Address of the underlying asset. 0xd533a949740bb3306d119cc777fa900ba034cd52
asset_decimals Decimals of the underlying asset. 18
receipt_symbol Symbol of the receipt asset. acrv
receipt_address Address of the receipt asset. 0x8dae6cb04688c62d939ed9b68d32bc62e49970b1
receipt_decimals Decimals of the receipt asset. 18
amount Amounts of the borrowed token. 299894.78

As well as the following fields specific to each event type:

Borrow Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
rate Borrow rate (at the event level or at the contract level depending on the protocol). 0.02820253961814756
rate_type Stable (1) or Variable (2) 1 or 2
on_behalf_of The address of user who will incur the debt. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31

Deposit Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
rate Supply rate of the overall lending pool. 0.000203088325657998768898798
on_behalf_of The address that will receive the receipt tokens. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31

Withdraw Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
on_behalf_of The address that will receive the underlying token. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31

Repayment Event

Field Description Example
amount_receipt Amounts of the receipt token. 299899
on_behalf_of The address of user who will incur the debt. 0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31
borrow_rate_mode Stable (1) or Variable (2) 1 or 2

Liquidation Event

Field Description Example
liquidation_debt_asset_symbol Symbol of the debt asset. renfil
liquidation_debt_asset_address Address of the debt asset. 0xd5147bc8e386d91cc5dbe72099dac6c9b99276f5
liquidation_debt_asset_decimals Decimals of the debt asset. 18
liquidation_debt_amount_in_asset Amount of the debt asset. 1899
liquidation_caller_address The address that triggered the liquidation transaction. 0xdfd3bd446f1b7fd96dc995126ee845af0b1254cd
receive_receipt_token The liquidator chooses to receive the collateral's asset (False) or recept token (True). True or False
liquidation_type Debt (1) or Collateral (2) 1

Lending & Borrowing Rates and Liquidity

File Structure Details

Field Description Example
blockchain The blockchain on which the transaction happened. ethereum
block_number The height of the block in which the transaction happened. 16025918
datetime The timestamp of the block in which the transaction happened. 1669124591
protocol Code of the L&B protocol. aave/v2
asset_symbol Symbol of the underlying asset. crv
asset_address Address of the underlying asset. 0xd533a949740bb3306d119cc777fa900ba034cd52
asset_decimals Decimals of the underlying asset. 18
receipt_symbol Symbol of the receipt asset. acrv
receipt_address Address of the receipt asset. 0x8dae6cb04688c62d939ed9b68d32bc62e49970b1
receipt_decimals Decimals of the receipt asset. 18
total_liquidity The total amount of liquidity for this pool. 1486160
available_liquidity The total amount of available liquidity for this pool. 1279630
total_borrowed The total amount of tokens borrowed for this pool. 206535
supply_rate The supply rate. 0.00289186
stable_borrow_rate The stable borrow rate. 0.0442648
variable_borrow_rate The variable borrow rate. 0.0208089
... Additional fields specific to each exchange. See below. 0

Additional fields

AAVE v1

Field Description Example
total_borrowed_stable The total amount of assets borrowed with a stable rate for this pool. 0
total_borrowed_variable The total amount of assets borrowed with a variable rate for this pool. 41872.928778

AAVE v2

Field Description Example
total_borrowed_stable The total amount of assets borrowed with a stable rate for this pool. 4162389.524515
total_borrowed_variable The total amount of assets borrowed with a variable rate for this pool. 345075360.304631
total_reserves Total liquidity - All of the debt tokens supply. 51387128.92415

Compound

Field Description Example
total_reserves Total liquidity - All of the debt tokens supply. 3486037.365878

Cream

Field Description Example
total_reserves Total liquidity - All of the debt tokens supply. 033661.402437

Maker

Field Description Example
collateral_ratio Minimum ratio of collateral before liquidation. 1.5
debt_ceiling Maximum amount of DAI that can be emitted on this type of vault. 2500000
debt_floor Minimum amount of DAI that can be minted for this type of Vault. 2000

Wallet data (Ethereum and other EVM blockchains)

File Structure Details

Field Description Example
user_address The address on which the row is focused. 0xc8c939539efb7f5ba903fc99b61656979c46c045
chain Blockchain name. ethereum
block_number The height of the block. 7005997
timestamp The timestamp of the block. 1546560004
transaction_hash Transaction hash. 0x5a9e11432e5c7e2fccf598606858619cbd72f1de40db625fc4749ec1b032e144
transaction_type Event type. gas_buy
transaction_index The index of the transaction. 0
ordinal Generated number that gives the order of each balance impact, for one file. Based on call index and log indexes. 2
sender_address The address that sends tokens or coins. 0xc8c939539efb7f5ba903fc99b61656979c46c045
receiver_address The address that receives tokens or coins. 0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c
initiator_address The address that signed the transaction. 0xc8c939539efb7f5ba903fc99b61656979c46c045
token_symbol Symbol of the token or coin transfered ETH
token_address The address of the token or coin transfered. 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
direction Inflow or outflow from the user_address. out
amount Amount of asset transfered. 0.16
balance_after Wallet balance for the user_address for this asset. 0.4814735188
amount_usd Amount of asset transferred in usd. 23.863262042004745
balance_after_usd Wallet balance for the user_address for this asset in usd. 71.80955465881561

All possible values for the field transaction_type:

Value Description
unknown Unknown balance_change reason, only happens for the chain’s coin.
reward_mine_uncle Uncle block rewards are awarded to miners who generate an uncle block that gets included in a valid block added to the chain. These uncle blocks are analogous to stale blocks in Bitcoin. However, rather than being disregarded, uncle blocks receive rewards dependent on their novelty. Example.
reward_mine_block Rewards granted to the miner who mines the current block.
dao_refund_contract This is related to the execution of the DAO hard-fork, an event that occurred as a response to the notorious DAO hack in 2016. This hard-fork moved all the Ether initially stored in The DAO (and its child DAOs) to a refund contract. From this contract, original DAO token holders could claim their proportional share of the funds.
dao_adjust_balance Refers to any adjustment made to an account’s balance in relation to DAO-related hard-fork or operations.
coin_transfer A coin transfer operation.
genesis_balance Refers to the balance attributed to addresses during the genesis block.
gas_buy The amount of gas purchased by the initiator to execute the transaction.
reward_transaction_fee Reward earned by the miner for including the transaction in the block.
reward_fee_reset
gas_refund The process of refunding gas to the initiator when the state store is cleared.
touch_account Refers to the process of interacting with an account in some way, such as updating its nonce.
suicide_refund The process of refunding gas to a contract owner when the SELFDESTRUCT operation is called, as it clears the store.
suicide_withdraw This action allows the withdrawal of the remaining coin (ex: ETH) in a self-destructed account to a specific address.
call_balance_override This operation overrides the default balance of an account.
burn Burning coins in chains where this process occurs.
withdrawal Allows the withdrawal of rewards or stake for validators.
token_transfer This operation involves the transfer of (ERC20) tokens.
wrap_coin This operation mints WETH tokens after a coin (ex: ETH) deposit.
unwrap_coin This operation burns WETH tokens before a coin (ex: ETH) withdrawal.
token_deposit This operation allows the deposit of (ERC20) tokens into staking contracts or escrow.
token_withdrawal This operation allows the withdrawal of (ERC20) tokens from the staking contracts or escrow.

Wallet data (Bitcoin and other UTXOs)

File Structure Details

This product is made of two distinct tables: - Balance Data - One row for each address balance change. - Transaction Data - One row for each transaction.

Balance Data

Field Description Example
user_address The address on which the row is focused. 15HCzh8AoKRnTWMtmgAsT9TKUPrQ6oh9HQ
chain Blockchain name. bitcoin
block_number The height of the block. 394889
timestamp The timestamp of the block. 1453681271
transaction_hash Transaction hash. 94ad60ff0ef4cd0f31cab884adc6c39720273e9468ac0019a339911f0dd26e76
transaction_type Event type. minerReward
transaction_index The index of the transaction. 0
ordinal Generated number that gives the order of each balance impact, for one file. Based on call index and log indexes. 2
token_symbol Symbol of the coin transfered BTC
direction Inflow or outflow from the user_address. in
amount Amount of asset transfered. 25.42860520
balance_after Wallet balance for the user_address for this asset. 531.52819202
amount_usd Amount of asset transferred in usd. 10171.442886426918
balance_after_usd Wallet balance for the user_address for this asset in usd. 212611.2936645534

Transaction Data

Field Description Example
chain Blockchain name. bitcoin
block_number The height of the block. 395211
timestamp The timestamp of the block. 1453853136
transaction_hash Transaction hash. 94ad60ff0ef4cd0f31cab884adc6c39720273e9468ac0019a339911f0dd26e76
transaction_index The index of the transaction. 0
sender_addresses The addresses that sends the coin. [1A8MMLhpGEyNqEsqzkReXtmBx9LBQgt8Mh]
receiver_addresses The addresses that receives the coin. [19Ntq9wC9i39284EZVVf4R7DbCz7gThxzs,12eKGe5hLdKBe8mQ7dv8NixEcX96XHBkoZ]
token_symbol Symbol of the coin transfered BTC
amount_out Amount of asset transfered. 10.12592654
fees Fees paid for the transaction. 0.0004
amount_out_usd Amount of asset transferred in usd. 3965.771819253574
fees_usd Fees paid for the transaction in usd. 0.15665813112855445

Data Feed

Receive historical and on-going data directly to your cloud provider. If you purchased a monthly subscription of Trade Data, 10% Order Books, OHLCV or VWAP, your data will be delivered once a day to your cloud bucket. We currently support Amazon Web Services S3 and Google storage. Cloud storage services allow us to easily synchronize our data with you once a day.

Cloud providers offer extensive storage services that will help you store large amounts of data. This eases the integration setup to feed whatever system you choose to integrate the data with.

If you do not already have a cloud provider, we suggest working with Amazon Web Services which is a major provider with a strong track record.

How to receive our data through AWS S3

  1. You will need to have access to an AWS account, which can be created here https://aws.amazon.com/resources/create-account/
  2. You will also need to retrieve your AWS account ID, as well as your AWS canonical ID, the instructions regarding this step can be found here: https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-identifiers.html
  3. The AWS account ID as well as the canonical ID should be sent to: support@kaiko.com.
  4. Our team will create an AWS bucket to which you have all the needed permissions to access its objects and will contact you to confirm the details.

If you have any questions regarding this process, you can contact: support@kaiko.com

How to receive our data through GCS

  1. Open https://console.cloud.google.com/storage/
  2. We suggest calling the bucket kaiko-delivery-nameofyourcompany
  3. Once created, click on the "3 dots" on the right side of the corresponding bucket
  4. Click on Edit bucket permissions: GCS_Bucket_Permissions_Tab
  5. Press Add members and add our service account kaiko-facteur@kaiko-facteur.iam.gserviceaccount.com
  6. Press on Select a role, select Storage, then select Storage Admin as follows:
    GCS_Bucket_Add_Perm
  7. Press on Add to validate the changes
  8. Enter the details into this form
  9. You should receive a confirmation email within a few working days confirming that the integration was set up correctly

If you have any questions regarding this process, you can contact: support@kaiko.com

How to receive our data through Azure Blob Storage

  1. You will need to create an Azure Blob storage container.
  2. We suggest calling the container kaiko-delivery-nameofyourcompany
  3. Once created, you will need to create an SAS Token for this container. The SAS Token should be valid for at least a year with the following permissions : Read, Add, Create, Write, Delete, List, Move.
  4. We need the following details to be sent to support@kaiko.com : Azure Container Name, SAS Token, Azure Account Name.

If you have any questions regarding this process, you can contact: support@kaiko.com

How to receive our data through Bigquery

To facilitate your access to our BigQuery datasets, please follow the outlined steps below:

  1. Prerequisite: Ensure you possess an active Google Cloud account. If you do not have one, please create an account at Google Cloud.

  2. Request Access: Submit the required information to support@kaiko.com. Please include the email addresses and service accounts that require access to the dataset.

  3. Access Confirmation: Upon receiving your request, our team will initiate the access provisioning process. You will be notified via email once access has been granted.

  4. Locating the BigQuery Dataset: Access the BigQuery interface and navigate to the Analytics Hub. Within the Analytics Hub, search for private listings to locate the dataset shared with you.

  5. Dataset Utilization: After adding the dataset to your project, you will gain full access to the data, allowing you to integrate it into your applications.

Should you encounter any issues or require further assistance, please do not hesitate to contact our support team at support@kaiko.com..

For other cloud providers

Please contact us at support@kaiko.com.

Future development

We are continously extending the feature set across all our products. We are very happy to receive your feedback on our services and documentation. Do you have a proposal on how we can make your day better? Give us a shout!