> For the complete documentation index, see [llms.txt](https://docs.koinju.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.koinju.io/exchanges/kraken-future.md).

# Kraken Futures historical trade data

Kraken Futures historical trade data since 2021-05-27, available through SQL or REST in one unified schema and checked every day against Kraken's own data.

Koinju provides Kraken Futures trades and OHLCV candles for all markets since **2021-05-27**, under the exchange ID `kraken-future`. This page explains what that gives you compared with Kraken's own API, how we collect the data, and how we verify that no trades are missed.

{% hint style="info" %}
How far back you can query depends on your plan: see [Pricing](/pricing.md). Every exchange and its start date is listed on [Coverage](/data/coverage.md).
{% endhint %}

## Why use Koinju for Kraken data

* **Full history in one place.** Kraken's REST API, which our volume check uses to add missing trades, returns a market's past trades in pages from a chosen point in time ([Kraken docs](https://docs.kraken.com/api-reference/market-history/get-public-execution-events)). Koinju provides it as one continuous history since 2021-05-27, aligned to UTC days and queryable for any period through SQL or REST.
* **One schema across exchanges.** Unified symbols and columns across every exchange we cover, Kraken included, so the same query works on all of them.
* **Checked against Kraken's own data.** Every day, each market's volume is compared with Kraken's own daily candle and any missing trades are added.
* **Faithful to Kraken.** Kraken's own trade IDs and trade times.

## At a glance

| Property              | Value                                                      |
| --------------------- | ---------------------------------------------------------- |
| Exchange ID           | `kraken-future`                                            |
| Historical data since | 2021-05-27                                                 |
| Data types            | Public trades, OHLCV                                       |
| Collected from        | Kraken's real-time Futures WebSocket, trade feed (`trade`) |
| Volume check          | Every day, against Kraken's UTC daily candles              |

## How we collect Kraken trades

* **Every executed trade.** We subscribe to Kraken's [trade feed](https://docs.kraken.com/exchange/api-reference/futures-websocket/trade) (`trade`) for every listed Kraken Futures market. The trade feed returns information about executed trades, and each row keeps Kraken's own trade ID.
* **New listings picked up automatically.** The market list is refreshed every minute, and new markets are subscribed without a restart.
* **Active redundancy.** Every market is collected twice, by two collectors running in parallel. If one connection drops, it reconnects and resubscribes automatically while the other keeps collecting trades. Both copies of a trade share one key (exchange, market and trade ID), so the second copy is dropped before storage, and anything missed is recovered by the checks below.
* **Kraken's timestamps.** A trade's `timestamp` is the trade time reported by Kraken, not the time we received it.

## From Kraken's message to your data

Each trade Kraken publishes is stored as one row, with Kraken's fields mapped to the same columns used for every exchange:

| Kraken field | Koinju column | Notes                                                          |
| ------------ | ------------- | -------------------------------------------------------------- |
| `product_id` | `market`      | Koinju's universal symbol, for example `BTC-USD-PERP`          |
| `uid`        | `trade_id`    | Kraken's own trade ID                                          |
| `price`      | `price`       | Kraken's price for the trade                                   |
| `qty`        | `quantity`    | Kraken's size of the trade                                     |
| `side`       | `side`        | `buy` or `sell`: the side of the taker, as Kraken publishes it |
| `time`       | `timestamp`   | Kraken's trade time, in milliseconds                           |

## How we verify that no Kraken trades are missed

### Volume check against Kraken's own candles

The reference is Kraken's own daily candle for each UTC day. A daily candle is only final once the day has closed, so each day is checked the morning after, against Kraken's final figures for that day. The daily rhythm follows the reference data rather than an arbitrary time window.

1. **Compare.** Each market's volume for the UTC day is compared with Kraken's daily candle. Markets where our volume is lower than Kraken's go to step 2.
2. **Add.** For those markets, the comparison is repeated hour by hour. The trades of the hours that differ are fetched from Kraken's REST API, and only trades we do not already hold are added.
3. **Re-check.** The whole comparison runs again on the updated data, and any difference that remains is flagged for review.

A day is marked as checked only after all three steps complete. If any step fails, the day stays open and is retried on the next run.

## Kraken-specific details

* **UTC daily candles.** Kraken's Futures daily candles (`1d`) start at 00:00 UTC, the same day boundaries as our daily total.
* **The exact figure compared.** The volume check compares the daily candle's `volume` field with the sum of the trade quantities we hold for that day.
* **Kraken Futures names.** Our symbols use plain names, so Kraken's `PF_XBTUSD` is `BTC-USD-PERP` and `PI_XBTUSD` is `BTC-USD-PERP-INV`.

## Access Kraken data

* [Public trades](/data/public-trades.md): every trade, through SQL (`api.trade`) or REST, with `exchange = 'kraken-future'`.
* [OHLCV](/data/ohlcv.md): candles for every market.
* [Market list](/data/market-list.md): all `kraken-future` markets and their symbols.
* [How to connect](/how-to-connect.md): SQL, REST and client setup.

## FAQ

**Which timestamp does Koinju store?**

The trade time reported by Kraken.

**Which Kraken Futures markets are included?**

Every futures market Kraken currently lists. The market list is refreshed every minute, so a new listing is subscribed within a minute of appearing in Kraken's market list.
