Only this pageAll pages
Powered by GitBook
1 of 35

Stream

General

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

CEFI SPOT MARKET DATA

Loading...

Loading...

Loading...

Loading...

Loading...

CEFI DERIVATIVE MARKET DATA

Loading...

Loading...

Loading...

Loading...

Loading...

DEFI SPOT MARKET DATA

Loading...

Loading...

Loading...

ANALYTICS

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

BETA ENDPOINTS

Loading...

Synthetic price

  • Kaiko Fair Market Value [Established Assets]

  • Kaiko Fair Market Value [Full Coverage]

What is this endpoint for?

This endpoint calculates a synthetic price when there is less liquidity (historic trades) between two assets. The methodology is developed with global tax and accounting standards in mind. Additionally, our robust price aggregation method reduces the impact of outliers in terms of volume and price, meaning you can trust the price returned.

The calculation works as follows:

  1. Retrieve the last available optimal liquidity path

  2. Listen to trades for all intermediary pairs from all covered exchanges where the instrument is actively traded

  3. Compute RWM price for each intermediary pair

  4. Compute the product of intermediary pairs based on the liquidity path

The calculation considers all instruments traded across all exchanges covered by Kaiko.

Read the full methodology .

Parameter
Description
Examples
Mandatory?
Field
Description

Make sure to read our before starting.

cURL requests are intended for testing purposes only.

Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

For more advanced users, you can access our full SDK , where you'll find more coding languages, examples, and guidance.

1s

assets

A nested object to configure following properties for your stream:

  • base - the base asset you'd like your price to be based on

  • quote - the asset you'd like the price to be quoted in

Explore instruments, codes and exchanges in the or .

btc eur

extrapolate_missing_values

This parameter is set to false by default. Setting it to true means that if there is no trade price available from the calculation window you configured, the last available price (from outside the window) will be used.

false

window

A nested object containing the following fields:

  • startTime - The start of the calculation window for this Cross Price

  • endTime - The end of the calculation window for this Cross Price

noTrade

If false a price was able to be calculated within the window provided. If true the extrapolate_missing_values parameter was needed to calculate a price.

window

The window on which you would like your Cross Price to be calculated. Available windows: 1s, 5s, 15s, 30s, 60s, 300s

15s

update_frequency

assets

The base and quote assets as configured above.

price

The calculated Cross Price.

timestamp

The time the Cross Price was calculated.

 # This is a code example. Configure your parameters in the parameter configuration section #

from __future__ import print_function
import logging
import os

import grpc
from google.protobuf.json_format import MessageToJson
from google.protobuf import duration_pb2

from kaikosdk import sdk_pb2_grpc
from kaikosdk.core import instrument_criteria_pb2, assets_pb2
from kaikosdk.stream.aggregates_ohlcv_v1 import request_pb2 as pb_ohlcv
from kaikosdk.stream.aggregates_vwap_v1 import request_pb2 as pb_vwap
from kaikosdk.stream.market_update_v1 import request_pb2 as pb_market_update
from kaikosdk.stream.market_update_v1 import commodity_pb2 as pb_commodity
from kaikosdk.stream.trades_v1 import request_pb2 as pb_trades
from kaikosdk.stream.index_v1 import request_pb2 as pb_index
from kaikosdk.stream.index_multi_assets_v1 import request_pb2 as pb_index_multi_assets
from kaikosdk.stream.index_forex_rate_v1 import request_pb2 as pb_index_forex_rate
from kaikosdk.stream.aggregated_quote_v2 import request_pb2 as pb_aggregated_quote
from kaikosdk.stream.aggregates_spot_exchange_rate_v2 import request_pb2 as pb_spot_exchange_rate
from kaikosdk.stream.aggregates_direct_exchange_rate_v2 import request_pb2 as pb_direct_exchange_rate

def aggregates_spot_exchange_rate_request(channel: grpc.Channel):
    try:
        with channel:
            stub = sdk_pb2_grpc.StreamAggregatesSpotExchangeRateV2ServiceV1Stub(channel)
 # confiugure your window and frequency #
            window = duration_pb2.Duration()
            window.FromSeconds(10)

            update_frequency = duration_pb2.Duration()
            update_frequency.FromSeconds(2)

            responses = stub.Subscribe(pb_spot_exchange_rate.StreamAggregatesSpotExchangeRateV2RequestV1(
 # confiugure your assets #
                assets = assets_pb2.Assets(
                    base = "eth",
                    quote = "usd"
                ),
                
               # End of parameter configuration#
                window = window,
                update_frequency = update_frequency
            ))
            for response in responses:
                print("Received message %s" % (MessageToJson(response, including_default_value_fields = True)))
    except grpc.RpcError as e:
        print(e.details(), e.code())
        
def run():
    credentials = grpc.ssl_channel_credentials(root_certificates=None)
    call_credentials = grpc.access_token_call_credentials(os.environ['KAIKO_API_KEY'])
    composite_credentials = grpc.composite_channel_credentials(credentials, call_credentials)
    channel = grpc.secure_channel('gateway-v0-grpc.kaiko.ovh', composite_credentials)

    aggregates_spot_exchange_rate_request(channel)

if __name__ == '__main__':
    logging.basicConfig()
    run()
curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_spot_exchange_rate_v2" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"assets\": { \"base\": \"eth\", \"quote\": \"usd\" }, \"window\": \"5s\"}"
{
  "assets": {
    "base": "eth",
    "quote": "usd"
  },
  "price": 2629.972960779576,
  "timestamp": "2024-08-12T10:35:06.026554200Z",
  "window": {
    "startTime": "2024-08-12T10:34:56Z",
    "endTime": "2024-08-12T10:35:06Z",
    "duration": "10s"
  },
  "noTrade": false
}

When using a synthetic price, in order to to meet IFRS-compliance standards, any fiat currency value should be requested in USD and converted using the Oanda FX Rates add-on.

Endpoints

gateway-v0-grpc.kaiko.ovh
gateway-v0-http.kaiko.ovh
https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_spot_exchange_rate_v2

Parameters

Exchanges that send their trades late may not be captured in the given sliding window.

Fields

Request examples

Response Example

This data is included in the following Kaiko packages:

here
Python quick-start guide
here

How regularly you would like to receive your pricing updates. Available frequencies: 1s, 5s, 10s, 30s, and 1m

Duration - The window as configured above
Instrument Explorer
guide

General information

Response codes

Here is a summary of our general response codes.

200

A successful response.(streaming responses)

Inline

403

Returned when the user does not have permission to access the resource.

Inline

404

Returned when the resource does not exist.

string

default

Default

An unexpected error response.

OK
Forbidden
Not Found
rpcStatus

Introduction

A little about Kaiko Stream.

The fastest way to consume Kaiko data.

Kaiko Stream is designed for those that need our data in the fastest way possible. Once connected to a stream, you'll get constant updates for the parameters you have initially configured. This provides true real-time data, and allows you to get insights on several exchanges or instruments from one connection.

✔ Real-time updates delivered instantly with no need to call an API each time ✔ Data on multiple exchanges or instruments simultaneously in one stream ✔ gRPC technology for the best data delivery and uptime ✔ Customizable calculations, frequencies, and channels ✔ Limited historical data available on replay

Let's get started .

here

Quick-Start: cURL

Making a request with cURL is extremely straightforward. cURL is only designed for testing purposes, and should not be used for production. Here are the steps to get started:

.... and that's it! You'll now receive updates in real-time as per your configuration.

Quick-Start Guides

The prerequisites for setting up your Kaiko Stream

Let's get started setting up your first stream by using one of our Quick-Start Guides below.

Quick-Start Guides

Note, Kaiko Stream also supports several other coding languages that we do not have quick-start guides for. For C++, C#, Go, Java, Node, Python, Rust, Scala languages, you can find the SDK examples in our Github .

here
Quick-Start: Python
Quick-Start: cURL

State price

  • Kaiko Fair Market Value [Emerging Assets]

  • Kaiko Fair Market Value [Full Coverage]

What is this endpoint for?

This endpoint should be used when there isn’t enough liquidity to produce a direct or synthetic price. Especially useful for DeFi-only assets, state price derives a price by analyzing the real-time state of liquidity pools for the selected asset, inspecting the pools’ reserves, balances, and recent flow to infer a-price consistent with current market conditions. The data includes the calculated state price and the trading volume from the associated block within each pool, expressed in USD. Pool eligibility depends on the pairing: non-LST tokens must be paired with USDT, USDC, or wETH, while LST tokens must be paired with wETH.

Endpoint

gateway-v0-grpc.kaiko.ovh
gateway-v0-http.kaiko.ovh
https://gateway-v0-http.kaiko.ovh/api/stream/aggregatedstateprice

Parameters

Parameter
Description
Examples
Mandatory?
Field
Description

Make sure to read our before starting.

cURL requests are intended for testing purposes only.

For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

aggregatedPriceEth

State price aggregated over multiple pools, denominated in ETH. This field will return empty for LST tokens.

tsEvent

Date of the publication.

lstQuote

LST quote token if relevant, otherwise will return empty.

asset

The asset name you would like to get data for. To retrieve data for all eligible assets at once, simply enter * in the asset parameter field.

ageur,wsteth

datetime

Timestamp at which the data has been processed. One data point per second will be published.

base

Base asset requested.

aggregatedPriceUsd

State price aggregated over multiple pools, denominated in USD.

curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregatedstateprice" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"asset\": \"wsteth\", \"start_time\": \"2025-01-07T10:48:59.528Z\", \"end_time\": \"2025-01-08T10:48:59.528Z\" }"
{
	"result": {
		"datetime": "2024-10-23T09:45:13.000964543Z",
		"base": "wsteth",
		"aggregatedPriceUsd": "3036.2060425401045987863569203955",
		"aggregatedPriceEth": "1.1822171670279031",
		"tsEvent": "2024-10-23T09:45:13.447941047Z",
		"lstQuote": "weth"
	}
}

Fields

Request examples

Response Example

This data is included in the following Kaiko packages:

Python quick-start guide
here

Kaiko Best Execution

Get a market-representative execution benchmark that’s ideal for reporting and demonstrating execution efficiency to clients. The exchanges used in this calculation are vetted, meaning only those that are part of the are included. The best bids are aggregated over 10-second intervals and delivered every second. This means you receive the best bids and asks from the previous 10 seconds, updated every second.

Read the full methodology .

Parameter
Description
Examples
Mandatory?

instrument_class

The class of the instrument(s) . Explore instruments, codes and exchanges in the or .

spot

code

The Kaiko code for the instrument(s). The class of the instrument(s) . Explore instruments, codes and exchanges in the or .

btc-usd

includeUnvettedPrice

This parameter is set to false by default and not included in the code example. Setting this field to true includes best bids and asks from exchanges that are not included in the Kaiko Exchange Ranking. This parameter is helpful when an instrument you need is not covered by any exchange on the Kaiko Exchange ranking. It also serves as a backup for instruments covered by only one exchange, ensuring you still receive a price in case that exchange drops off the ranking when it's updated. If you set this parameter true, the calculation will include all exchanges covered by Kaiko and this price will appear in a separate unvetted section of the response.

Field
Description

aggregate

The time period over which the best bid or ask was calculated. This is always 10s.

instrumentClass

The class of the instrument.

code

The instrument code.

cURL requests are intended for testing purposes only.

curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregated_quote_v2" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{\"instrumentClass\":\"spot\", \"code\": \"btc-usd\"}"

For more advanced users, you can access our full SDK here, where you'll find more coding languages, examples and guidance.

This data is included in the following Kaiko packages:

  • Kaiko Best Execution Pricing

What is this endpoint for?

Note that Kaiko Exchange Ranking is updated every quarter, so the exchanges used in the calculation may change.

Endpoints

gateway-v0-grpc.kaiko.ovh
gateway-v0-http.kaiko.ovh
https://gateway-v0-http.kaiko.ovh/api/stream/aggregated_quote_v2

Request parameters

Kaiko Exchange Ranking
here
 "aggregate": "10s",
  "instrumentClass": "spot",
  "code": "btc-usd",
  "eventType": "BEST_ASK",
  "tsEvent": "2024-08-09T23:15:18.087882038Z",
  "vetted": {
    "price": "60556.00224312413",
    "volume": "0.2699806"

Configuring multiple instruments

To configure multiple instruments in the same stream, provide the code as a comma separated list eg btc-usd,eth-usd.

Response fields

Request examples

Response Example

"includeUnvettedPrice": true

eventType

BEST_BID - The best bid from the period BEST_ASK - The best ask from the period

tsEvent

The timestamp the data became available in the Kaiko system.

price

When BEST-BID: The price per unit of the base that the buyer is willing to pay in the quote asset, represented as a scientific notation

Example: btc-usd

  • base asset = btc

  • quote asset = usd price: 60555.00271626198

For each unit of btc, the buyer is willing to pay 60555.00271626198 USD.

When BEST-ASK: The price per unit of the base that the seller is willing to accept in the quote asset, represented as a scientific notation

Example: btc-usd

  • base asset = btc

  • quote asset = usd price: 60556.00224312413

For each unit of btc, the buyer is willing to accept 60556.00224312413 USD.

volume

  • When BEST-BID: The quantity of the base asset that the buyer is willing to purchase

  • When BEST-ASK: The quantity of the base asset the seller has available for sale

Instrument Explorer
Instrument Explorer

Bids and asks

  • Level 1 & Level 2 Data [Level 2 Tick-Level Tier]

CeFi spot ticker packs.

What is this endpoint for?

All bids and asks on an exchange's order book. Use Kaiko Stream for real-time tick-level updates, or CSV for backdated information. When you connect, you first receive a full snapshot of the current order book with every bid and ask, followed by continuous real-time updates for every change ("delta") that takes place.

When you subscribe, you'll initially receive a full snapshot within a few seconds, followed by all subsequent tick-level updates. If you receive another full snapshot, replace your local snapshot with the new one. This should happen infrequently and only occurs if we detect a consistency issue, such as a lost connection to the exchange or the exchange being down for some time.

If you receive an update with an amount of 0, you should remove the corresponding price level from your local order book. You'll occasionally receive a 0 message for a price level that doesn't exist in your local order book - this can be safely ignored and is due to various exchange limitations.

The order book should not be considered valid until all updates with the same tsExchange

Endpoints

gateway-v0-grpc.kaiko.ovh
gateway-v0-http.kaiko.ovh
https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_v1
https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_replay_v1

Request parameters

Parameter
Description
Examples
Field
Description

This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in hours, seconds, and minutes.

Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.

cURL requests are intended for testing purposes only.

Quick-Start: Python

Get started with Kaiko Stream and Python

Before implementing Kaiko Stream in your Python environment, ensure you meet the following technical requirements.

  • Python Version: Minimum Python 3.7+ (recommended: 3.9+)

  • Operating System: Cross-platform (Windows, macOS, Linux)

Parameter patterns

If the params lists contain more than one element, the resulting pattern will be constructed as a cartesian product of each element of the lists, i.e:

pattern = exchange1,exchange2:instrument_class:instrument1,instrument2

will be equivalent to the union of 4 patterns:

  • pattern1 = exchange1:instrument_class:instrument1

pattern2 = exchange1:instrument_class:instrument2

  • pattern3 = exchange2:instrument_class:instrument1

  • pattern4 = exchange2:instrument_class:instrument

  • Multiple patterns can also be combined with the + operator: where:

    pattern = pattern1+pattern2

    • pattern1 = <exchange1>:<instrument_class1>:<instrument1>

    • pattern2 = <exchange2>:<instrument_class2>:<instrument2>

    Cartesian Product of Patterns

    Union of Patterns

    sequenceId

    Sequence ID for event. Sortable in lexicographic order.

    updateType

    SNAPSHOT - A new Snapshot of the order book UPDATED- A new batch of bids & asks since the snapshot

    asks

    Represents sell orders

    amount: the quantity of the base asset available for sale

    price: the price per unit of the base that the seller is willing to accept in the quote asset, represented as a scientific notation Example: algo-btc

    • base asset = algo

    bids

    Represents buy orders.

    amount: the quantity of the base asset the buyer is willing to purchase

    price: the price per unit of the base that the buyer is willing to pay in the quote asset, represented as a scientific notation Example: algo-btc

    • base asset = algo

    tsExchange

    The timestamp provided by the exchange for the data. Where exchanges do not provide this data, we fill this with tsCollection. This applies to the following exchanges:

    • Bitfinex (bfnx)

    • Bitflyer (bfly)

    • CEX.io (cexi)

    tsCollection

    The timestamp for when Kaiko received the data from the exchange.

    tsEvent

    The timestamp the data became available in the Kaiko system.

    For more advanced users, you can access our full SDK here, where you'll find more coding languages, examples and guidance.

    have been applied to your local order book, meaning all potential messages from the same update batch have been processed.

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    • code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the or .

    cbse

    spot

    algo-btc

    class

    Instrument class, empty when not mapped.

    code

    Instrument code, empty when not mapped.

    exchange

    Instrument exchange code.

    #Live
    
    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": { \"exchange\": \"cbse\", \"instrumentClass\": \"spot\", \"code\": \"algo-btc\"}}"
    
    
    #Replay/Historical Data
    
    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_replay_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot\",  \"code\": \"algo-btc\" }, \"interval\": { \"startTime\": \"2025-01-14T12:00:00.000Z\", \"endTime\": \"2025-01-14T18:00:00.000Z\" }}"
    Received message {"class":"spot",
    "code":"bch-eur",
    "exchange":"cbse",
    "sequenceId":"cu2o2sokocas72q8rkq0",
    "updateType":"SNAPSHOT",
    "asks":[
      {
        "amount":0.02778327,
        "price":414.07
      },
      {
        "amount":0.4,
        "price":414.08
      }
    ],
    "bids":[
      {
        "amount":0.4,
        "price":413.93
      },
      {
        "amount":0.0277962,
        "price":413.85
      } ],
    "tsExchange":{
      "value":"2025-01-13T21:11:15.064Z"
    },
    "tsCollection":{
      "value":"2025-01-13T21:11:15.064284559Z"
    },
    "tsEvent":"2025-01-13T21:11:15.260258142Z",
    "additionalProperties":{}
    }
    
    Received message {"class":"spot",
    "code":"bch-eur",
    "exchange":"cbse",
    "sequenceId":"cu2o2sokocas72q8rla0",
    "updateType":"UPDATE",
    "asks":[
      {
        "amount":4,
        "price":414.42
      }
      ],
    "bids":[],
    "tsExchange":{
      "value":"2025-01-13T21:11:15.016291Z"
    },
    "tsCollection":{
      "value":"2025-01-13T21:11:15.086529551Z"
    },
    "tsEvent":"2025-01-13T21:11:15.277722255Z",
    "additionalProperties":{}
    }
    
    Received message {"class":"spot",
    "code":"bch-eur",
    "exchange":"cbse",
    "sequenceId":"cu2o2sokocas72q8t9q0",
    "updateType":"UPDATE",
    "asks":[],
    "bids":[
      {
        "amount":0,
        "price":413.85
      },
      {
        "amount":0.02779016,
        "price":413.94
      }
      ],
    "tsExchange":{
      "value":"2025-01-13T21:11:15.235251Z"
      },
    "tsCollection":{
      "value":"2025-01-13T21:11:15.248921649Z"
      },
    "tsEvent":"2025-01-13T21:11:15.635226002Z",
    "additionalProperties":{}
    }
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    exchange: * class: spot instrument: btc-usd

    Response fields

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    Network: Stable internet connection for gRPC streaming
    File
    Purpose
    Link

    Requirements

    This file contains the minimum requirements for the script to run.

    Pipfile

    This file contains important PIP information for your Python script to run.

    .... and that's it! You'll now receive updates in real-time as per your configuration.

    System requirements

    Core files

    Checklist

    This guide is intended to get you started with Stream and Python. You can also access our full SDK , where you'll find more coding languages, examples and guidance.

    VWAP

    This endpoint delivers VWAP (volume-weighted average price) for an instrument on an exchange in real time.

    Parameter
    Description
    Examples

    Pipfile.lock

    This file contains additional PIP information for your Python script to run.

    https://raw.githubusercontent.com/kaikodata/kaiko-sdk-examples/master/python/Pipfile.lock

    Resubscribe

    This tells Python what to do in the instance you lose connection with Kaiko Stream.

    https://raw.githubusercontent.com/kaikodata/kaiko-sdk-examples/master/python/resubscribe.py

    https://raw.githubusercontent.com/kaikodata/kaiko-sdk-examples/master/python/requirements.txt
    https://raw.githubusercontent.com/kaikodata/kaiko-sdk-examples/master/python/Pipfile
    here

    Rate limiting

    Our Stream service is limited to 3000 subscriptions per API key per minute as standard. If you exceed this threshold, a 429 an error message will occur. A "subscription" refers to a live data stream, regardless of the amount of data received by each. If you'd like to discuss rate-limiting, please contact support@kaiko.com.

    quote asset = btc amount : 42656.0 price: 1.97e-06
  • The asker has 42656.0 Algo available

  • For each unit of Algo, the buyer is willing to accept 1.97e-06 BTC, equal to 0.00000197 when converted to a decimal number

  • quote asset = btc amount : 80569.0 price: 1.96e-06
  • The buyer will purchase up to 80569.0 Algo

  • For each unit of Algo, the buyer is willing to pay 1.96e-06 BTC, equal to 0.00000196 when converted to a decimal number

  • Instrument Explorer

    The period you would like the VWAP aggregation to be calculated over.

    1m

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    btc-usd

    Field
    Description

    aggregate

    The period of calculation.

    class

    The class of instrument.

    code

    The instrument code.

    cURL requests are intended for testing purposes only.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_vwap_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"binc\",  \"instrumentClass\": \"spot\",  \"code\": \"eth-usdt\" }, \"aggregate\": \"1m\"}"

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK here, where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 1 Aggregations Tier]

    • Level 1 & Level 2 Data [Level 1 Tick-Level Tier]

    • Level 1 & Level 2 Data [Level 2 Aggregations Tier]

    • Level 1 & Level 2 Data [Level 2 Tick-Level Tier]

    CeFi spot ticker packs.

    What is this endpoint for?

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_vwap_v1

    Request parameters

    aggregate

    "aggregate": "1s",
      "class": "spot",
      "code": "eth-usdt",
      "exchange": "binc",
      "price": 2591.3221372276307,
      "tsEvent": "2024-08-09T13:47:20.689338450Z",
      "uid": "2024-08-09T13:47:19Z",
      "sequenceId": ""
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    price

    The price for the peirod (USD).

    exchange

    The exchange the VWAP is referencing.

    tsEvent

    The timestamp for the interval.

    uid

    The unique ID for this delivery.

    volume

    Volume traded in interval. 0 when no trades reported.

    sequenceId

    Not applicable. Null

    guide

    VWAP

    • Level 1 & Level 2 Data [Level 1 Aggregations]

    • Level 1 & Level 2 Data [Level 1 Tick-Level]

    What is this endpoint for?

    This endpoint delivers VWAP (volume-weighted average price) for an instrument on an exchange in real time.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_vwap_v1

    Request parameters

    Parameter
    Description
    Examples
    Field
    Description

    cURL requests are intended for testing purposes only.

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    price

    The price for the peirod (USD).

    exchange

    The exchange the VWAP is referencing.

    tsEvent

    The timestamp for the interval.

    uid

    The unique ID for this delivery.

    volume

    Volume traded in interval. 0 when no trades reported.

    sequenceId

    Not applicable. Null

    Level 1 & Level 2 Data [Level 2 Aggregations]
  • Level 1 & Level 2 Data [Level 2 Tick-Level]

  • DeFi spot ticker packs.

    aggregate

    The period you would like the VWAP aggregation to be calculated over.

    1m

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    • code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the or .

    cbse

    spot

    btc-usd

    aggregate

    The period of calculation.

    class

    The class of instrument.

    code

    The instrument code.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_vwap_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"binc\",  \"instrumentClass\": \"spot\",  \"code\": \"eth-usdt\" }, \"aggregate\": \"1m\"}"
    "aggregate": "1s",
      "class": "spot",
      "code": "eth-usdt",
      "exchange": "binc",
      "price": 2591.3221372276307,
      "tsEvent": "2024-08-09T13:47:20.689338450Z",
      "uid": "2024-08-09T13:47:19Z",
      "sequenceId": ""
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    exchange: * class: spot instrument: btc-usd

    Response fields

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    here
    guide

    VWAP

    • Level 1 & Level 2 Data [Level 1 Aggregations]

    • Level 1 & Level 2 Data [Level 1 Tick-Level]

    What is this endpoint for?

    This endpoint delivers VWAP (volume-weighted average price) for an instrument on an exchange in real time.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_vwap_v1

    Request parameters

    Parameter
    Description
    Examples
    Field
    Description

    cURL requests are intended for testing purposes only.

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    All trades

    Tick-level data is the most granular level of trading data, and contains every single trade that occurs or centralized and decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade. For DEX’s specifically, we also provide additional information on the user address, the blockchain, the pool address and transaction hash related to the trade.

    Learn about our methodologies for and .

    Parameter
    Description

    All trades

    Tick-level data is the most granular level of trading data, and contains every single trade that occurs or centralized and decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade. For DEX’s specifically, we also provide additional information on the user address, the blockchain, the pool address and transaction hash related to the trade.

    Learn about our methodologies for and .

    Parameter
    Description

    API Key

    To make any request, you'll need an API Key from Kaiko. Contact support@kaiko.com if you don't have yours. There's a placeholder for the API Key in all code examples. The parameter to be passed in the header is X-Api-Key.

    price

    The price for the peirod (USD).

    exchange

    The exchange the VWAP is referencing.

    tsEvent

    The timestamp for the interval.

    uid

    The unique ID for this delivery.

    volume

    Volume traded in interval. 0 when no trades reported.

    sequenceId

    Not applicable. Null

    Level 1 & Level 2 Data [Level 2 Aggregations]
  • Level 1 & Level 2 Data [Level 2 Tick-Level]

  • CeFi derivative ticker packs.

    aggregate

    The period you would like the VWAP aggregation to be calculated over.

    1m

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    • code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the or .

    cbse

    spot

    btc-usd

    aggregate

    The period of calculation.

    class

    The class of instrument.

    code

    The instrument code.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_vwap_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"binc\",  \"instrumentClass\": \"spot\",  \"code\": \"eth-usdt\" }, \"aggregate\": \"1m\"}"
    "aggregate": "1s",
      "class": "spot",
      "code": "eth-usdt",
      "exchange": "binc",
      "price": 2591.3221372276307,
      "tsEvent": "2024-08-09T13:47:20.689338450Z",
      "uid": "2024-08-09T13:47:19Z",
      "sequenceId": ""
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    exchange: * class: spot instrument: btc-usd

    Response fields

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    here
    guide
    Examples

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    btc-usd

    commodities

    Must always be [pb_commodity.SMUC_TRADE]

    [pb_commodity.SMUC_TRADE]

    interval

    For accessing 72h replay data only. See the replay code example.

    start_time end_time

    Field
    Description

    additionalProperties

    Additional properties, specific to the exchange.

    amount

    Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).

    class

    Instrument class, empty when not mapped.

    This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in hours, seconds, and minutes. Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.

    cURL requests are intended for testing purposes only.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot\",  \"code\": \"*\" }, \"commodities\": [\"SMUC_TRADE\"]}"

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 1 Tick-Level Tier]

    • Level 1 & Level 2 Data [Level 2 Aggregations Tier]

    • Level 1 & Level 2 Data [Level 2 Tick-Level Tier]

    CeFi spot ticker packs.

    What is this endpoint for?

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1

    Request parameters

    DEX data
    Uniswap V3
    {
        "result": {
            "additionalProperties": {
                "sequence": "85453949096"
            },
            "amount": 0.31157787,
            "class": "spot",
            "code": "btc-usd",
            "exchange": "cbse",
            "sequenceId": "cqpo618mna6i5t62gp4g",
            "id": "677226346",
            "price": 56510,
            "side": "SELL",
            "tsExchange": {
                "value": "2024-08-07T14:21:57.046442Z"
            },
            "tsCollection": {
                "value": "2024-08-07T14:21:57.131157967Z"
            },
            "tsEvent": "2024-08-07T14:21:57.329633824Z"
        }
    }

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    Examples

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    btc-usd

    commodities

    Must always be [pb_commodity.SMUC_TRADE]

    [pb_commodity.SMUC_TRADE]

    interval

    For accessing 72h replay data only. See the replay code example.

    start_time end_time

    Field
    Description

    additionalProperties

    Additional properties, specific to the exchange.

    amount

    Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).

    class

    Instrument class, empty when not mapped.

    This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in hours, seconds, and minutes. Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.

    cURL requests are intended for testing purposes only.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot\",  \"code\": \"*\" }, \"commodities\": [\"SMUC_TRADE\"]}"

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 1 Tick-Level]

    • Level 1 & Level 2 Data [Level 2 Aggregations]

    • Level 1 & Level 2 Data [Level 2 Tick-Level]

    CeFi derivative ticker packs.

    What is this endpoint for?

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1

    Request parameters

    DEX data
    Uniswap V3
    {
        "result": {
            "additionalProperties": {
                "sequence": "85453949096"
            },
            "amount": 0.31157787,
            "class": "spot",
            "code": "btc-usd",
            "exchange": "cbse",
            "sequenceId": "cqpo618mna6i5t62gp4g",
            "id": "677226346",
            "price": 56510,
            "side": "SELL",
            "tsExchange": {
                "value": "2024-08-07T14:21:57.046442Z"
            },
            "tsCollection": {
                "value": "2024-08-07T14:21:57.131157967Z"
            },
            "tsEvent": "2024-08-07T14:21:57.329633824Z"
        }
    }

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    Instrument Explorer

    All trades

    Tick-level data is the most granular level of trading data, and contains every single trade that occurs or centralized and decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade. For DEX’s specifically, we also provide additional information on the user address, the blockchain, the pool address and transaction hash related to the trade.

    Learn about our methodologies for and .

    Parameter
    Description

    OHLCV

    This Stream delivers the OHLCV for an instrument on an exchange in real-time.

    Parameter
    Description
    Examples

    OHLCV

    This Stream delivers the OHLCV for an instrument on an exchange in real-time.

    Parameter
    Description
    Examples
    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    code

    Instrument code, empty when not mapped.

    exchange

    Instrument exchange code.

    sequenceId

    Sequence ID for event. Sortable in lexicographic order.

    id

    Trade ID, empty string when not present.

    price

    Price for the trade.

    tsExchange

    The timestamp provided by the exchange for the transaction.

    tsCollection

    The timestamp for when Kaiko received the trade from the exchange.

    tsEvent

    The timestamp the data became available in the Kaiko system.

    side

    - UNKNOWN: Unknown side (not specified). - BUY: Buy side. - SELL: Sell side. See "taker_side_sell" Explained

    here
    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    code

    Instrument code, empty when not mapped.

    exchange

    Instrument exchange code.

    sequenceId

    Sequence ID for event. Sortable in lexicographic order.

    id

    Trade ID, empty string when not present.

    price

    Price for the trade.

    tsExchange

    The timestamp provided by the exchange for the transaction.

    tsCollection

    The timestamp for when Kaiko received the trade from the exchange.

    tsEvent

    The timestamp the data became available in the Kaiko system.

    side

    - UNKNOWN: Unknown side (not specified). - BUY: Buy side. - SELL: Sell side. See "taker_side_sell" Explained

    here
    Examples

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    btc-usd

    commodities

    Must always be [pb_commodity.SMUC_TRADE]

    [pb_commodity.SMUC_TRADE]

    interval

    For accessing 72h replay data only. See the replay code example.

    start_time end_time

    Field
    Description

    additionalProperties

    Additional properties, specific to the exchange.

    amount

    Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).

    class

    Instrument class, empty when not mapped.

    This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in hours, seconds, and minutes. Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.

    cURL requests are intended for testing purposes only.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot\",  \"code\": \"*\" }, \"commodities\": [\"SMUC_TRADE\"]}"

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 1 Tick-Level]

    • Level 1 & Level 2 Data [Level 2 Aggregations]

    • Level 1 & Level 2 Data [Level 2 Tick-Level]

    DeFi spot ticker packs.

    What is this endpoint for?

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1

    Request parameters

    DEX data
    Uniswap V3
    {
        "result": {
            "additionalProperties": {
                "sequence": "85453949096"
            },
            "amount": 0.31157787,
            "class": "spot",
            "code": "btc-usd",
            "exchange": "cbse",
            "sequenceId": "cqpo618mna6i5t62gp4g",
            "id": "677226346",
            "price": 56510,
            "side": "SELL",
            "tsExchange": {
                "value": "2024-08-07T14:21:57.046442Z"
            },
            "tsCollection": {
                "value": "2024-08-07T14:21:57.131157967Z"
            },
            "tsEvent": "2024-08-07T14:21:57.329633824Z"
        }
    }

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    The period you would like the OHLCV aggregation to be calculated over.

    1m

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    btc-usd

    Field
    Description

    aggregate

    The period of calculation.

    class

    The class of instrument.

    close

    Closing price of interval. null when no trades reported.

    cURL requests are intended for testing purposes only.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_ohlcv_v1" -H "accept: application/json" -H "X-Api-Key: $your_key" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": { \"exchange\": \"cbse\", \"instrumentClass\": \"spot\", \"code\": \"btc-usd\" }, \"aggregate\": \"1m\"}"

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK here, where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 1 Aggregations]

    • Level 1 & Level 2 Data [Level 1 Tick-Level]

    • Level 1 & Level 2 Data [Level 2 Aggregations]

    • Level 1 & Level 2 Data [Level 2 Tick-Level]

    CeFi derivative ticker packs.

    What is this endpoint for?

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_ohlcv_v1

    Request parameters

    aggregate

     {"aggregate": "1s",
      "class": "spot",
      "close": "60521.02",
      "exchange": "cbse",
      "high": "60528.91",
      "low": "60521.02",
      "open": "60528.91",
      "code": "btc-usd",
      "timestamp": "2024-08-09T13:13:14.347471354Z",
      "uid": "2024-08-09T13:13:13Z",
      "volume": "0.00028618000000000003",
      "sequenceId": "" }

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    The period you would like the OHLCV aggregation to be calculated over.

    1m

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    btc-usd

    Field
    Description

    aggregate

    The period of calculation.

    class

    The class of instrument.

    close

    Closing price of interval. null when no trades reported.

    cURL requests are intended for testing purposes only.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_ohlcv_v1" -H "accept: application/json" -H "X-Api-Key: $your_key" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": { \"exchange\": \"cbse\", \"instrumentClass\": \"spot\", \"code\": \"btc-usd\" }, \"aggregate\": \"1m\"}"

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK here, where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 1 Aggregations]

    • Level 1 & Level 2 Data [Level 1 Tick-Level]

    • Level 1 & Level 2 Data [Level 2 Aggregations]

    • Level 1 & Level 2 Data [Level 2 Tick-Level]

    DeFi spot ticker packs.

    What is this endpoint for?

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_ohlcv_v1

    Request parameters

    aggregate

     {"aggregate": "1s",
      "class": "spot",
      "close": "60521.02",
      "exchange": "cbse",
      "high": "60528.91",
      "low": "60521.02",
      "open": "60528.91",
      "code": "btc-usd",
      "timestamp": "2024-08-09T13:13:14.347471354Z",
      "uid": "2024-08-09T13:13:13Z",
      "volume": "0.00028618000000000003",
      "sequenceId": "" }

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    Instrument Explorer

    Implied Volatility SVI (Closed Beta)

    This is a closed beta. Please contact your account manager if you'd like to be included in the program.

    What is this endpoint for?

    IV SVI stands for Implied Volatility Surface for Vanilla Instruments. This endpoint distributes the raw data we use to calculate our IV Smile solution.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/iv_svi_parameters_v1

    Parameters

    Parameter
    Description
    Examples
    Field
    Description

    Make sure to read our before starting.

    cURL requests are intended for testing purposes only.

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    exchanges

    Exchanges included.

    timeToExpiry

    Time to expiry.

    atmImpliedVariance

    ATM implied variance.

    atmSkew

    ATM skew.

    leftSlope

    Left slope of IV smile.

    rightSlope

    Right slope of IV smile.

    minImpliedVariance

    Min implied variance.

    currentSpot

    Current spot.

    interestRate

    Interest rate.

    tsEvent

    Event generation timestamp (event created by Kaiko), after normalization.

    assets

    A nested object to configure following properties for your stream:

    • base (String) - The desired base as the underlying of the options.

    • quote (String) - The desired quote as the underlying of the options.

    Explore codes and exchanges in the Instrument Explorer or by using the endpoint.

    btc

    usd

    exchanges

    The desired exchange as source of options data.

    Explore codes and exchanges in the Instrument Explorer or by using the endpoint.

    drbt

    dataStartTime

    Start time of the calculation window used.

    dataEndTime

    End time of the calculation window used.

    expiry

    Expiry date of the instrument.

    # This is a code example. Configure your parameters in the parameter configuration section #
    
    from __future__ import print_function
    import logging
    import os
    
    import grpc
    from google.protobuf.json_format import MessageToJson
    from google.protobuf import duration_pb2
    
    from kaikosdk import sdk_pb2_grpc
    from kaikosdk.core import instrument_criteria_pb2, assets_pb2
    from kaikosdk.stream.aggregates_ohlcv_v1 import request_pb2 as pb_ohlcv
    from kaikosdk.stream.aggregates_vwap_v1 import request_pb2 as pb_vwap
    from kaikosdk.stream.market_update_v1 import request_pb2 as pb_market_update
    from kaikosdk.stream.market_update_v1 import commodity_pb2 as pb_commodity
    from kaikosdk.stream.trades_v1 import request_pb2 as pb_trades
    from kaikosdk.stream.index_v1 import request_pb2 as pb_index
    from kaikosdk.stream.index_multi_assets_v1 import request_pb2 as pb_index_multi_assets
    from kaikosdk.stream.index_forex_rate_v1 import request_pb2 as pb_index_forex_rate
    from kaikosdk.stream.aggregated_quote_v2 import request_pb2 as pb_aggregated_quote
    from kaikosdk.stream.aggregates_spot_exchange_rate_v2 import request_pb2 as pb_spot_exchange_rate
    from kaikosdk.stream.aggregates_direct_exchange_rate_v2 import request_pb2 as pb_direct_exchange_rate
    from kaikosdk.stream.derivatives_instrument_metrics_v1 import request_pb2 as pb_derivatives_instrument_metrics
    from kaikosdk.stream.iv_svi_parameters_v1 import request_pb2 as pb_iv_svi_parameters
    
    
    def iv_svi_parameters_v1_request(channel: grpc.Channel):
        try:
            with channel:
                stub = sdk_pb2_grpc.StreamIvSviParametersServiceV1Stub(channel)
    
                responses = stub.Subscribe(pb_iv_svi_parameters.StreamIvSviParametersRequestV1(
                    assets = assets_pb2.Assets(
                        base = "btc",
                        quote = "usd"
                    ),
                    exchanges = "drbt"
                ))
                for response in responses:
                    print("Received message %s" % (MessageToJson(response, including_default_value_fields = True)))
        except grpc.RpcError as e:
            print(e.details(), e.code())
    
    
    
    def run():
        credentials = grpc.ssl_channel_credentials(root_certificates=None)
        call_credentials = grpc.access_token_call_credentials(os.environ['KAIKO_API_KEY'])
        composite_credentials = grpc.composite_channel_credentials(credentials, call_credentials)
        channel = grpc.secure_channel('gateway-v0-grpc.kaiko.ovh', composite_credentials)
    
        iv_svi_parameters_v1_request(channel)
    
    if __name__ == '__main__':
        logging.basicConfig()
        run()
    
    curl --request POST \
      --url https://gateway-v0-http.kaiko.ovh/api/stream/iv_svi_parameters_v1 \
      --header 'Accept: application/json' \
      --header 'Content-Type: application/json' \
      --header 'X-Api-Key: API_KEY' \
      --data '{"assets":{"base":"btc","quote":"usd"},"exchanges":"drbt"}'

    Fields

    Request examples

    Response Example

    Python quick-start guide
    here
    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    code

    Instrument code, empty when not mapped.

    exchange

    Instrument exchange code.

    sequenceId

    Sequence ID for event. Sortable in lexicographic order.

    id

    Trade ID, empty string when not present.

    price

    Price for the trade.

    tsExchange

    The timestamp provided by the exchange for the transaction.

    tsCollection

    The timestamp for when Kaiko received the trade from the exchange.

    tsEvent

    The timestamp the data became available in the Kaiko system.

    side

    - UNKNOWN: Unknown side (not specified). - BUY: Buy side. - SELL: Sell side. See "taker_side_sell" Explained

    here
    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    exchange

    The exchange the OHLCV is referencing.

    high

    Closing price of interval. null when no trades reported.

    low

    Lowest price during interval. null when no trades reported.

    open

    Opening price of interval. null when no trades reported.

    code

    The instrument code.

    timestamp

    The timestamp for the interval.

    uid

    The unique ID for this delivery.

    volume

    Volume traded in interval. 0 when no trades reported.

    sequenceId

    Not applicable. Null

    guide
    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    exchange

    The exchange the OHLCV is referencing.

    high

    Closing price of interval. null when no trades reported.

    low

    Lowest price during interval. null when no trades reported.

    open

    Opening price of interval. null when no trades reported.

    code

    The instrument code.

    timestamp

    The timestamp for the interval.

    uid

    The unique ID for this delivery.

    volume

    Volume traded in interval. 0 when no trades reported.

    sequenceId

    Not applicable. Null

    guide

    OHLCV

    • Level 1 & Level 2 Data [Level 1 Aggregations Tier]

    • Level 1 & Level 2 Data [Level 1 Tick-Level Tier]

    What is this endpoint for?

    This Stream delivers the OHLCV for an instrument on an exchange in real-time.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_ohlcv_v1

    Request parameters

    Parameter
    Description
    Examples
    Field
    Description

    cURL requests are intended for testing purposes only.

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    exchange

    The exchange the OHLCV is referencing.

    high

    Closing price of interval. null when no trades reported.

    low

    Lowest price during interval. null when no trades reported.

    open

    Opening price of interval. null when no trades reported.

    code

    The instrument code.

    timestamp

    The timestamp for the interval.

    uid

    The unique ID for this delivery.

    volume

    Volume traded in interval. 0 when no trades reported.

    sequenceId

    Not applicable. Null

    Level 1 & Level 2 Data [Level 2 Aggregations Tier]
  • Level 1 & Level 2 Data [Level 2 Tick-Level Tier]

  • CeFi spot ticker packs.

    aggregate

    The period you would like the OHLCV aggregation to be calculated over.

    1m

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    • code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the or .

    cbse

    spot

    btc-usd

    aggregate

    The period of calculation.

    class

    The class of instrument.

    close

    Closing price of interval. null when no trades reported.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_ohlcv_v1" -H "accept: application/json" -H "X-Api-Key: $your_key" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": { \"exchange\": \"cbse\", \"instrumentClass\": \"spot\", \"code\": \"btc-usd\" }, \"aggregate\": \"1m\"}"
     {"aggregate": "1s",
      "class": "spot",
      "close": "60521.02",
      "exchange": "cbse",
      "high": "60528.91",
      "low": "60521.02",
      "open": "60528.91",
      "code": "btc-usd",
      "timestamp": "2024-08-09T13:13:14.347471354Z",
      "uid": "2024-08-09T13:13:13Z",
      "volume": "0.00028618000000000003",
      "sequenceId": "" }

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    exchange: * class: spot instrument: btc-usd

    Response fields

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    here
    guide

    Best bids and asks (top of book)

    Top-of-Book is also known as best bids and asks. It offers the best bid and best asks on an order book, provided in real-time.

    Parameter
    Description
    Examples

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    algo-btc

    Field
    Description

    amount

    • When BEST-BID: The quantity of the base asset that the buyer is willing to purchase

    • When BEST-ASK: The quantity of the base asset the seller has available for sale

    class

    Instrument class, empty when not mapped.

    code

    Instrument code, empty when not mapped.

    This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in hours, seconds, and minutes. Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.

    cURL requests are intended for testing purposes only.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot",  \"code\": \"btx-usd\" }, \"commodities\": [\"SMUC_TOP_OF_BOOK\"]}"

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 1 Tick-Level Tier]

    • Level 1 & Level 2 Data [Level 2 Aggregations Tier]

    • Level 1 & Level 2 Data [Level 2 Tick-Level Tier]

    CeFi derivative ticker packs.

    What is this endpoint for?

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1

    Request parameters

    instrumentCriteria

    {
      "commodity": "SMUC_TOP_OF_BOOK",
      "amount": 6.835e-05,
      "class": "spot",
      "code": "btc-usd",
      "exchange": "cbse",
      "sequenceId": "cqr9icumv1b0afe4cg50",
      "price": 60763.73,
      "tsExchange": {
        "value": "2024-08-09T22:33:23.902971Z"
      },
      "tsCollection": {
        "value": "2024-08-09T22:33:23.916224545Z"
      },
      "tsEvent": "2024-08-09T22:33:23.978211823Z",
      "updateType": "BEST_BID",
      "id": "",
      "additionalProperties": {}
    }
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    Instrument Explorer
    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    exchange

    Instrument exchange code.

    sequenceId

    Sequence ID for event. Sortable in lexicographic order.

    price

    When BEST-BID: The price per unit of the base that the buyer is willing to pay in the quote asset, represented as a scientific notation

    Example: algo-btc

    • base asset = algo

    • quote asset = btc price: 1.96e-06

    For each unit of Algo, the buyer is willing to pay 1.96e-06 BTC, equal to 0.00000196 when converted to a decimal number

    When BEST-ASK: The price per unit of the base that the seller is willing to accept in the quote asset, represented as a scientific notation

    Example: algo-btc

    • base asset = algo

    • quote asset = btc price: 1.97e-06

    For each unit of Algo, the buyer is willing to accept 1.97e-06 BTC, equal to 0.00000197 when converted to a decimal number

    tsExchange

    The timestamp provided by the exchange for the data. Where exchanges do not provide this data, we fill this with tsCollection. This applies to the following exchanges:

    • Bitfinex (bfnx) perpetual-future & spot

    • Binance US (bnus) spot

    • Bitvavo (bvav) spot

    tsCollection

    The timestamp for when Kaiko received the data from the exchange.

    tsEvent

    The timestamp the data became available in the Kaiko system.

    updateType

    BEST_BID - The current best bid BEST_ASK - The current best ask

    additionalProperties

    N/A. Always null

    id

    N/A. Always null

    here

    Exchange-provided metrics

    Available in the "basic" pack of Derivatives Risk Indicators.

    • Kaiko Derivatives Risk Indicators [Advanced]

    • Kaiko Derivatives Risk Indicators [Basic]

    What is this endpoint for?

    This endpoint is part of Derivatives Risk Indicators. It can be used to get risk information such as greeks and IV in real-time.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/derivatives_instrument_metrics_v1

    Parameters

    Parameter
    Description
    Examples
    Field
    Description
    Example
    Field
    Description
    Example
    Field
    Description
    Example

    cURL requests are intended for testing purposes only.

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples, and guidance.

    Bids and asks

    All bids and asks on an exchange's order book. Use Kaiko Stream for real-time tick-level updates, or CSV for backdated information. When you connect, you first receive a full snapshot of the current order book with every bid and ask, followed by continuous real-time updates for every change ("delta") that takes place.

    Parameter
    Description
    Examples

    exchange

    binc

    commodityKind

    Always SDICK_RISK

    SDICK_RISK

    tsCollection

    The timestamp for when Kaiko received the trade from the exchange.

    2024-08-30T10:19:38.044166107Z

    tsEvent

    The timestamp for the interval.

    2024-08-30T10:19:39.206955912Z

    commodity:funding rate

    The current funding rate.

    -0.0000756735759807

    comodity: predicted_funding_rate

    The predicted funding rate for the next period.

    -0.0000845044644161

    commodity: ask

    The best ask price from the order book at the time of funding rate calculation.

    101937.0

    commodity: ask_amount

    The size of the best ask order from the order book at the time of funding rate calculation.

    0.552

    commodity: bid

    The best bid price from the order book at the time of the funding rate calculation.

    101936.0

    commodity: bid_amount

    The size of the best bid order from the order book at the time of funding rate calculation.

    0.396

    commodity: 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)

    140.235

    commodity: open_interest

    The total outstanding number of contracts (units in which open interest metrics are quoted vary by exchange)

    144.817

    tsCollection

    The timestamp for when Kaiko received the trade from the exchange.

    2024-08-30T10:19:38.044166107Z

    tsEvent

    The timestamp for the interval.

    2024-08-30T10:19:39.206955912Z

    commodity: time_to_expiry

    The number of minutes remaining before expiry.

    41504

    commodity: nearby

    The soonest expiring contract with the same base & quote asset on the specified exchange

    boolean value

    commodity: quarterly_nearby

    The soonest expiring quarterly contract with the same base & quote asset on the specified exchange

    boolean value

    commodity: expiry

    Expiration date of the contract

    1737072000000000000

    commodity: 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)

    2047.3

    commodity: open_interest

    The total outstanding number of contracts (units in which open interest metrics are quoted vary by exchange)

    6813.4

    commodity: ask

    The price level of the best ask order from the order book at the time of message receipt.

    97890.1

    commodity: ask_amount

    The size of the best ask order from the order book at the time of the message.

    0.552

    commodity: bid

    The price level of the best bid order from the order book at the time of message receipt.

    97878.4

    commodity: bid_amount

    The size of the best bid order from the order book at the time of the message.

    0.396

    tsCollection

    The timestamp for when Kaiko received the trade from the exchange.

    2024-08-30T10:19:38.044166107Z

    tsEvent

    The timestamp for the interval.

    2024-08-30T10:19:39.206955912Z

    commodity: time_to_expiry

    The number of minutes remaining before expiry.

    41504

    commodity: nearby

    The soonest expiring contract with the same base & quote asset on the specified exchange

    boolean value

    commodity: quarterly_nearby

    The soonest expiring quarterly contract with the same base & quote asset on the specified exchange

    boolean value

    commodity: ask_iv

    Implied volatility for the best ask.

    0.8166587

    commodity: bid_iv

    Implied volatility for the best bid.

    0.6817713

    commodity: mark_iv

    The implied volatility for the mark price.

    0.7418202

    commodity: delta

    The delta value for the option.

    -1.6532715362206545

    commodity: gamma

    The gamma value for the option.

    3.7235607858486044

    commodity: rho

    The rho value for the option.

    16.74149

    commodity: theta

    The theta value for the option.

    0.0002888

    commodity: vega

    The vega value for the option.

    0.0006550

    commodity: strike_price

    The strike price of the contract in USD

    90000

    commodity: underlying_index

    Name of the underlying index

    BTC-31JAN25

    commodity: kind

    Put or Call

    C

    commodity: expiry

    Expiry

    1738281600000000000

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) . The instrument must be a derivative class.

    • code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the or .

    cbse

    option

    algo-btc

    commodities

    AlwaysSDICK_RISK

    SDICK_RISK

    Value

    The value for the commodity in the received message. eg: 24h_volume or price

    59583.2

    legacySymbol

    Exchange assigned instrument identifier

    BTCUSDC_PERP

    Value

    The value for the commodity in the received message. eg: 24h_volume or price

    59583.2

    commodityKind

    Always SDICK_RISK

    SDICK_RISK

    Value

    The value for the commodity (price, 24 hour volume etc) received in the message.

    59583.2

    commodityKind

    Always SDICK_RISK

    SDICK_RISK

    # This is a code example. Configure your parameters in the parameter configuration section #
    
    from __future__ import print_function
    import logging
    import os
    
    import grpc
    from google.protobuf.json_format import MessageToJson
    from google.protobuf import duration_pb2
    
    from kaikosdk import sdk_pb2_grpc
    from kaikosdk.core import instrument_criteria_pb2, assets_pb2
    from kaikosdk.stream.aggregates_ohlcv_v1 import request_pb2 as pb_ohlcv
    from kaikosdk.stream.aggregates_vwap_v1 import request_pb2 as pb_vwap
    from kaikosdk.stream.market_update_v1 import request_pb2 as pb_market_update
    from kaikosdk.stream.market_update_v1 import commodity_pb2 as pb_commodity
    from kaikosdk.stream.trades_v1 import request_pb2 as pb_trades
    from kaikosdk.stream.index_v1 import request_pb2 as pb_index
    from kaikosdk.stream.index_multi_assets_v1 import request_pb2 as pb_index_multi_assets
    from kaikosdk.stream.index_forex_rate_v1 import request_pb2 as pb_index_forex_rate
    from kaikosdk.stream.aggregated_quote_v2 import request_pb2 as pb_aggregated_quote
    from kaikosdk.stream.aggregates_spot_exchange_rate_v2 import request_pb2 as pb_spot_exchange_rate
    from kaikosdk.stream.aggregates_direct_exchange_rate_v2 import request_pb2 as pb_direct_exchange_rate
    from kaikosdk.stream.derivatives_instrument_metrics_v1 import request_pb2 as pb_derivatives_instrument_metrics
    from kaikosdk.stream.iv_svi_parameters_v1 import request_pb2 as pb_iv_svi_parameters
    
    
    
    def derivatives_instrument_metrics_request(channel: grpc.Channel):
        try:
            with channel:
                stub = sdk_pb2_grpc.StreamDerivativesInstrumentMetricsServiceV1Stub(channel)
    
                responses = stub.Subscribe(pb_derivatives_instrument_metrics.StreamDerivativesInstrumentMetricsRequestV1(
                    instrument_criteria = instrument_criteria_pb2.InstrumentCriteria(
                    # Start of parameter configuration #
                        exchange = "okex",
                        instrument_class = "perpetual-future",
                        code = "btc-usdt"
                    ),
                    commodities = [
                    "SDICK_RISK"
                ]
                ))
                    # End of parameter configuration #
                for response in responses:
                    print("Received message %s" % (MessageToJson(response, including_default_value_fields = True)))
        except grpc.RpcError as e:
            print(e.details(), e.code())
    
    
    def run():
        credentials = grpc.ssl_channel_credentials(root_certificates=None)
        call_credentials = grpc.access_token_call_credentials(os.environ['KAIKO_API_KEY'])
        composite_credentials = grpc.composite_channel_credentials(credentials, call_credentials)
        channel = grpc.secure_channel('gateway-v0-grpc.kaiko.ovh', composite_credentials)
    
        derivatives_instrument_metrics_request(channel)
    
    if __name__ == '__main__':
        logging.basicConfig()
        run()
    
    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/derivatives_instrument_metrics_v1" \
    -H "accept: application/json" \
    -H "X-Api-Key: $kaiko_api_key" \
    -H "Content-Type: application/json" \
    -d "{ \"instrumentCriteria\": {  \"exchange\": \"okex\",  \"instrumentClass\": \"perpetual-future\",  \"code\": \"btc-usdt\" }}"
    {
      "value": "-0.0000345359072087",
      "legacySymbol": "btcusdtswap",
      "exchange": "okex",
      "commodity": "funding_rate",
      "commodityKind": "SDICK_RISK",
      "tsCollection": "2024-12-18T13:15:43.861660474Z",
      "tsEvent": "2024-12-18T13:15:45.456011570Z"
    }
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument or exchange in the same stream. Use a * in place of the relevant exchange or class parameter.

    For example, the configuration below would deliver all perpetual future contracts on OkEX. exchange: okex class: perpetual-future instrument: *

    Fields: Perpetual Future

    Fields: Future

    Fields: Option

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    here
    guide

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    cbse

    spot

    algo-btc

    Field
    Description

    class

    Instrument class, empty when not mapped.

    code

    Instrument code, empty when not mapped.

    exchange

    Instrument exchange code.

    This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in hours, seconds, and minutes.

    Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.

    cURL requests are intended for testing purposes only.

    #Live
    
    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": { \"exchange\": \"cbse\", \"instrumentClass\": \"spot\", \"code\": \"algo-btc\"}}"
    
    
    #Replay/Historical Data
    
    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_replay_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot\",  \"code\": \"algo-btc\" }, \"interval\": { \"startTime\": \"2025-01-14T12:00:00.000Z\", \"endTime\": \"2025-01-14T18:00:00.000Z\" }}"

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    This data is included in the following Kaiko packages:

    • Level 1 & Level 2 Data [Level 2 Tick-Level Tier]

    CeFi derivative ticker packs.

    What is this endpoint for?

    When you subscribe, you'll initially receive a full snapshot within a few seconds, followed by all subsequent tick-level updates. If you receive another full snapshot, replace your local snapshot with the new one. This should happen infrequently and only occurs if we detect a consistency issue, such as a lost connection to the exchange or the exchange being down for some time.

    If you receive an update with an amount of 0, you should remove the corresponding price level from your local order book. You'll occasionally receive a 0 message for a price level that doesn't exist in your local order book - this can be safely ignored and is due to various exchange limitations.

    The order book should not be considered valid until all updates with the same tsExchange have been applied to your local order book, meaning all potential messages from the same update batch have been processed.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_v1
    https://gateway-v0-http.kaiko.ovh/api/stream/orderbookl2_replay_v1

    Request parameters

    Received message {"class":"spot",
    "code":"bch-eur",
    "exchange":"cbse",
    "sequenceId":"cu2o2sokocas72q8rkq0",
    "updateType":"SNAPSHOT",
    "asks":[
      {
        "amount":0.02778327,
        "price":414.07
      },
      {
        "amount":0.4,
        "price":414.08
      }
    ],
    "bids":[
      {
        "amount":0.4,
        "price":413.93
      },
      {
        "amount":0.0277962,
        "price":413.85
      } ],
    "tsExchange":{
      "value":"2025-01-13T21:11:15.064Z"
    },
    "tsCollection":{
      "value":"2025-01-13T21:11:15.064284559Z"
    },
    "tsEvent":"2025-01-13T21:11:15.260258142Z",
    "additionalProperties":{}
    }
    
    Received message {"class":"spot",
    "code":"bch-eur",
    "exchange":"cbse",
    "sequenceId":"cu2o2sokocas72q8rla0",
    "updateType":"UPDATE",
    "asks":[
      {
        "amount":4,
        "price":414.42
      }
      ],
    "bids":[],
    "tsExchange":{
      "value":"2025-01-13T21:11:15.016291Z"
    },
    "tsCollection":{
      "value":"2025-01-13T21:11:15.086529551Z"
    },
    "tsEvent":"2025-01-13T21:11:15.277722255Z",
    "additionalProperties":{}
    }
    
    Received message {"class":"spot",
    "code":"bch-eur",
    "exchange":"cbse",
    "sequenceId":"cu2o2sokocas72q8t9q0",
    "updateType":"UPDATE",
    "asks":[],
    "bids":[
      {
        "amount":0,
        "price":413.85
      },
      {
        "amount":0.02779016,
        "price":413.94
      }
      ],
    "tsExchange":{
      "value":"2025-01-13T21:11:15.235251Z"
      },
    "tsCollection":{
      "value":"2025-01-13T21:11:15.248921649Z"
      },
    "tsEvent":"2025-01-13T21:11:15.635226002Z",
    "additionalProperties":{}
    }
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    Response fields

    Request examples

    Response Example

    Derivatives pricing

    Derivatives price endpoint.

    • Kaiko Derivatives Risk Indicators [Advanced]

    • Kaiko Derivatives Risk Indicators [Basic]

    What is this endpoint for?

    This endpoint can be used to get pricing information related to derivatives contracts.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/derivatives_instrument_metrics_v1

    Request parameters

    Parameter
    Description
    Examples
    Field
    Description
    Example

    cURL requests are intended for testing purposes only.

    Information from this endpoint can be accessed through Google BigQuery. To get started, read our .

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples, and guidance.

    Best bids and asks (top of book)

    • Level 1 & Level 2 Data [Level 1 Tick-Level Tier]

    • Level 1 & Level 2 Data [Level 2 Aggregations Tier]

    What is this endpoint for?

    Top-of-Book is also known as best bids and asks. It offers the best bid and best asks on an order book, provided in real-time.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1

    Request parameters

    Parameter
    Description
    Examples
    Field
    Description

    This example demonstrates how to request historical data using replay. The maximum amount of data you can request for one replay cannot exceed a total of 24 hours in hours, seconds, and minutes. Replay data is available on a 72-hour rolling basis and should only be used to retrieve missed data. If full history is required, please use Rest API or CSV deployment methods.

    cURL requests are intended for testing purposes only.

    Instrument Explorer
    Supported Exchanges

    exchange

    binc

    commodity

    The price of the underlying index, often as a weighted average across multiple exchanges' spot prices

    index_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.

    mark_price

    Most recent traded price of derivative contract.

    price

    commodityKind

    Always SDICK_PRICE

    SDICK_PRICE

    tsCollection

    The timestamp for when Kaiko received the trade from the exchange.

    2024-08-30T10:19:38.044166107Z

    tsEvent

    The timestamp for the interval.

    2024-08-30T10:19:39.206955912Z

    Reference Data [Advanced tier]

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) . The instrument must be a derivative class.

    • code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the or via API.

    cbse

    option

    algo-btc

    commodities

    AlwaysSDICK_PRICE

    SDICK_PRICE

    value

    The value for the commodity (price, 24 hour volume etc) received in the message.

    59583.2

    legacySymbol

    Exchange assigned Instrument identifier

    btcusdcperpetual

    # This is a code example. Configure your parameters in the parameter configuration section #
    
    from __future__ import print_function
    import logging
    import os
    
    import grpc
    from google.protobuf.json_format import MessageToJson
    from google.protobuf import duration_pb2
    
    from kaikosdk import sdk_pb2_grpc
    from kaikosdk.core import instrument_criteria_pb2, assets_pb2
    from kaikosdk.stream.aggregates_ohlcv_v1 import request_pb2 as pb_ohlcv
    from kaikosdk.stream.aggregates_vwap_v1 import request_pb2 as pb_vwap
    from kaikosdk.stream.market_update_v1 import request_pb2 as pb_market_update
    from kaikosdk.stream.market_update_v1 import commodity_pb2 as pb_commodity
    from kaikosdk.stream.trades_v1 import request_pb2 as pb_trades
    from kaikosdk.stream.index_v1 import request_pb2 as pb_index
    from kaikosdk.stream.index_multi_assets_v1 import request_pb2 as pb_index_multi_assets
    from kaikosdk.stream.index_forex_rate_v1 import request_pb2 as pb_index_forex_rate
    from kaikosdk.stream.aggregated_quote_v2 import request_pb2 as pb_aggregated_quote
    from kaikosdk.stream.aggregates_spot_exchange_rate_v2 import request_pb2 as pb_spot_exchange_rate
    from kaikosdk.stream.aggregates_direct_exchange_rate_v2 import request_pb2 as pb_direct_exchange_rate
    from kaikosdk.stream.derivatives_instrument_metrics_v1 import request_pb2 as pb_derivatives_instrument_metrics
    from kaikosdk.stream.iv_svi_parameters_v1 import request_pb2 as pb_iv_svi_parameters
    
    
    
    def derivatives_instrument_metrics_request(channel: grpc.Channel):
        try:
            with channel:
                stub = sdk_pb2_grpc.StreamDerivativesInstrumentMetricsServiceV1Stub(channel)
    
                responses = stub.Subscribe(pb_derivatives_instrument_metrics.StreamDerivativesInstrumentMetricsRequestV1(
                    instrument_criteria = instrument_criteria_pb2.InstrumentCriteria(
                    # Start of parameter configuration #
                        exchange = "okex",
                        instrument_class = "perpetual-future",
                        code = "btc-usdt"
                    ),
                    commodities = [
                    "SDICK_PRICE"
                ]
                ))
                    # End of parameter configuration #
                for response in responses:
                    print("Received message %s" % (MessageToJson(response, including_default_value_fields = True)))
        except grpc.RpcError as e:
            print(e.details(), e.code())
    
    
    def run():
        credentials = grpc.ssl_channel_credentials(root_certificates=None)
        call_credentials = grpc.access_token_call_credentials(os.environ['KAIKO_API_KEY'])
        composite_credentials = grpc.composite_channel_credentials(credentials, call_credentials)
        channel = grpc.secure_channel('gateway-v0-grpc.kaiko.ovh', composite_credentials)
    
        derivatives_instrument_metrics_request(channel)
    
    if __name__ == '__main__':
        logging.basicConfig()
        run()
    
    ``
    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/derivatives_instrument_metrics_v1" \
    -H "accept: application/json" \
    -H "X-Api-Key: $kaiko_api_key" \
    -H "Content-Type: application/json" \
    -d "{ \"instrumentCriteria\": {  \"exchange\": \"okex\",  \"instrumentClass\": \"perpetual-future\",  \"code\": \"btc-usdt\" }}"
    {
      "value": "104741.3",
      "legacySymbol": "btcusdtswap",
      "exchange": "okex",
      "commodity": "index_price",
      "commodityKind": "SDICK_PRICE",
      "tsCollection": "2024-12-18T12:57:14.310736661Z",
      "tsEvent": "2024-12-18T12:57:15.598328558Z"
    }
    {
      "value": "104780.2",
      "legacySymbol": "btcusdtswap",
      "exchange": "okex",
      "commodity": "mark_price",
      "commodityKind": "SDICK_PRICE",
      "tsCollection": "2024-12-18T12:57:14.293738809Z",
      "tsEvent": "2024-12-18T12:57:15.599742192Z"
    }
    {
      "value": "104778.6",
      "legacySymbol": "btcusdtswap",
      "exchange": "okex",
      "commodity": "price",
      "commodityKind": "SDICK_PRICE",
      "tsCollection": "2024-12-18T12:57:14.322458748Z",
      "tsEvent": "2024-12-18T12:57:15.610571665Z"
    }
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument or exchange in the same stream. Use a * in place of the relevant exchange or class parameter.

    For example, the configuration below would deliver all perpetual future contracts on OkEX. exchange: okex class: perpetual-future instrument: *

    Response fields

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    here
    guide

    exchange

    Instrument exchange code.

    sequenceId

    Sequence ID for event. Sortable in lexicographic order.

    price

    When BEST-BID: The price per unit of the base that the buyer is willing to pay in the quote asset, represented as a scientific notation

    Example: algo-btc

    • base asset = algo

    • quote asset = btc price: 1.96e-06

    tsExchange

    The timestamp provided by the exchange for the data. Where exchanges do not provide this data, we fill this with tsCollection. This applies to the following exchanges:

    • Bitfinex (bfnx) perpetual-future & spot

    • Binance US (bnus) spot

    tsCollection

    The timestamp for when Kaiko received the data from the exchange.

    tsEvent

    The timestamp the data became available in the Kaiko system.

    updateType

    BEST_BID - The current best bid BEST_ASK - The current best ask

    additionalProperties

    N/A. Always null

    id

    N/A. Always null

    For more advanced users, you can access our full SDK here, where you'll find more coding languages, examples and guidance.
    Level 1 & Level 2 Data [Level 2 Tick-Level Tier]

    CeFi spot ticker packs.

    instrumentCriteria

    A nested object to configure following properties for your stream:

    • exchange (String) - The code(s) for the exchange(s)

    • instrument_class (String) - The class(es) of the instrument(s) .

    • code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the or .

    cbse

    spot

    algo-btc

    amount

    • When BEST-BID: The quantity of the base asset that the buyer is willing to purchase

    • When BEST-ASK: The quantity of the base asset the seller has available for sale

    class

    Instrument class, empty when not mapped.

    code

    Instrument code, empty when not mapped.

    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"instrumentCriteria\": {  \"exchange\": \"cbse\",  \"instrumentClass\": \"spot",  \"code\": \"btx-usd\" }, \"commodities\": [\"SMUC_TOP_OF_BOOK\"]}"
    {
      "commodity": "SMUC_TOP_OF_BOOK",
      "amount": 6.835e-05,
      "class": "spot",
      "code": "btc-usd",
      "exchange": "cbse",
      "sequenceId": "cqr9icumv1b0afe4cg50",
      "price": 60763.73,
      "tsExchange": {
        "value": "2024-08-09T22:33:23.902971Z"
      },
      "tsCollection": {
        "value": "2024-08-09T22:33:23.916224545Z"
      },
      "tsEvent": "2024-08-09T22:33:23.978211823Z",
      "updateType": "BEST_BID",
      "id": "",
      "additionalProperties": {}
    }
    

    Configuring a wildcard

    A wildcard allows you to request all information we have on a specific instrument, class, or exchange in the same stream. Use a * in place of the relevant exchange, instrument, or class parameter.

    For example, the configuration below would deliver trades for BTC/USD across all exchanges where it’s supported:

    exchange: * class: spot instrument: btc-usd

    Response fields

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    code (String) - The Kaiko code for the instrument.

    Explore instruments, codes and exchanges in the Instrument Explorer or .

    exchange: * class: spot instrument: btc-usd

    sequenceId

    Sequence ID for event. Sortable in lexicographic order.

    updateType

    SNAPSHOT - A new Snapshot of the order book UPDATED- A new batch of bids & asks since the snapshot

    asks

    Represents sell orders

    amount: the quantity of the base asset available for sale

    price: the price per unit of the base that the seller is willing to accept in the quote asset, represented as a scientific notation Example: algo-btc

    • base asset = algo

    • quote asset = btc amount : 42656.0 price: 1.97e-06

    • The asker has 42656.0 Algo available

    • For each unit of Algo, the buyer is willing to accept 1.97e-06 BTC, equal to 0.00000197 when converted to a decimal number

    bids

    Represents buy orders.

    amount: the quantity of the base asset the buyer is willing to purchase

    price: the price per unit of the base that the buyer is willing to pay in the quote asset, represented as a scientific notation Example: algo-btc

    • base asset = algo

    • quote asset = btc amount : 80569.0 price: 1.96e-06

    • The buyer will purchase up to 80569.0 Algo

    • For each unit of Algo, the buyer is willing to pay 1.96e-06 BTC, equal to 0.00000196 when converted to a decimal number

    tsExchange

    The timestamp provided by the exchange for the data. Where exchanges do not provide this data, we fill this with tsCollection. This applies to the following exchanges:

    • Bitfinex (bfnx)

    • Bitflyer (bfly)

    • CEX.io (cexi)

    tsCollection

    The timestamp for when Kaiko received the data from the exchange.

    tsEvent

    The timestamp the data became available in the Kaiko system.

    here
    Instrument Explorer
    Supported Exchanges

    For each unit of Algo, the buyer is willing to pay 1.96e-06 BTC, equal to 0.00000196 when converted to a decimal number

    When BEST-ASK: The price per unit of the base that the seller is willing to accept in the quote asset, represented as a scientific notation

    Example: algo-btc

    • base asset = algo

    • quote asset = btc price: 1.97e-06

    For each unit of Algo, the buyer is willing to accept 1.97e-06 BTC, equal to 0.00000197 when converted to a decimal number

    Bitvavo (bvav) spot

    Instrument Explorer

    Direct price

    • Kaiko Fair Market Value [Established Assets]

    • Kaiko Fair Market Value [Full Coverage]

    What is this endpoint for?

    This endpoint returns a price calculation for a specific pair by aggregating prices from our trading data. The computation works as follows:

    1. Listen to trades from all selected exchanges where the instrument is actively traded.

    2. Compute RWM price. The computation is based on two principles:

      • A robust aggregation of prices (derived from a weighted median methodology: full details available here)

      • An incremental increase of the estimation window seeking for sufficient dataset to compute a robust price (e.g. number of trades under a certain threshold)

    At the end of the computation, in case there are still no trades, a null value will be returned. In this instance, we'd recommend using .

    Read the full methodology .

    Parameter
    Description
    Examples
    Mandatory?
    Field
    Description

    Make sure to read our before starting.

    cURL requests are intended for testing purposes only.

    For more advanced users, you can access our full SDK , where you'll find more coding languages, examples and guidance.

    1s

    assets

    A nested object to configure following properties for your stream:

    • base - the base asset you'd like your price to be based on

    • quote - the asset you'd like the price to be quoted in

    Explore instruments, codes and exchanges in the or .

    btc usd

    extrapolate_missing_values

    This parameter is set to false by default. Setting it to true means that if there is no trade price available from the calculation window you configured, the last available price (from outside the window) will be used.

    false

    window

    A nested object containing the following fields:

    • startTime - The start of the calculation window for this Cross Price

    • endTime - The end of the calculation window for this Cross Price

    noTrade

    If false a price was able to be calculated within the window provided. If true the extrapolate_missing_values parameter was needed to calculate a price.

    window

    The window on which you would like your Cross Price to be calculated. Available windows: 1s, 5s, 15s, 30s, 60s, 300s

    5s

    update_frequency

    assets

    The base and quote assets as configured above.

    price

    The calculated Cross Price.

    timestamp

    The time the Cross Price was calculated.

     # This is a code example. Configure your parameters in the parameter configuration section #
    
    from __future__ import print_function
    import logging
    import os
    
    import grpc
    from google.protobuf.json_format import MessageToJson
    from google.protobuf import duration_pb2
    
    from kaikosdk import sdk_pb2_grpc
    from kaikosdk.core import instrument_criteria_pb2, assets_pb2
    from kaikosdk.stream.aggregates_ohlcv_v1 import request_pb2 as pb_ohlcv
    from kaikosdk.stream.aggregates_vwap_v1 import request_pb2 as pb_vwap
    from kaikosdk.stream.market_update_v1 import request_pb2 as pb_market_update
    from kaikosdk.stream.market_update_v1 import commodity_pb2 as pb_commodity
    from kaikosdk.stream.trades_v1 import request_pb2 as pb_trades
    from kaikosdk.stream.index_v1 import request_pb2 as pb_index
    from kaikosdk.stream.index_multi_assets_v1 import request_pb2 as pb_index_multi_assets
    from kaikosdk.stream.index_forex_rate_v1 import request_pb2 as pb_index_forex_rate
    from kaikosdk.stream.aggregated_quote_v2 import request_pb2 as pb_aggregated_quote
    from kaikosdk.stream.aggregates_spot_exchange_rate_v2 import request_pb2 as pb_spot_exchange_rate
    from kaikosdk.stream.aggregates_direct_exchange_rate_v2 import request_pb2 as pb_direct_exchange_rate
    
    def aggregates_direct_exchange_rate_request(channel: grpc.Channel):
        try:
            with channel:
                stub = sdk_pb2_grpc.StreamAggregatesSpotDirectExchangeRateV2ServiceV1Stub(channel)
    
    ##Configure your window and frequency ##
                window = duration_pb2.Duration()
                window.FromSeconds(5)
    
                update_frequency = duration_pb2.Duration()
                update_frequency.FromSeconds(2)
    
                responses = stub.Subscribe(pb_direct_exchange_rate.StreamAggregatesDirectExchangeRateV2RequestV1(
    
    ##Configure your assets##
                    assets = assets_pb2.Assets(
                        base = "btc",
                        quote = "usd"
                    ),
                    window = window,
                    update_frequency = update_frequency
                ))
                for response in responses:
                    print("Received message %s" % (MessageToJson(response, including_default_value_fields = True)))
        except grpc.RpcError as e:
            print(e.details(), e.code())
            
    def run():
        credentials = grpc.ssl_channel_credentials(root_certificates=None)
        call_credentials = grpc.access_token_call_credentials(os.environ['KAIKO_API_KEY'])
        composite_credentials = grpc.composite_channel_credentials(credentials, call_credentials)
        channel = grpc.secure_channel('gateway-v0-grpc.kaiko.ovh', composite_credentials)
    
        aggregates_direct_exchange_rate_request(channel)
    
    if __name__ == '__main__':
        logging.basicConfig()
        run()
    
    curl -X POST "https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_spot_direct_exchange_rate_v2" -H "accept: application/json" -H "X-Api-Key: $KAIKO_API_KEY" -H "Content-Type: application/json" -d "{ \"assets\": { \"base\": \"btc\", \"quote\": \"usd\" }, \"window\": \"10s\"}"
     "assets": {
        "base": "btc",
        "quote": "usd"
      },
      "price": 59394.87,
      "timestamp": "2024-08-12T11:14:58.022023572Z",
      "window": {
        "startTime": "2024-08-12T11:14:48Z",
        "endTime": "2024-08-12T11:14:58Z",
        "duration": "10s"
      },
      "noTrade": false
    }
    

    While Fair Market Value Pricing includes fiat conversions, our Oanda FX Rates add-on endpoint ensures IFRS-compliant, auditable conversions for non-USD fiat currencies.

    Endpoints

    gateway-v0-grpc.kaiko.ovh
    gateway-v0-http.kaiko.ovh
    https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_spot_direct_exchange_rate_v2

    Parameters

    Exchanges that send their trades late may not be captured in the given sliding window.

    Fields

    Request examples

    Response Example

    This data is included in the following Kaiko packages:

    Cross Prices
    here
    Python quick-start guide
    here

    How regularly you would like to receive your pricing updates. Available frequencies: 1s, 5s, 10s, 30s, and 1m

    Duration - The window as configured above
    Instrument Explorer
    Reference API
    Reference API
    https://github.com/kaikodata/kaiko-sdk-examples/blob/master/python/code-example/orderbookl2_v1_replay_request.py
    https://github.com/kaikodata/kaiko-sdk-examples/blob/master/python/code-example/orderbookl2_v1_replay_request.py