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:
Retrieve the last available optimal liquidity path
Listen to trades for all intermediary pairs from all covered exchanges where the instrument is actively traded
Compute RWM price for each intermediary pair
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 .
btceur
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()
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.
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
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 .
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.
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.
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
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.
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 .
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.
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.0price: 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.0price: 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
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.
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:
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 .
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:
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.
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.
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:
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.
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.
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.
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.
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:
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.
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()
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:
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.
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:
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
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()
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:
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.
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.
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.
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.
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()
``
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:
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
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.
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.0price: 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.0price: 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.
This endpoint returns a price calculation for a specific pair by aggregating prices from our trading data.
The computation works as follows:
Listen to trades from all selected exchanges where the instrument is actively traded.
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 .
btcusd
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()
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.