Price slippage (snapshot)

"Snapshots" show a point-in-time view generated every 30 seconds, whereas "aggregations" show an aggregation of all 30-second snapshots from the period requested.

What is this endpoint for?

This endpoint uses our Raw order book snapshot as source data and enhances its raw data with the Price Slippage metric.

Price Slippage calculates the potential slippage for a market buy order if it were placed at the time the Order Book Snapshot was taken.

Endpoint

https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{instrument}/snapshots/slippage

Path Parameters

Parameter
Required?
Description

region

Yes

Choose between eu and us.

exchange

Yes

Exchange code.

See Exchange codes

instrument_class

Yes

instrument

Yes

Query Parameters

Parameter
Required
Description

continuation_token

No

page_size

No

Number of snapshots to return data for. Default: 10 Max: 100 See Pagination Automatically included in continuation tokens.

sort

No

Return the data in ascending (asc) or descending (desc) order. Default: desc Automatically included in continuation tokens.

start_time

No

Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.

end_time

No

Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.

slippage

No

Order size (in quote asset) for which to calculate the percentage of slippage. Default: 0. When null is returned, not enough volume is present on the order book to execute the order.

slippage_ref

No

Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best). Default: mid_price.

Fields

Field
Description

poll_timestamp

The timestamp at which the raw data snapshot was taken.

poll_date

The date at which the raw data snapshot was taken.

timestamp

The timestamp provided by the exchange. null when not provided.

ask_slippage

The percentage price slippage for a market buy order placed at the time that the order book snapshot was taken.

bid_slippage

The percentage price slippage for a market sell order placed at the time that the order book snapshot was taken.

Request examples

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

Response example

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

Last updated

Was this helpful?