Kaiko Stream SDK v1.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
At its core, Stream enables our clients to build custom market data feeds through simple and intuitive commands with a light infrastructure cost, by leveraging gRPCS Protocol and its capabilities… This first-of-its-kind data service is designed to connect institutional investors with consolidated cryptocurrency market data feeds that match the infrastructural robustness of traditional financial data products.
Code Examples
Code examples in C++, C#, Go, Java, Node, Python, Scala as well as the API references for each language can be found here
Base URLs:
-
https://gateway-v0-http.kaiko.ovh (Swagger playground)
-
https://gateway-v0-grpc.kaiko.ovh (gRPC Production)
ICE
To connect to our services through ICE instead of internet, you need to disable TLS and use the HTTP port 80.
Base URLS:
- http://stream-http.ice.kaiko.com (Swagger Playground)
- http://stream.ice.kaiko.com (gRPC Production)
Authentication
- API Key (ApiKeyAuth)
- Parameter Name: X-Api-Key, in: header.
Instrument Selection
Kaiko’s instruments can be selected and filtered using globbing patterns, constructed from a set of parameters with optional wildcards. A single string can be used to select an arbitrary set of instruments.
Glob Patterns Examples
Assumption: Available Instruments for the subsequent examples:
[
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "btc-usd"
},
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "eth-usd"
},
{
"exchange": "cbse", "instrument_class": "spot", "instrument": "eth-btc"
},
{
"exchange": "okex", "instrument_class": "future", "instrument": "btc_usd__this_week"
}
]
btc-usd
spot
market forkrkn
exchange:krkn:spot:btc-usd
[
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "btc-usd"
}
]
The general format for passing a glob pattern is as follows:
pattern = <exchange>:<instrument_class>:<instrument>
Parameter | Description |
---|---|
exchange |
List1 of Exchange code . See Exchanges Reference Data Endpoint. |
instrument_class |
List1 of Instrument class . See Instruments Reference Data Endpoint. |
instrument |
List1 of Instrument code . See Instruments Reference Data Endpoint. |
1: Lists are comma separated
Wildcard
All
spot
markets forkrkn
exchange:krkn:spot:*
[
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "btc-usd"
},
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "eth-usd"
}
]
All instruments for
krkn
that havebtc
as part of the instrument code:krkn:*:*btc*
[
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "btc-usd"
}
]
Kaiko Instrument Globbing allows the use of the wildcard *
.
It can replace any parameter of the pattern:
<exchange>:<instrument_class>:*
<exchange>:*:<instrument>
*:<instrument_class>:<instrument>
It can also be used inside a parameter:
instrument
:btc-*
will match all instruments withbtc
as base asset.
Cartesian Product of Patterns
All
krkn
andokex
instruments that haveusd
as part of the instrument code:krkn,okex:*:*usd*
[
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "btc-usd"
},
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "eth-usd"
},
{
"exchange": "okex", "instrument_class": "future", "instrument": "btc_usd__this_week"
}
]
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:instrument2
Union of Patterns
All
krkn
andcbse
instruments that havebtc
as part of the instrument code plus thekrkn:spot:eth-usd
instrument:krkn,cbse:*:*btc*+krkn:spot:eth-usd
[
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "btc-usd"
},
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "eth-usd"
},
{
"exchange": "cbse", "instrument_class": "spot", "instrument ": "eth-btc"
}
]
Multiple patterns can also be combined with the +
operator:
pattern = pattern1+pattern2
where:
pattern1 = <exchange1>:<instrument_class1>:<instrument1>
pattern2 = <exchange2>:<instrument_class2>:<instrument2>
Aggregated Quote (v2)
Subscribe
Retrieve ongoing Top Of Book (Ask or Bid) average price updates accross a selection of vetted exchanges, for a given instrument.
Wildcard (*
) is not supported, but you can provide a comma separated list of instruments codes (for example: “btc-usd,eth-usd” as code
field).
An empty value can be returned when there are no changes on best ask or best bid across exchanges where the requested instrument is listed. This allows checking that the service is working as expected even though no meaningful update is sent.
The update frequency is 1s.
The default price you get is vetted
(meaning using only the exchanges that are part of Kaiko Exchange Ranking).
If your asset is not covered by this list, you can opt in includeUnvettedPrice
request parameter to true
to have a second price computed using all exchange covered by Kaiko, whose result will be under the field unvetted
of response.
Note that Kaiko Exchange Ranking list is changing from quarter to quarter, so if there an asset that is only covered by 1 exchange and this 1 exchange gets out of Exchange Ranking at some point, the only way to keep having a price is by setting includeUnvettedPrice
accordingly as a backup price.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/aggregated_quote_v2 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"instrumentClass":"string","code":"string","interval":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"},"includeUnvettedPrice":true}'
POST /api/stream/aggregated_quote_v2
Body parameter
{
"instrumentClass": "string",
"code": "string",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"includeUnvettedPrice": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamAggregatedQuoteRequestV2 | true | none |
Example responses
200 Response
{
"result": {
"aggregate": "string",
"instrumentClass": "string",
"code": "string",
"eventType": "UNKNOWN",
"tsEvent": "2019-08-24T14:15:22Z",
"vetted": {
"price": "string",
"volume": "string"
},
"unvetted": {
"price": "string",
"volume": "string"
}
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamAggregatedQuoteResponseV2
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamAggregatedQuoteResponseV2 | false | none | none |
Enumerated Values
Property | Value |
---|---|
eventType | UNKNOWN |
eventType | BEST_ASK |
eventType | BEST_BID |
Aggregated Quote (v1)
Subscribe
Retrieve ongoing Top Of Book (Ask or Bid) average price updates accross a selection of exchanges, for a given instrument.
Wildcard (*
) is not supported, but you can provide a comma separated list of instruments codes (for example: “btc-usd,eth-usd” as code
field).
An empty value can be returned when there are no changes on best ask or best bid across exchanges where the requested instrument is listed. This allows checking that the service is working as expected even though no meaningful update is sent.
The update frequency is 5s.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/aggregated_price_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"instrumentClass":"string","code":"string","interval":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"}}'
POST /api/stream/aggregated_price_v1
Body parameter
{
"instrumentClass": "string",
"code": "string",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamAggregatedPriceRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"aggregate": "string",
"instrumentClass": "string",
"code": "string",
"value": {
"price": "string",
"volume": "string"
},
"eventType": "UNKNOWN",
"tsEvent": "2019-08-24T14:15:22Z"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamAggregatedPriceResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamAggregatedPriceResponseV1 | false | none | none |
Enumerated Values
Property | Value |
---|---|
eventType | UNKNOWN |
eventType | BEST_ASK |
eventType | BEST_BID |
OHLCV (Candles)
Subscribe
Retrieve ongoing Open-High-Low-Close-Volume candle updates. Supported intervals are 1s, 1m and 1h.
Event Sending Rate
Please note that an event is not sent for every trades on the feed for a given exchange/instrument. Feed consumers should treat each event update as an absolute representation, indicating the precise values of data aggregation at the time it is sent. Each update represents an accurate aggregation at a specific point in time. This implies that there must be at least one tick between two consecutive events for a given exchange/symbol, though there may be more.
Duplicate Events
For OHLCV/VWAP, duplicate events may be sent due to the way data is aggregated in our centralized datastore. This means that for two consecutive events for a given exchange/code, the first event might contain an aggregated result that includes ticks inserted before we sent an update message. This can result in duplicates for the subsequent update since it has already been accounted for in the aggregation of the first event. It is important to note that this does not indicate inaccurate data, as we consistently provide accurate real-time information. Instead, it represents high trading volume being ingested rapidly, which is actually a positive aspect, as it keeps you up-to-date with the latest developments on the exchanges. In some instances, our updates may even be faster.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_ohlcv_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"instrumentCriteria":{"exchange":"string","instrumentClass":"string","code":"string"},"aggregate":"string"}'
POST /api/stream/aggregates_ohlcv_v1
Body parameter
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
},
"aggregate": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamAggregatesOHLCVRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"aggregate": "string",
"class": "string",
"close": "string",
"exchange": "string",
"high": "string",
"low": "string",
"open": "string",
"sequenceId": "string",
"code": "string",
"timestamp": "2019-08-24T14:15:22Z",
"uid": "string",
"volume": "string"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamAggregatesOHLCVResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamAggregatesOHLCVResponseV1 | false | none | none |
Cross Prices
Subscribe
This endpoint returns the price of any asset quoted in a Fiat currency within Open Exchange Rates. The USD price is calculated based on the path of the highest liquidity, with an additional step using forex rates to get the final fiat price. This means that, even though an asset might trade directly against all Open Exchange Rates currencies, the price might still be established by using cross-rates1. In cases where the most liquid path changed over time, this will be taken into account in the calculation of the price for each interval.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_spot_exchange_rate_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"code":"string","aggregate":"string","sources":true}'
POST /api/stream/aggregates_spot_exchange_rate_v1
Body parameter
{
"code": "string",
"aggregate": "string",
"sources": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamAggregatesSpotExchangeRateRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"aggregate": "string",
"code": "string",
"price": "string",
"sequenceId": "string",
"sources": {
"property1": {
"data": [
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
],
"price": "string"
},
"property2": {
"data": [
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
],
"price": "string"
}
},
"timestamp": "2019-08-24T14:15:22Z",
"uid": "string"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamAggregatesSpotExchangeRateResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamAggregatesSpotExchangeRateResponseV1 | false | none | none |
Asset Prices
Subscribe
This endpoint generates an aggregated price for an asset pair across all exchanges with spot markets for the pair. Only asset combinations which are actively being traded on one of our covered exchanges are being taken into account for the calculation of the price. Unsupported asset combinations will return no data. To return data used as input for the calculation of the aggregated price, set the sources parameter to true. Setting the sources parameter to false (default) will yield a faster response time. By making use of the sort parameter, data can be returned in ascending asc or descending desc order (default).
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_direct_exchange_rate_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"code":"string","aggregate":"string","sources":true}'
POST /api/stream/aggregates_direct_exchange_rate_v1
Body parameter
{
"code": "string",
"aggregate": "string",
"sources": true
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamAggregatesDirectExchangeRateRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"aggregate": "string",
"code": "string",
"price": "string",
"sequenceId": "string",
"sources": [
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
],
"timestamp": "2019-08-24T14:15:22Z",
"uid": "string"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamAggregatesDirectExchangeRateResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamAggregatesDirectExchangeRateResponseV1 | false | none | none |
Trades
Subscribe
Retrieve an ongoing stream of tick-by-tick trades for any selection of instruments or exchanges.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/trades_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"instrumentCriteria":{"exchange":"string","instrumentClass":"string","code":"string"}}'
POST /api/stream/trades_v1
Body parameter
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamTradesRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"additionalProperties": {
"property1": "string",
"property2": "string"
},
"amount": 0,
"class": "string",
"code": "string",
"exchange": "string",
"sequenceId": "string",
"id": "string",
"price": 0,
"side": "UNKNOWN",
"tsExchange": {
"value": "2019-08-24T14:15:22Z"
},
"tsCollection": {
"value": "2019-08-24T14:15:22Z"
},
"tsEvent": "2019-08-24T14:15:22Z"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamTradesResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamTradesResponseV1 | false | none | none |
Enumerated Values
Property | Value |
---|---|
side | UNKNOWN |
side | BUY |
side | SELL |
VWAP
Subscribe
Retrieve ongoing Volume Weighted Average Price updates. Supported intervals are 1s, 1m and 1h.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/aggregates_vwap_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"instrumentCriteria":{"exchange":"string","instrumentClass":"string","code":"string"},"aggregate":"string"}'
POST /api/stream/aggregates_vwap_v1
Body parameter
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
},
"aggregate": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamAggregatesVWAPRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"aggregate": "string",
"class": "string",
"code": "string",
"exchange": "string",
"sequenceId": "string",
"price": 0,
"tsEvent": "2019-08-24T14:15:22Z",
"uid": "string"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamAggregatesVWAPResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamAggregatesVWAPResponseV1 | false | none | none |
Benchmark Rates
Subscribe
Designed to bring greater transparency to pricing in the crypto currency markets, the Kaiko Rates are aggregated price feeds across platforms based on the vast majority of executed trades on centralized and/or decentralized exchanges.
The Benchmark Rates cover a large spectrum of pairs. It is designed on a simplified vetting scheme combined with a robust aggregation methodology and pre-defined optimization parameters. More information can be found here (https://www.kaiko.com/pages/price-rates)
Fields description
An Benchmark Rate consists in a unique indexCode
.
indexCode
is the ticker identifying the rate.commodity
is a sub-category giving you access to a specific type of publication: real-time or fixings.interval
is the time period in which transaction data are considered for the calculation of the rate. If a rate has an interval of 15 seconds,startTime
andendTime
will be separated by 15s.quote
is the quote asset used for the rate denomination.asset
inbases
are the base assets included in the rate.weight
is the weight associated with each base (must sum to 1).exchanges
are the exchanges involved in the computation. This list can be adjusted every quarter during the rebalancing period and depending on the new results given by the liquidity and coverage optimization.percentages
are the different distribution levels included in the price computation.price
is the value of the rate in the in the quote denomination.pairs
is the list of pairs combined with additional details included in the computation.tsEvent
is the exact time of price publication.
Multi rates subscription support
You can specify multiple rates at a time by filling indexCode
request field with either:
- wildcard (
*
) : means you get all rates associated with your API key - a comma separated list of rates (for example:
indexCode1,indexCode2,indexCode3
).
Please refer to the list of rates available on our website to access the indexCode associated with your subscription.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/index_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"indexCode":"string","commodities":["SIC_UNKNOWN"],"interval":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"}}'
POST /api/stream/index_v1
Body parameter
{
"indexCode": "string",
"commodities": [
"SIC_UNKNOWN"
],
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamIndexServiceRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"indexCode": "string",
"commodity": "SIC_UNKNOWN",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"quote": "string",
"bases": [
{
"asset": "string",
"weight": 0
}
],
"exchanges": [
"string"
],
"percentages": [
{
"percentage": 0,
"price": 0,
"pairs": [
{
"pair": "string",
"weight": 0,
"instruments": [
{
"exchange": "string",
"price": 0,
"volume": 0,
"count": "string"
}
]
}
]
}
],
"tsEvent": "2019-08-24T14:15:22Z"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamIndexServiceResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamIndexServiceResponseV1 | false | none | none |
Enumerated Values
Property | Value |
---|---|
commodity | SIC_UNKNOWN |
commodity | SIC_REAL_TIME |
commodity | SIC_DAILY_FIXING |
Plain Vanilla Indices
Subscribe
Coming soon (beta product).
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/index_multi_assets_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"indexCode":"string","commodities":["SIC_UNKNOWN"]}'
POST /api/stream/index_multi_assets_v1
Body parameter
{
"indexCode": "string",
"commodities": [
"SIC_UNKNOWN"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamIndexMultiAssetsServiceRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"commodity": "SIC_UNKNOWN",
"indexCode": "string",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"mainQuote": "string",
"compositions": [
{
"underlyingInstrument": "string",
"base": "string",
"quote": "string",
"exchanges": [
"string"
],
"instrumentInterval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"currencyConversion": "string"
}
],
"price": {
"indexValue": 0,
"divisor": 0,
"pairs": [
{
"underlyingInstrument": "string",
"underlyingPrice": 0,
"weightingFactor": 0,
"cappingFactor": 0,
"currencyConversionFactor": 0
}
]
},
"tsEvent": "2019-08-24T14:15:22Z"
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamIndexMultiAssetsServiceResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamIndexMultiAssetsServiceResponseV1 | false | none | none |
Enumerated Values
Property | Value |
---|---|
commodity | SIC_UNKNOWN |
commodity | SIC_REAL_TIME |
commodity | SIC_DAILY_FIXING |
Market Update (Trades, Order Books, Best Bids and Asks)
Subscribe
Retrieve an ongoing stream of tick-by-tick trades, tick-level order book updates and top of book data. Data can also be replayed by filling an interval (start time and end time being both mandatory), up to 72 hours of history.
By default, if you don’t specifiy a commodity
, you get all kinds of commodites (SMUC_FULL_ORDER_BOOK
, SMUC_TRADE
, SMUC_TOP_OF_BOOK
).
If you specifiy one or more commodites, you will get only the ones filled.
High traffic endpoint warning and slow consumer policy
Market update is a stream feed with a lot of data in terms of bandwidth. Due to the high traffic nature of this endpoint, late subscriptions can’t be kept alive indefinitely.
You should always be able to consume the data Kaiko is sending to your subscription in time, otherwise the subscription will be terminated automatically past a certain threshold.
Few common things to check for this assumption to be true:
- Your machine should have sufficient bandwidth
- No process should block the gRPC reading loop
- If using Python SDK particularily, you should make use gRPC Async IO or switch to another SDK language binding. This is due to some limitations in Python SDK.
- Check out gRPC performance official best practices guidelines
Ordering of data
Live data
- L2 updates (
SMUC_FULL_ORDER_BOOK
) data is ordered for a given exchange/instrument pair. This means that for 2 concurrent subscriptions, you won’t have the same order of received data globally, but, for example, for a paircbse:spot:btc-usd
you will have the same order across all subscriptions. - Trades and Top Of Book (
SMUC_TRADE
andSMUC_TOP_OF_BOOK
) is not ordered.
Replay data
- All data is ordered by timestamp for up to 72 hours of history.
Order Book data processing
-
When subscribing to
SMUC_FULL_ORDER_BOOK
, you will first receive a full snapshot (after few seconds) and then all subsequent L2 updates. If you ever receive again a full snapshot, it means you should replace your local snapshot with the one received. This should happen infrequently and occurs when we detect a consistency issue (connection to exchange lost, exchange down for some time, etc.) -
When amount is 0 for an update, the price level should be removed from the orderbook. It is normal that sometimes you receive a message to remove a price level which does not exist in the local orderbook. This is due to various exchange limitations (limited snapshot depth in the exchange API for example) and can be safely ignored. For example, as of Python’s protobuf 4.22.0, you can include “including_default_value_fields = True” in your serialization code to see message fields whose value are default values (for example “0” for integers). Please refer to the respective programming language’s webpage to learn how to activative this.
-
Orderbook should not be considered valid until all updates for the same
tsExchange
have been applied to your local orderbook (ie. potential messages of the same batch of update from the exchange have all been applied)
SequenceID field
Market update data is coming with a sequenceId
field. This allows ordering events by lexicographical order and can be seen as an alphabetical version of tsCollection
and tsEvent
.
This field is unique for all stream data, and can be used to deduplicate data in the event you need to use replay to recover missed data and check for events already present in your system.
Code samples
curl --request POST \
--url https://gateway-v0-http.kaiko.ovh/api/stream/market_update_v1 \
--header 'Accept: application/swagger-ui+json' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: API_KEY' \
--data '{"instrumentCriteria":{"exchange":"string","instrumentClass":"string","code":"string"},"commodities":["SMUC_UNKNOWN"],"interval":{"startTime":"2019-08-24T14:15:22Z","endTime":"2019-08-24T14:15:22Z"},"snapshotType":"UNKNOWN"}'
POST /api/stream/market_update_v1
Body parameter
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
},
"commodities": [
"SMUC_UNKNOWN"
],
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"snapshotType": "UNKNOWN"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | kaikosdkStreamMarketUpdateRequestV1 | true | none |
Example responses
200 Response
{
"result": {
"commodity": "SMUC_UNKNOWN",
"amount": 0,
"class": "string",
"code": "string",
"exchange": "string",
"sequenceId": "string",
"id": "string",
"price": 0,
"tsExchange": {
"value": "2019-08-24T14:15:22Z"
},
"tsCollection": {
"value": "2019-08-24T14:15:22Z"
},
"tsEvent": "2019-08-24T14:15:22Z",
"updateType": "UNKNOWN",
"snapshot": {
"asks": [
{
"amount": 0,
"price": 0
}
],
"bids": [
{
"amount": 0,
"price": 0
}
]
}
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | A successful response.(streaming responses) | Inline |
403 | Forbidden | Returned when the user does not have permission to access the resource. | Inline |
404 | Not Found | Returned when the resource does not exist. | string |
default | Default | An unexpected error response. | rpcStatus |
Response Schema
Status Code 200
Stream result of kaikosdkStreamMarketUpdateResponseV1
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» result | kaikosdkStreamMarketUpdateResponseV1 | false | none | none |
Enumerated Values
Property | Value |
---|---|
commodity | SMUC_UNKNOWN |
commodity | SMUC_TRADE |
commodity | SMUC_TOP_OF_BOOK |
commodity | SMUC_FULL_ORDER_BOOK |
updateType | UNKNOWN |
updateType | TRADE_BUY |
updateType | TRADE_SELL |
updateType | TRADE_UNKNOWN |
updateType | BEST_ASK |
updateType | BEST_BID |
updateType | UPDATED_ASK |
updateType | UPDATED_BID |
updateType | SNAPSHOT |
updateType | FORCE_SNAPSHOT |
Schemas
SnapshotOrder
{
"amount": 0,
"price": 0
}
Order is a amount at a price level.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
amount | number(double) | false | none | Amount / quantity of asset bought or sold, displayed in base currency. |
price | number(double) | false | none | Price for quote currency. |
StreamMarketUpdateRequestV1OrderbookSnapshotType
"UNKNOWN"
OrderbookSnapshotType
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
OrderbookSnapshotType | string | false | none | - UNKNOWN: UNKNOWN means no snapshot is sent. - TEN_PERCENT: TEN_PERCENT is ob10%. - FULL: FULL is full orderbook. |
Enumerated Values
Property | Value |
---|---|
OrderbookSnapshotType | UNKNOWN |
OrderbookSnapshotType | TEN_PERCENT |
OrderbookSnapshotType | FULL |
StreamMarketUpdateResponseV1Snapshot
{
"asks": [
{
"amount": 0,
"price": 0
}
],
"bids": [
{
"amount": 0,
"price": 0
}
]
}
Snapshot is an orderbook snapshot.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
asks | [SnapshotOrder] | false | none | Asks is the list of asks of the orderbook. |
bids | [SnapshotOrder] | false | none | Bids is the list of bids of the orderbook. |
StreamMarketUpdateResponseV1StreamMarketUpdateType
"UNKNOWN"
StreamMarketUpdateType is event category for a market update.
- UNKNOWN: Unknown type.
- TRADE_BUY: TRADE_BUY type.
- TRADE_SELL: TRADE_SELL type.
- TRADE_UNKNOWN: TRADE_UNKNOWN type.
- BEST_ASK: BEST_ASK type.
- BEST_BID: BEST_BID type.
- UPDATED_ASK: UPDATED_ASK type.
- UPDATED_BID: UPDATED_BID type.
- SNAPSHOT: SNAPSHOT type.
- FORCE_SNAPSHOT: FORCE_SNAPSHOT type. Internal use only.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | StreamMarketUpdateType is event category for a market update. - UNKNOWN: Unknown type. - TRADE_BUY: TRADE_BUY type. - TRADE_SELL: TRADE_SELL type. - TRADE_UNKNOWN: TRADE_UNKNOWN type. - BEST_ASK: BEST_ASK type. - BEST_BID: BEST_BID type. - UPDATED_ASK: UPDATED_ASK type. - UPDATED_BID: UPDATED_BID type. - SNAPSHOT: SNAPSHOT type. - FORCE_SNAPSHOT: FORCE_SNAPSHOT type. Internal use only. |
Enumerated Values
Property | Value |
---|---|
anonymous | UNKNOWN |
anonymous | TRADE_BUY |
anonymous | TRADE_SELL |
anonymous | TRADE_UNKNOWN |
anonymous | BEST_ASK |
anonymous | BEST_BID |
anonymous | UPDATED_ASK |
anonymous | UPDATED_BID |
anonymous | SNAPSHOT |
anonymous | FORCE_SNAPSHOT |
StreamTradesResponseV1TradeSide
"UNKNOWN"
Side
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Side | string | false | none | - UNKNOWN: Unknown side (not specified). - BUY: Buy side. - SELL: Sell side. |
Enumerated Values
Property | Value |
---|---|
Side | UNKNOWN |
Side | BUY |
Side | SELL |
kaikosdkDataInterval
{
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
}
DataInterval
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
startTime | string(date-time) | false | none | Starting time (inclusive, ISO 8601 for REST). |
endTime | string(date-time) | false | none | Ending time (exclusive, ISO 8601 for REST). |
kaikosdkInstrumentCriteria
{
"exchange": "string",
"instrumentClass": "string",
"code": "string"
}
InstrumentCriteria
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
exchange | string | false | none | Instrument exchange code, for example “cbse” (Coinbase). |
instrumentClass | string | false | none | Instrument class. See https://docs.kaiko.com/?python#instruments. |
code | string | false | none | Instrument code. See https://docs.kaiko.com/?python#instruments. |
kaikosdkSource
{
"data": [
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
],
"price": "string"
}
Source
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
data | [kaikosdkSourceData] | false | none | Prices for instrument code in each exchange. |
price | string | false | none | Price for related instrument code accross exchanges. |
kaikosdkSourceData
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
SourceData
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
exchangeCode | string | false | none | Instrument exchange code, for example “cbse” (Coinbase). |
count | string(int64) | false | none | Number of trades for the given instrument code and aggregate. |
price | string | false | none | Price for the instrument code on the exchange and interval. |
volume | string | false | none | Volume for the instrument code on the exchange and interval. |
kaikosdkStreamAggregatedPriceRequestV1
{
"instrumentClass": "string",
"code": "string",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
}
}
StreamAggregatedPriceRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
instrumentClass | string | false | none | Instrument class. See https://docs.kaiko.com/?python#instruments. |
code | string | false | none | Instrument code. See https://docs.kaiko.com/?python#instruments. |
interval | kaikosdkDataInterval | false | none | none |
kaikosdkStreamAggregatedPriceResponseV1
{
"aggregate": "string",
"instrumentClass": "string",
"code": "string",
"value": {
"price": "string",
"volume": "string"
},
"eventType": "UNKNOWN",
"tsEvent": "2019-08-24T14:15:22Z"
}
StreamAggregatedPriceResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
aggregate | string | false | none | Aggregate (interval). |
instrumentClass | string | false | none | Instrument class. See https://docs.kaiko.com/?python#instruments. |
code | string | false | none | Instrument code. See https://docs.kaiko.com/?python#instruments. |
value | kaikosdkStreamAggregatedPriceValue | false | none | StreamAggregatedPriceValue is wrapper for update values. |
eventType | kaikosdkStreamAggregatedPriceResponseV1EventType | false | none | EventType is event category for a value. - UNKNOWN: Unknown type. - BEST_ASK: BEST_ASK type. - BEST_BID: BEST_BID type. |
tsEvent | string(date-time) | false | none | Timestamp of event. |
kaikosdkStreamAggregatedPriceResponseV1EventType
"UNKNOWN"
EventType is event category for a value.
- UNKNOWN: Unknown type.
- BEST_ASK: BEST_ASK type.
- BEST_BID: BEST_BID type.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | EventType is event category for a value. - UNKNOWN: Unknown type. - BEST_ASK: BEST_ASK type. - BEST_BID: BEST_BID type. |
Enumerated Values
Property | Value |
---|---|
anonymous | UNKNOWN |
anonymous | BEST_ASK |
anonymous | BEST_BID |
kaikosdkStreamAggregatedPriceValue
{
"price": "string",
"volume": "string"
}
StreamAggregatedPriceValue is wrapper for update values.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
price | string | false | none | Price of top of book entry. |
volume | string | false | none | Volume of top of book entry. |
kaikosdkStreamAggregatedQuoteRequestV2
{
"instrumentClass": "string",
"code": "string",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"includeUnvettedPrice": true
}
StreamAggregatedQuoteRequestV2
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
instrumentClass | string | false | none | Instrument class. See https://docs.kaiko.com/?python#instruments. |
code | string | false | none | Instrument code. See https://docs.kaiko.com/?python#instruments. |
interval | kaikosdkDataInterval | false | none | none |
includeUnvettedPrice | boolean | false | none | Whether to add an additionnal data point including all exchanges covered by Kaiko Top Of Book Stream for computation. This should be used whenever an asset is not part of the vetted list. Beware that exchange vetted list changes every quarter, so if there is only 1 exchange covering this asset, you should use unvetted as backup to vetted to always have a price. |
kaikosdkStreamAggregatedQuoteResponseV2
{
"aggregate": "string",
"instrumentClass": "string",
"code": "string",
"eventType": "UNKNOWN",
"tsEvent": "2019-08-24T14:15:22Z",
"vetted": {
"price": "string",
"volume": "string"
},
"unvetted": {
"price": "string",
"volume": "string"
}
}
StreamAggregatedQuoteResponseV2
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
aggregate | string | false | none | Aggregate (interval). |
instrumentClass | string | false | none | Instrument class. See https://docs.kaiko.com/?python#instruments. |
code | string | false | none | Instrument code. See https://docs.kaiko.com/?python#instruments. |
eventType | kaikosdkStreamAggregatedQuoteResponseV2EventType | false | none | EventType is event category for a value. - UNKNOWN: Unknown type. - BEST_ASK: BEST_ASK type. - BEST_BID: BEST_BID type. |
tsEvent | string(date-time) | false | none | Timestamp of event. |
vetted | kaikosdkStreamAggregatedQuoteValue | false | none | StreamAggregatedQuoteValue is wrapper for update values. |
unvetted | kaikosdkStreamAggregatedQuoteValue | false | none | StreamAggregatedQuoteValue is wrapper for update values. |
kaikosdkStreamAggregatedQuoteResponseV2EventType
"UNKNOWN"
EventType is event category for a value.
- UNKNOWN: Unknown type.
- BEST_ASK: BEST_ASK type.
- BEST_BID: BEST_BID type.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | EventType is event category for a value. - UNKNOWN: Unknown type. - BEST_ASK: BEST_ASK type. - BEST_BID: BEST_BID type. |
Enumerated Values
Property | Value |
---|---|
anonymous | UNKNOWN |
anonymous | BEST_ASK |
anonymous | BEST_BID |
kaikosdkStreamAggregatedQuoteValue
{
"price": "string",
"volume": "string"
}
StreamAggregatedQuoteValue is wrapper for update values.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
price | string | false | none | Price of top of book entry. |
volume | string | false | none | Volume of top of book entry. |
kaikosdkStreamAggregatesDirectExchangeRateRequestV1
{
"code": "string",
"aggregate": "string",
"sources": true
}
StreamAggregatesDirectExchangeRateRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
code | string | false | none | Instrument code. |
aggregate | string | false | none | Aggregate value (1s, 1m, 1h). |
sources | boolean | false | none | Flag to include sources in the stream (if permissions match). Sources are all the prices which were used to calculate aggregated price. |
kaikosdkStreamAggregatesDirectExchangeRateResponseV1
{
"aggregate": "string",
"code": "string",
"price": "string",
"sequenceId": "string",
"sources": [
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
],
"timestamp": "2019-08-24T14:15:22Z",
"uid": "string"
}
StreamAggregatesDirectExchangeRateResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
aggregate | string | false | none | Aggregate (interval). |
code | string | false | none | Instrument code. |
price | string | false | none | Price for the trade. |
sequenceId | string | false | none | Sequence ID for event. Sortable in lexicographic order. |
sources | [kaikosdkSourceData] | false | none | Sources of calculus (if requested), each key is an instrument segment for the root instrument code. |
timestamp | string(date-time) | false | none | Timestamp of event. |
uid | string | false | none | UID is timestamp truncated to interval of OHLCV. |
kaikosdkStreamAggregatesOHLCVRequestV1
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
},
"aggregate": "string"
}
StreamAggregatesOHLCVRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
instrumentCriteria | kaikosdkInstrumentCriteria | false | none | none |
aggregate | string | false | none | Aggregate value (1s, 1m, 1h). |
kaikosdkStreamAggregatesOHLCVResponseV1
{
"aggregate": "string",
"class": "string",
"close": "string",
"exchange": "string",
"high": "string",
"low": "string",
"open": "string",
"sequenceId": "string",
"code": "string",
"timestamp": "2019-08-24T14:15:22Z",
"uid": "string",
"volume": "string"
}
StreamAggregatesOHLCVResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
aggregate | string | false | none | Aggregate (interval). |
class | string | false | none | Instrument class. |
close | string | false | none | Close value of OHLCV. |
exchange | string | false | none | Instrument exchange. |
high | string | false | none | High value of OHLCV. |
low | string | false | none | Low value of OHLCV. |
open | string | false | none | Open value of OHLCV. |
sequenceId | string | false | none | Sequence ID for event. Sortable in lexicographic order. |
code | string | false | none | Instrument code. |
timestamp | string(date-time) | false | none | Timestamp of event. |
uid | string | false | none | UID is timestamp truncated to interval of OHLCV. |
volume | string | false | none | Volume of OHLCV. |
kaikosdkStreamAggregatesSpotExchangeRateRequestV1
{
"code": "string",
"aggregate": "string",
"sources": true
}
StreamAggregatesSpotExchangeRateRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
code | string | false | none | Instrument code. |
aggregate | string | false | none | Aggregate value (1s, 1m, 1h). |
sources | boolean | false | none | Flag to include sources in the stream (if permissions match). Sources are all the prices which were used to calculate aggregated price. |
kaikosdkStreamAggregatesSpotExchangeRateResponseV1
{
"aggregate": "string",
"code": "string",
"price": "string",
"sequenceId": "string",
"sources": {
"property1": {
"data": [
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
],
"price": "string"
},
"property2": {
"data": [
{
"exchangeCode": "string",
"count": "string",
"price": "string",
"volume": "string"
}
],
"price": "string"
}
},
"timestamp": "2019-08-24T14:15:22Z",
"uid": "string"
}
StreamAggregatesSpotExchangeRateResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
aggregate | string | false | none | Aggregate (interval). |
code | string | false | none | Instrument code (for example btc-usd). |
price | string | false | none | Aggregated price for the instrument code accross exchanges. |
sequenceId | string | false | none | Sequence ID for event. Sortable in lexicographic order. |
sources | object | false | none | Sources of calculus (if requested), each key is an instrument segment for the root instrument code. |
» additionalProperties | kaikosdkSource | false | none | none |
timestamp | string(date-time) | false | none | Timestamp of event. |
uid | string | false | none | UID is timestamp truncated to interval of OHLCV. |
kaikosdkStreamAggregatesVWAPRequestV1
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
},
"aggregate": "string"
}
StreamAggregatesVWAPRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
instrumentCriteria | kaikosdkInstrumentCriteria | false | none | none |
aggregate | string | false | none | Aggregate value (1s, 1m, 1h). |
kaikosdkStreamAggregatesVWAPResponseV1
{
"aggregate": "string",
"class": "string",
"code": "string",
"exchange": "string",
"sequenceId": "string",
"price": 0,
"tsEvent": "2019-08-24T14:15:22Z",
"uid": "string"
}
StreamAggregatesVWAPResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
aggregate | string | false | none | Aggregate (interval). |
class | string | false | none | Instrument class, empty when instrument not mapped. |
code | string | false | none | Instrument code, empty when instrument not mapped. |
exchange | string | false | none | Instrument exchange. |
sequenceId | string | false | none | Sequence ID for event. Sortable in lexicographic order. |
price | number(double) | false | none | Price for the trade. |
tsEvent | string(date-time) | false | none | Event generation timestamp (event created by Kaiko), after normalization. |
uid | string | false | none | UID is timestamp truncated to interval of OHLCV. |
kaikosdkStreamIndexCommodity
"SIC_UNKNOWN"
StreamIndexCommodity allows selecting kind of index update wanted.
- SIC_UNKNOWN: Unknown commodity.
- SIC_REAL_TIME: REAL_TIME commodity.
- SIC_DAILY_FIXING: DAILY_FIXING commodity.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | StreamIndexCommodity allows selecting kind of index update wanted. - SIC_UNKNOWN: Unknown commodity. - SIC_REAL_TIME: REAL_TIME commodity. - SIC_DAILY_FIXING: DAILY_FIXING commodity. |
Enumerated Values
Property | Value |
---|---|
anonymous | SIC_UNKNOWN |
anonymous | SIC_REAL_TIME |
anonymous | SIC_DAILY_FIXING |
kaikosdkStreamIndexMultiAssetsServiceRequestV1
{
"indexCode": "string",
"commodities": [
"SIC_UNKNOWN"
]
}
StreamIndexServiceRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
indexCode | string | false | none | Index code. |
commodities | [kaikosdkStreamIndexCommodity] | false | none | Enum indicating type of feed. |
kaikosdkStreamIndexMultiAssetsServiceResponseComposition
{
"underlyingInstrument": "string",
"base": "string",
"quote": "string",
"exchanges": [
"string"
],
"instrumentInterval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"currencyConversion": "string"
}
StreamIndexMultiAssetsServiceResponseComposition is the composition used to compute the index.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
underlyingInstrument | string | false | none | Underlying instrument of the indices. |
base | string | false | none | Base. |
quote | string | false | none | Quote. |
exchanges | [string] | false | none | Exchanges. |
instrumentInterval | kaikosdkDataInterval | false | none | none |
currencyConversion | string | false | none | Currency conversion. |
kaikosdkStreamIndexMultiAssetsServiceResponsePair
{
"underlyingInstrument": "string",
"underlyingPrice": 0,
"weightingFactor": 0,
"cappingFactor": 0,
"currencyConversionFactor": 0
}
StreamIndexMultiAssetsServiceResponsePair is the pair information for the rates used
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
underlyingInstrument | string | false | none | Underlying instrument of the indices. |
underlyingPrice | number(double) | false | none | Underlying price of the instrument. |
weightingFactor | number(double) | false | none | Weighting factor of the instrument. |
cappingFactor | number(double) | false | none | Capping factor of the instrument. |
currencyConversionFactor | number(double) | false | none | Currency conversion factor of the instrument. |
kaikosdkStreamIndexMultiAssetsServiceResponsePrices
{
"indexValue": 0,
"divisor": 0,
"pairs": [
{
"underlyingInstrument": "string",
"underlyingPrice": 0,
"weightingFactor": 0,
"cappingFactor": 0,
"currencyConversionFactor": 0
}
]
}
StreamIndexMultiAssetsServiceResponsePrices is the prices informations on the pair used
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
indexValue | number(double) | false | none | Index value. |
divisor | number(double) | false | none | Divisor. |
pairs | [kaikosdkStreamIndexMultiAssetsServiceResponsePair] | false | none | StreamIndexMultiAssetsServiceResponsePair is the pair information for the rates used. |
kaikosdkStreamIndexMultiAssetsServiceResponseV1
{
"commodity": "SIC_UNKNOWN",
"indexCode": "string",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"mainQuote": "string",
"compositions": [
{
"underlyingInstrument": "string",
"base": "string",
"quote": "string",
"exchanges": [
"string"
],
"instrumentInterval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"currencyConversion": "string"
}
],
"price": {
"indexValue": 0,
"divisor": 0,
"pairs": [
{
"underlyingInstrument": "string",
"underlyingPrice": 0,
"weightingFactor": 0,
"cappingFactor": 0,
"currencyConversionFactor": 0
}
]
},
"tsEvent": "2019-08-24T14:15:22Z"
}
StreamIndexServiceResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
commodity | kaikosdkStreamIndexCommodity | false | none | StreamIndexCommodity allows selecting kind of index update wanted. - SIC_UNKNOWN: Unknown commodity. - SIC_REAL_TIME: REAL_TIME commodity. - SIC_DAILY_FIXING: DAILY_FIXING commodity. |
indexCode | string | false | none | Index code. |
interval | kaikosdkDataInterval | false | none | none |
mainQuote | string | false | none | Quote. |
compositions | [kaikosdkStreamIndexMultiAssetsServiceResponseComposition] | false | none | List of rates used in indices. |
price | kaikosdkStreamIndexMultiAssetsServiceResponsePrices | false | none | none |
tsEvent | string(date-time) | false | none | Event generation timestamp (event created by Kaiko), after normalization. |
kaikosdkStreamIndexServiceRequestV1
{
"indexCode": "string",
"commodities": [
"SIC_UNKNOWN"
],
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
}
}
StreamIndexServiceRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
indexCode | string | false | none | Index code. |
commodities | [kaikosdkStreamIndexCommodity] | false | none | Enum indicating type of feed. |
interval | kaikosdkDataInterval | false | none | none |
kaikosdkStreamIndexServiceResponseBaseAsset
{
"asset": "string",
"weight": 0
}
StreamIndexServiceResponseBaseAsset is base asset involved in computation.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
asset | string | false | none | Asset. |
weight | number(double) | false | none | Weight. |
kaikosdkStreamIndexServiceResponseInstruments
{
"exchange": "string",
"price": 0,
"volume": 0,
"count": "string"
}
StreamIndexServiceResponseInstruments is computation result by instruments.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
exchange | string | false | none | Exchange. |
price | number(double) | false | none | Price. |
volume | number(double) | false | none | Volume. |
count | string(uint64) | false | none | Count. |
kaikosdkStreamIndexServiceResponsePairs
{
"pair": "string",
"weight": 0,
"instruments": [
{
"exchange": "string",
"price": 0,
"volume": 0,
"count": "string"
}
]
}
StreamIndexServiceResponsePairs is computation result by pairs.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
pair | string | false | none | Pair. |
weight | number(double) | false | none | Weight (for multiple assets indices). |
instruments | [kaikosdkStreamIndexServiceResponseInstruments] | false | none | Detailed computation by instruments. |
kaikosdkStreamIndexServiceResponsePercentage
{
"percentage": 0,
"price": 0,
"pairs": [
{
"pair": "string",
"weight": 0,
"instruments": [
{
"exchange": "string",
"price": 0,
"volume": 0,
"count": "string"
}
]
}
]
}
StreamIndexServiceResponsePercentage is computation result by percentage.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
percentage | number(double) | false | none | Percentage. |
price | number(double) | false | none | Price computed for the whole percentage. |
pairs | [kaikosdkStreamIndexServiceResponsePairs] | false | none | Detailed computation by pairs. |
kaikosdkStreamIndexServiceResponseV1
{
"indexCode": "string",
"commodity": "SIC_UNKNOWN",
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"quote": "string",
"bases": [
{
"asset": "string",
"weight": 0
}
],
"exchanges": [
"string"
],
"percentages": [
{
"percentage": 0,
"price": 0,
"pairs": [
{
"pair": "string",
"weight": 0,
"instruments": [
{
"exchange": "string",
"price": 0,
"volume": 0,
"count": "string"
}
]
}
]
}
],
"tsEvent": "2019-08-24T14:15:22Z"
}
StreamIndexServiceResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
indexCode | string | false | none | Index code. |
commodity | kaikosdkStreamIndexCommodity | false | none | StreamIndexCommodity allows selecting kind of index update wanted. - SIC_UNKNOWN: Unknown commodity. - SIC_REAL_TIME: REAL_TIME commodity. - SIC_DAILY_FIXING: DAILY_FIXING commodity. |
interval | kaikosdkDataInterval | false | none | none |
quote | string | false | none | Quote. |
bases | [kaikosdkStreamIndexServiceResponseBaseAsset] | false | none | Bases. |
exchanges | [string] | false | none | Exchanges. |
percentages | [kaikosdkStreamIndexServiceResponsePercentage] | false | none | Detailed computation by percentage. |
tsEvent | string(date-time) | false | none | Event generation timestamp (event created by Kaiko), after normalization. |
kaikosdkStreamMarketUpdateCommodity
"SMUC_UNKNOWN"
StreamMarketUpdateCommodity allows selecting kind of market update wanted.
- SMUC_UNKNOWN: Unknown commodity.
- SMUC_TRADE: TRADE commodity.
- SMUC_TOP_OF_BOOK: TOP_OF_BOOK commodity.
- SMUC_FULL_ORDER_BOOK: FULL_ORDER_BOOK commodity.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | StreamMarketUpdateCommodity allows selecting kind of market update wanted. - SMUC_UNKNOWN: Unknown commodity. - SMUC_TRADE: TRADE commodity. - SMUC_TOP_OF_BOOK: TOP_OF_BOOK commodity. - SMUC_FULL_ORDER_BOOK: FULL_ORDER_BOOK commodity. |
Enumerated Values
Property | Value |
---|---|
anonymous | SMUC_UNKNOWN |
anonymous | SMUC_TRADE |
anonymous | SMUC_TOP_OF_BOOK |
anonymous | SMUC_FULL_ORDER_BOOK |
kaikosdkStreamMarketUpdateRequestV1
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
},
"commodities": [
"SMUC_UNKNOWN"
],
"interval": {
"startTime": "2019-08-24T14:15:22Z",
"endTime": "2019-08-24T14:15:22Z"
},
"snapshotType": "UNKNOWN"
}
StreamMarketUpdateRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
instrumentCriteria | kaikosdkInstrumentCriteria | false | none | none |
commodities | [kaikosdkStreamMarketUpdateCommodity] | false | none | Enum indicating type of feed. If no commodity is specified, you get all commodities by default, otherwise you get only specified commodities. |
interval | kaikosdkDataInterval | false | none | none |
snapshotType | StreamMarketUpdateRequestV1OrderbookSnapshotType | false | none | - UNKNOWN: UNKNOWN means no snapshot is sent. - TEN_PERCENT: TEN_PERCENT is ob10%. - FULL: FULL is full orderbook. |
kaikosdkStreamMarketUpdateResponseV1
{
"commodity": "SMUC_UNKNOWN",
"amount": 0,
"class": "string",
"code": "string",
"exchange": "string",
"sequenceId": "string",
"id": "string",
"price": 0,
"tsExchange": {
"value": "2019-08-24T14:15:22Z"
},
"tsCollection": {
"value": "2019-08-24T14:15:22Z"
},
"tsEvent": "2019-08-24T14:15:22Z",
"updateType": "UNKNOWN",
"snapshot": {
"asks": [
{
"amount": 0,
"price": 0
}
],
"bids": [
{
"amount": 0,
"price": 0
}
]
}
}
StreamMarketUpdateResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
commodity | kaikosdkStreamMarketUpdateCommodity | false | none | StreamMarketUpdateCommodity allows selecting kind of market update wanted. - SMUC_UNKNOWN: Unknown commodity. - SMUC_TRADE: TRADE commodity. - SMUC_TOP_OF_BOOK: TOP_OF_BOOK commodity. - SMUC_FULL_ORDER_BOOK: FULL_ORDER_BOOK commodity. |
amount | number(double) | false | none | Amount / quantity of asset bought or sold, displayed in base currency. |
class | string | false | none | Instrument class, internal Kaiko classification denoting whether an instrument is a spot, future, perpetual future, or option. |
code | string | false | none | Instrument code (currency pair), for example btc-usd. |
exchange | string | false | none | Instrument exchange code, for example “cbse” (Coinbase). |
sequenceId | string | false | none | Sequence ID for event. Sortable in lexicographic order. |
id | string | false | none | ID from exchange (trades only), empty string when not present. |
price | number(double) | false | none | Price for quote currency. |
tsExchange | kaikosdkTimestampValue | false | none | TimestampValue wraps optional timestamp. |
tsCollection | kaikosdkTimestampValue | false | none | TimestampValue wraps optional timestamp. |
tsEvent | string(date-time) | false | none | Event generation timestamp (event created by Kaiko), after normalization. |
updateType | StreamMarketUpdateResponseV1StreamMarketUpdateType | false | none | StreamMarketUpdateType is event category for a market update. - UNKNOWN: Unknown type. - TRADE_BUY: TRADE_BUY type. - TRADE_SELL: TRADE_SELL type. - TRADE_UNKNOWN: TRADE_UNKNOWN type. - BEST_ASK: BEST_ASK type. - BEST_BID: BEST_BID type. - UPDATED_ASK: UPDATED_ASK type. - UPDATED_BID: UPDATED_BID type. - SNAPSHOT: SNAPSHOT type. - FORCE_SNAPSHOT: FORCE_SNAPSHOT type. Internal use only. |
snapshot | StreamMarketUpdateResponseV1Snapshot | false | none | Snapshot is an orderbook snapshot. |
kaikosdkStreamTradesRequestV1
{
"instrumentCriteria": {
"exchange": "string",
"instrumentClass": "string",
"code": "string"
}
}
StreamTradesRequestV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
instrumentCriteria | kaikosdkInstrumentCriteria | false | none | none |
kaikosdkStreamTradesResponseV1
{
"additionalProperties": {
"property1": "string",
"property2": "string"
},
"amount": 0,
"class": "string",
"code": "string",
"exchange": "string",
"sequenceId": "string",
"id": "string",
"price": 0,
"side": "UNKNOWN",
"tsExchange": {
"value": "2019-08-24T14:15:22Z"
},
"tsCollection": {
"value": "2019-08-24T14:15:22Z"
},
"tsEvent": "2019-08-24T14:15:22Z"
}
StreamTradesResponseV1
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
additionalProperties | object | false | none | Additionnal properties, specific to the exchange. |
» additionalProperties | string | false | none | none |
amount | number(double) | false | none | Amount / quantity of asset bought or sold, displayed in base currency. |
class | string | false | none | Instrument class, empty when instrument not mapped. |
code | string | false | none | Instrument code, empty when instrument not mapped. |
exchange | string | false | none | Instrument exchange code, for example “cbse” (Coinbase). |
sequenceId | string | false | none | Sequence ID for event. Sortable in lexicographic order. |
id | string | false | none | Trade ID, empty string when not present. |
price | number(double) | false | none | Price for the trade. |
side | StreamTradesResponseV1TradeSide | false | none | - UNKNOWN: Unknown side (not specified). - BUY: Buy side. - SELL: Sell side. |
tsExchange | kaikosdkTimestampValue | false | none | TimestampValue wraps optional timestamp. |
tsCollection | kaikosdkTimestampValue | false | none | TimestampValue wraps optional timestamp. |
tsEvent | string(date-time) | false | none | Event generation timestamp (event created by Kaiko), after normalization. |
kaikosdkTimestampValue
{
"value": "2019-08-24T14:15:22Z"
}
TimestampValue wraps optional timestamp.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
value | string(date-time) | false | none | The timestamp value. |
protobufAny
{
"@type": "string",
"property1": null,
"property2": null
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
additionalProperties | any | false | none | none |
@type | string | false | none | none |
rpcStatus
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string",
"property1": null,
"property2": null
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
code | integer(int32) | false | none | none |
message | string | false | none | none |
details | [protobufAny] | false | none | none |