> 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/binance-usdm-future.md).

# Binance USD-M Futures: data collection and validation

Binance USD-M Futures historical trade data on Koinju, available since 2019-09-08. How trades are collected from Binance's live feed and validated every day against Binance's own data.

Koinju provides trades and OHLCV candles for all Binance USD-M Futures markets since **2019-09-08**, under the exchange ID `binance-usdm-future`. This page explains how we collect those trades and how we check them against Binance's own data.

{% 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 %}

## At a glance

| Property         | Value                                                               |
| ---------------- | ------------------------------------------------------------------- |
| Exchange ID      | `binance-usdm-future`                                               |
| Available since  | 2019-09-08                                                          |
| Data             | Public trades, OHLCV                                                |
| Live source      | Binance USD-M Futures WebSocket, individual trade stream (`@trade`) |
| Daily validation | Every day, against Binance's daily candles                          |

## How we collect Binance USD-M Futures trades

* **Individual trades, not aggregates.** We subscribe to Binance's individual trade stream (`@trade`) for every listed USD-M Futures market, not the aggregate trade stream (`@aggTrade`). Each record keeps Binance's own trade ID.
* **New listings picked up automatically.** The market list is refreshed every minute, and new markets are subscribed without a restart.
* **Two collectors.** Two collectors subscribe to every market in parallel. Both copies of a trade carry the same key (exchange, market and trade ID), and the second copy is dropped before storage, so either collector alone is enough to capture a trade.
* **Binance's timestamps.** A trade's `timestamp` is the trade time reported by Binance, not the time we received it.
* **Exact values.** Prices and quantities are stored exactly as Binance publishes them, as high-precision decimals with no rounding.
* **Automatic reconnection.** Connections are kept alive with regular pings. A dropped connection is re-established and resubscribed automatically, and anything missed while reconnecting is recovered by the validation below.

## How we validate Binance USD-M Futures trades

### Daily validation against Binance's own candles

Every day, for every market, we compare the volume we collected with the volume in Binance's own daily candle (kline). Binance's figure is independent of our live feed, so a shortfall means trades are missing.

1. **Compare** each market's daily volume with Binance's daily candle.
2. **Fill:** for a market with a shortfall, compare hour by hour, fetch the trades of the hours that differ from Binance's REST API, and add only the trades we do not already hold.
3. **Compare again** on the updated data. Any difference that remains is traced to Binance's own data.

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

## Binance USD-M Futures specific details

* **Binance's own trade IDs.** `trade_id` is the ID Binance assigned, so any trade can be matched against Binance's own data.
* **Unified symbols.** Markets use Koinju's universal symbols, for example `BTC-USDT-PERP` for the USDT-margined BTC perpetual. See [Market list](/data/market-list.md).

## Access Binance USD-M Futures data

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

## FAQ

**How complete is Koinju's Binance USD-M Futures trade data?**

Every market is validated every day against Binance's own daily candles. A shortfall is filled with the missing trades from Binance's REST API, and the day is marked as validated only after a final comparison.

**Are these individual trades or aggregated trades?**

Individual trades. We collect Binance's individual trade stream, not its aggregate trade stream, and every record keeps Binance's trade ID.

**Which timestamp does Koinju store?**

The trade time reported by Binance.

**What happens if the live connection drops?**

The connection is re-established and resubscribed automatically, and a second collector subscribes to the same markets in parallel. Anything still missed is found by the next daily validation and fetched from Binance's REST API.
