NAV Navigation
Shell

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:

ICE

To connect to our services through ICE instead of internet, you need to disable TLS and use the HTTP port 80.

Base URLS:

Authentication

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 for krkn 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 for krkn exchange: krkn:spot:*

[
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "btc-usd"
},
{
"exchange": "krkn", "instrument_class": "spot", "instrument": "eth-usd"
}
]

All instruments for krkn that have btc 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:

It can also be used inside a parameter:

Cartesian Product of Patterns

All krkn and okex instruments that have usd 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:

Union of Patterns

All krkn and cbse instruments that have btc as part of the instrument code plus the krkn: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:

Aggregated Price

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 string ("") 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.

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.

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

Exchange Cross Rate

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

Direct Exchange Rate

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

Indices

Subscribe

This endpoint provides custom indices.

Fields description

An indice consists in a unique indexCode and an optional commodities.

Finally, the reference value for the index is the price field in each percentile.

Multi indices subscription support

You can specify multiple indices at a time by filling indexCode request field with either:

Please refer to the list of indices that were communicated by Kaiko support to you when specifying index by name, as the complete list is not public.

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
}
]
}
]
}
],
"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

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 2 weeks 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:

Ordering of data

Live data

Replay data

Order Book data processing

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

StreamAggregatedPriceResponseV1EventType

"UNKNOWN"

EventType is event category for a value.

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

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.

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

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.

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.

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

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
}

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.

kaikosdkStreamIndexServiceResponsePairs

{
"pair": "string",
"weight": 0,
"instruments": [
{
"exchange": "string",
"price": 0,
"volume": 0
}
]
}

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
}
]
}
]
}

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
}
]
}
]
}
],
"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.

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