# Deribit

Deribit historical data for **all its instruments (including all options)** is available since **2019-03-30**.

{% embed url="<https://api.tardis.dev/v1/exchanges/deribit>" %}
See Deribit historical data coverage: available symbols, channels, date ranges and incidents
{% endembed %}

### Downloadable **CSV** files

Historical CSV datasets for the first day of each month are **available to download without API key**. See [downloadable CSV files documentation](/downloadable-csv-files/overview.md).

| data type             | symbol        | date       |                                                                                                               |
| --------------------- | ------------- | ---------- | ------------------------------------------------------------------------------------------------------------- |
| incremental\_book\_L2 | BTC-PERPETUAL | 2019-07-01 | [Download sample](https://datasets.tardis.dev/v1/deribit/incremental_book_L2/2019/07/01/BTC-PERPETUAL.csv.gz) |
| trades                | BTC-PERPETUAL | 2019-07-01 | [Download sample](https://datasets.tardis.dev/v1/deribit/trades/2019/07/01/BTC-PERPETUAL.csv.gz)              |
| options\_chain        | OPTIONS       | 2020-03-01 | [Download sample](https://datasets.tardis.dev/v1/deribit/options_chain/2020/03/01/OPTIONS.csv.gz)             |

### API Access and data format

Historical data format is the same as provided by real-time Deribit WebSocket **v2** API with addition of local timestamps. If you'd like to work with **normalized data format** instead (same format for each exchange) see [downloadable CSV files](/downloadable-csv-files/overview.md) or official [client libs](/api/quickstart.md) that perform data normalization client-side.

{% tabs %}
{% tab title="Python" %}

```python
# pip install tardis-dev
import asyncio
from tardis_dev import Channel, replay

async def main():
    async for local_timestamp, message in replay(
        exchange="deribit",
        from_date="2024-01-01",
        to_date="2024-01-02",
        filters=[Channel(name="book", symbols=["BTC-PERPETUAL"])],
        api_key="YOUR_API_KEY",
    ):
        # messages as provided by Deribit real-time stream
        print(message)

asyncio.run(main())
```

See [Python client docs](/python-client/quickstart.md).
{% endtab %}

{% tab title="Node.js" %}

```javascript
// npm install tardis-dev
import { replay } from 'tardis-dev';

const messages = replay({
  exchange: 'deribit',
  from: '2024-01-01',
  to: '2024-01-02',
  filters: [{ channel: 'book', symbols: ['BTC-PERPETUAL'] }],
  apiKey: 'YOUR_API_KEY'
});

// messages as provided by Deribit real-time stream
for await (const { localTimestamp, message } of messages) {
  console.log(localTimestamp, message);
}
```

See [Node.js client docs](/node-client/quickstart.md).
{% endtab %}

{% tab title="cURL & HTTP API" %}

```bash
curl --compressed -g 'https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01&filters=[{"channel":"book","symbols":["BTC-PERPETUAL"]}]&offset=0'
```

{% embed url="<https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01&filters=[{%22channel%22:%22book%22,%22symbols%22:[%22BTC-PERPETUAL%22]}]&offset=0>" %}
Example API response for Deribit historical market data request
{% endembed %}

See [HTTP API docs](/api/http-api-reference.md).
{% endtab %}

{% tab title="cURL & tardis-machine" %}

```bash
curl -g 'localhost:8000/replay?options={"exchange":"deribit","filters":[{"channel":"book","symbols":["BTC-PERPETUAL"]}],"from":"2024-01-01","to":"2024-01-02"}'
```

[Tardis-machine](/tardis-machine/quickstart.md) is a locally runnable server that exposes API allowing efficiently requesting historical market data for whole time periods in contrast to [HTTP API](/api/http-api-reference.md) that provides data only in minute by minute slices.

See [tardis-machine](/tardis-machine/quickstart.md) docs.
{% endtab %}
{% endtabs %}

### Captured real-time channels

{% embed url="<https://docs.deribit.com/v2/#subscriptions>" %}
See Deribit WebSocket API docs providing documentation for each captured channel's format
{% endembed %}

{% hint style="info" %}
Click any channel below to see [HTTP API](/api/http-api-reference.md#data-feeds-exchange) response with historical data recorded for it.
{% endhint %}

* [trades](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22trades%22}]) Trade executions stream. Collected with raw interval (no aggregation). Until 2023-10-03 included real-time liquidation info — Deribit removed the liquidation field from public trade subscriptions to avoid sharing price-sensitive data.
* [book](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22book%22,%22symbols%22:\[%22BTC-PERPETUAL%22]}]) Order book incremental updates stream with sequence number validation. Collected with raw interval (no aggregation). During data collection integrity of order book incremental updates is being **validated** using [sequence numbers](https://docs.deribit.com/v2/#book-instrument_name-interval) provided by Deribit's real-time feed (`prev_change_id`) - in case of detecting missed message WebSocket connection is being restarted.
* [ticker](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22ticker%22,%22symbols%22:\[%22BTC-PERPETUAL%22]}]) — available since **2019-10-01** Instrument ticker updates stream including price, volume, open interest, funding rate and Greeks for options. Collected with raw interval (no aggregation).
* [deribit\_price\_index](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22deribit_price_index%22}]) Real-time index price updates stream used across pricing, margining and settlement
* [deribit\_price\_ranking](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22deribit_price_ranking%22}]) Price ranking updates for the component exchanges used to calculate the Deribit index
* [deribit\_volatility\_index](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22deribit_volatility_index%22}]) — available since **2021-04-01** Volatility index (DVOL) updates stream
* [estimated\_expiration\_price](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22estimated_expiration_price%22}]) Estimated expiration (delivery) price updates stream
* [markprice.options](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22markprice.options%22}]) — available since **2019-10-01** Options mark price and implied volatility updates stream for all options under a given index
* [perpetual](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22perpetual%22,%22symbols%22:\[%22BTC-PERPETUAL%22]}]) — available since **2019-10-01** Perpetual instrument interest rate and index price updates stream. Collected with raw interval (no aggregation).
* [quote](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22quote%22,%22symbols%22:\[%22BTC-PERPETUAL%22]}]) — available since **2019-10-01** Best bid and ask price and size updates stream
* [platform\_state](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22platform_state%22}]) — available since **2019-12-31** Platform state, maintenance and price index lock notifications stream
* [instrument.state.any](https://api.tardis.dev/v1/data-feeds/deribit?from=2024-01-01\&filters=\[{%22channel%22:%22instrument.state.any%22}]) Instrument lifecycle state updates stream (new listings, expirations, settlements)

### Market data collection details

[Market data collection infrastructure](/faq/general.md#what-is-your-infrastructure-setup) for Deribit is located in GCP europe-west2 region (London, UK).

Real-time market data is captured via **multiple WebSocket connections** to `wss://www.deribit.com/ws/api/v2` (proxied via Cloudflare).

{% hint style="info" %}
Deribit servers are located in Equinix LD4 (Slough, UK).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tardis.dev/historical-data-details/deribit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
