# Legacy history on API v2 — subscriber migration guide

The migration kit covers 158 compatibility routes available through release 1.85.12, nineteen
native routes and eighteen MCP tools, including current options/derivatives analytics
and market discovery. Check the
[live availability status](https://apiv2.laevitas.ch/api/v1/changelog/history-migration)
before switching: `available_for_eligible_subscribers` means canary enrollment
is no longer required; `limited_preview` requires enrollment; `unavailable`
means keep using v1. A valid subscription and its history rights are always
required. This status does not certify availability for every coordinate.
The exact route scope is in the
[machine-readable route mapping](legacy-history-routes.json).

Start with [Choose your dataset](data-products.md) to distinguish retained
observations from modern ticker states, candles and trades. Then read the
[field and units guide](history-field-guide.md) before combining series.
It expands legacy abbreviations and distinguishes quantities, USD notionals,
premium values, rates, sampled observations and interval aggregates. Field
names are preserved for compatibility; a shared name is not a shared unit.

Existing v1 integrations remain supported during this gradual migration. No
shutdown date is announced and this release introduces no redirect or forced
cutover. Any future retirement will have a separate notice and migration window.
Routes not in the mapping must stay on v1; changing the hostname globally is
not a supported migration strategy.

## Agent-assisted migration

Give your coding agent the public
[migration skill](https://apiv2.laevitas.ch/migration/v1-to-v2/SKILL.md)
and ask it to inspect your integration, propose a compatibility-only patch,
and verify it before switching traffic. The skill, this guide, the route map,
the verifier and example cases are downloadable from the
[migration kit](https://apiv2.laevitas.ch/migration/v1-to-v2/).
No new API key is required solely for this migration. Keep credentials in your
normal secret store, not in the prompt, URL, generated code or report.

## Two integration choices

For the least application change, use the released compatibility alias:
the mapped old `/historical/...` or `/analytics/...` path gains `/api/v1` on the API v2
host. Preserve the route's path arguments, query parameters, response parser
and page-accounting rules. Existing v1 URLs will continue to work; this is an
opt-in migration, not a redirect or a shutdown announcement.

For a new integration, use a native history route or its MCP tool. They share
the underlying retained dataset with the compatibility reader, but use their
own documented inputs and normalized response shape. They are not equivalent
to the modern ticker, OHLCVT or fitted-surface datasets.

| Dataset family                            | Native path after `/api/v1`                 | MCP tool                                       |
| ----------------------------------------- | ------------------------------------------- | ---------------------------------------------- |
| Options instrument observations           | `/options/instrument-history`               | `get_options_instrument_history`               |
| Perpetual instrument observations         | `/perpetuals/instrument-history`            | `get_derivatives_instrument_history`           |
| Dated-future instrument observations      | `/futures/instrument-history`               | `get_derivatives_instrument_history`           |
| Options volatility series                 | `/options/volatility-history`               | `get_options_volatility_history`               |
| ETH–BTC skew spread (`skew_spread`)       | `/options/volatility-history`               | `get_options_volatility_history`               |
| One expiry ATM IV (`expiry_atm_iv`)       | `/options/volatility-history`               | `get_options_volatility_history`               |
| Funding, carry and realized volatility    | `/derivatives/funding-history`              | `get_derivatives_funding_history`              |
| Retained market snapshots                 | `/market/snapshot-history`                  | `get_market_snapshot_history`                  |
| Open interest, volume and positioning     | `/market/positioning-history`               | `get_market_positioning_history`               |
| Retained spot candles                     | `/spot/candle-history`                      | `get_spot_candle_history`                      |
| Retained spot volume by venue              | `/spot/volume-by-exchange-history`          | `get_spot_volume_by_exchange_history`          |
| Liquidations by base currency             | `/derivatives/liquidation-history`          | `get_derivatives_liquidation_history`          |
| Liquidations of one contract              | `/derivatives/contract-liquidation-history` | `get_derivatives_contract_liquidation_history` |
| Option instrument volume by direction     | `/options/instrument-volume-history`        | `get_options_instrument_volume_history`        |
| Settlement funding rates of one perpetual | `/derivatives/settlement-funding-history`   | `get_derivatives_settlement_funding_history`   |
| Current derivatives analytics             | `/derivatives/current-analytics`            | `get_derivatives_current_analytics`            |
| Current options analytics                 | `/options/current-analytics`                | `get_options_current_analytics`                |
| Legacy current/retained discovery         | `/market/legacy-discovery`                  | `get_legacy_market_discovery`                  |
| Retained derivatives summaries            | `/market/summary-history`                   | `get_market_summary_history`                   |
| Retained individual options trades        | `/options/trade-history`                    | `get_options_trade_history`                    |
| Retained strategy-grouped options trades  | `/options/trade-history/strategy-groups`    | `get_options_trade_group_history`              |

API v2 is the product name; `/api/v1` remains its URL namespace. The presence
of `v1` in that prefix does not mean you are using the legacy API product.

### Current analytics are not historical windows

Current derivatives and options analytics aliases retain the v1
`{date,data}` response. Here `date`
is **Unix seconds when the response was generated**, unlike history row dates
in milliseconds. The native response uses `{meta:{dataset,series,generated_at},data}`.
There are no start/end, resolution or page parameters: each call returns the
selected current view; changes may take up to 45 seconds to appear in responses.
Individual fields can describe observations made at different times; generation
time is not a point-in-time certificate.

Choose `series=perpetual_markets`, `futures_markets`, `currency_summary`,
`perpetual_funding`, `futures_yield`, `futures_curve`, `futures_basis`,
`top_funding`, `oi_gainers`, `price_gainers`, `oi_breakdown`, `volume_breakdown`,
`futures_summary`, `futures_oi_change_summary`, `futures_currencies`,
`futures_snapshot`, `perpetuals_snapshot`, `perpetuals_by_venue`, `oi_change`,
`perpetual_oi_change_summary` or `market_oi_changes`. The gainers'
legacy `type` becomes `instrument_type` (`future` or `perpetual`) and `period`
keeps its values (hours, or `ytd`). Native `exchange`
replaces legacy `market`; legacy OI `option` becomes `instrument_type`, `param`
becomes `hours`, and the funding/OI `type` becomes `venue_type` (`c`/`d`, not
call/put or collateral). Exact required parameters are in Swagger/MCP. Use
uppercase currencies; the untyped legacy funding alias alone retains v1's
case-sensitive currency handling. Expiry selectors must be real listed dates.

The downloadable `verify-history.mjs` checks closed historical windows only and
rejects current-analytics and catalogue cases explicitly. For current analytics, test your
parser, populated/empty selectors, field units and freshness against the
documented snapshot rules. V1 and v2 have independent short-lived caches and
the source can update between requests: identical response bytes are not a
valid live acceptance condition. The summary's `markets` array represents
venue membership; its order is not guaranteed.

### Current options and discovery

The forty-four options aliases map to thirty-five `series` selectors. `oi_change_summary` takes `currency` and `hours` (1, 4, 24, 168 or 720); 720 compares with the same time in the previous calendar month. `eth_btc_atm_spread` takes no selectors: it is the Deribit ETH-minus-BTC ATM implied volatility by Friday expiry, as on v1. The seven Deribit volatility model charts (`forward_curve`, `atm_term_structure_model`, `atm_term_structure_time_lapse`, `term_structure_model`, `skew_model`, `skew_model_time_lapse`, `vol_run`) take a `currency`; the legacy `type` of the term-structure and skew charts becomes `basis` (`strike` or `delta`).
Legacy `market` becomes `exchange`, and the IV curve's `type` becomes
`option_type` (`C` or `P`). Breakdown series require `metric=open_interest` or
`volume`, not an exchange/currency. Exact expiry selectors are listed maturities,
not day-count tenors. See the field guide for quantities, premiums, reference
notionals and signed gamma; those measures are not interchangeable.

Discovery has six series. `option_maturities`, `option_instruments` and
`derivative_instruments` describe current snapshots, not all instruments ever
listed. `option_settlements` and `spot_pairs` preserve their source update time;
that time is not replaced with the request time. Filter large settlement
catalogues by maturity, particularly when using MCP.

`expired_futures` instead reads retained observations within inclusive `start`
and `end` bounds and paginates instrument rows. Its date bounds are observation
dates, not expiry dates. Legacy `select=symbol,price` becomes native/MCP
`fields=["symbol","price"]`; only documented field names are supported, not SQL
expressions. Preserve the uppercase `/V2/` in its compatibility alias.

Discovery verification checks selector membership, timestamp basis and any
declared pagination. Do not run catalogues through the historical-series verifier
or interpret a current catalogue's missing instrument as missing historical data.

### Summaries, market-wide OI and individual option trades

`/market/summary-history` has `derivatives_summary`, `futures_alt_summary`, and the venue series `futures_exchange_activity` (legacy `aggregate_exchange_data/{market}`) and `futures_global_activity` (legacy `global_activity_futures/{market}`), which take `exchange` instead of `currency`; it
series. Both preserve the legacy perpetual-source calculations; the former
adds realized-volatility observations. They are not a merger of futures and
perpetual positions. Use `currency`, inclusive `start`/`end`, optional sampled
`resolution`, `page` and `limit`. Volume is the retained rolling 24-hour value,
not turnover summed over your requested interval.

For `/market/positioning-history?series=options_oi_by_market`, pass `exchange`
and no `currency`: the route includes all retained currencies. `n` is notional
and `ov` is option premium valuation, both in USD-equivalent units. Null `ov`
means a required valuation input is unavailable. Broad daily pages are more
expensive than individual-currency queries; use smaller pages if the shared
historical-query capacity limit is reached. No partial market total is returned.

For `series=options_volume_total`, pass `exchange` (`aggregate` spans every venue)
and `currency`. For `series=options_oi_by_currency` and `options_volume_by_currency`,
pass `currency` only: they total every retained venue for that currency, and
`BTC_USDC`/`ETH_USDC` select Deribit USDC-settled products. `volume` is retained
snapshot volume state, not unique trades, and `n`/`ov` are USD-equivalent notional
and premium valuation rounded to two decimals. The legacy path currency is
case-insensitive in v2; v1 skips its BTC/ETH product filter for a lowercase value,
so compare v1 with an uppercase path value. Broad pages may reach the shared
capacity limit; use a smaller `limit`.

For `series=options_oi_maturity`, `options_volume_maturity` and
`options_oi_volume_maturity`, pass `exchange` (deribit, okx, binance, bybit,
gate, bullish, derive or paradex; `aggregate` returns HTTP 400 where v1 returned
an empty page), `currency` and `maturity` (`2OCT26`, `02OCT26` or `ALL`). The
compatibility paths
`/historical/options/maturity/{total_oi|total_volume|oi_volume}/{market}/{currency}/{maturity}`
keep v1's lowercase `all` literal for every expiry and reject `ALL`/`All`.
Fields, units, nulls, rounding and order follow the v1 responses; the combined
route lists volume fields before open-interest fields. `granularity` accepts
`--`, `1m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `12h` and `1d`; any
other value, including an empty one, returns HTTP 400 on v2 (v1 sampled other
`Xm`/`Xh` tokens on its own grid and returned the native grid for anything
else). A start after the end returns HTTP 400 on v2 (v1 returned an empty
page). Wide `ALL` pages on busy venues may reach the shared capacity limit; use
a smaller `limit`.

`/options/trade-history` takes `exchange`, `currency`, a UTC `date` (`YYYY-MM-DD`),
and optional `page`/`limit` (default 1/10, maximum 1,440). It returns individual
retained trades, not chain snapshots or strategy-grouped trades. The compatible
route preserves `{meta:{total,page,items},items}` without adding `total_pages`.
Trade timestamp strings, identifiers and price/quantity units remain source-native;
see the field guide before comparing exchanges.

`/options/trade-history/strategy-groups` takes `exchange` (deribit, okx, binance,
bybit, gate, bullish, derive or paradex), `currency`, a UTC `date` (`YYYY-MM-DD`)
and optional `page`/`limit` (default 1/10, maximum 1,440 groups), `blockTradeId`
(exact filter), `sortBy` (`date`, `notional`, `amount`, `premium`, `delta`,
`gamma`, `vega`, `theta`, `blockTradeId`, `strategy`) and `order` (`asc` or
`desc`, applied only with `sortBy`). It returns v1's strategy groups, one row
per second, venue, currency, strategy and block trade id, with the group's
trades and totals, and is the counterpart of `/historical/options/v2/trades/{market}/{currency}`.
The compatible route preserves `{meta:{total,items,page,total_pages},items}`:
`meta.page` is present only when `page` was supplied, `total_pages` equals
`total` when `limit` was omitted, and `total` counts second/strategy
combinations without the block trade id, so group rows can exceed it; these
follow v1 and are not changed. An ISO instant or epoch `date` on the compatible
route selects from the UTC start of its day up to that instant. Group fields,
units, nulls and trade order inside a group follow v1; see the field guide.

## Example transformation

Legacy-shaped option IV request:

```text
GET /api/v1/historical/options/iv/DERIBIT/BTC-18SEP26-77000-C
    ?start=2026-09-11T09:00:00Z&end=2026-09-11T10:00:00Z
    &granularity=5m&page=1&limit=144
X-API-Key: YOUR_API_KEY
```

Native equivalent for the same dataset/projection:

```text
GET /api/v1/options/instrument-history
    ?exchange=deribit&instrument_name=BTC-18SEP26-77000-C&projection=iv
    &start=2026-09-11T09:00:00Z&end=2026-09-11T10:00:00Z
    &resolution=5m&page=1&limit=144
X-API-Key: YOUR_API_KEY
```

The MCP equivalent calls `get_options_instrument_history` with the native
arguments. For the derivative tool, additionally set `instrument_type` to
`perpetual` or `future`. Other grouped tools select a documented `series`.
Use the released OpenAPI/tool schema rather than guessing supported selectors.

For spot candles, legacy `symbol` becomes native `instrument_name` and the
path `period` becomes `resolution`. Pair separators are preserved; do not
change Coinbase `BTC-USDT` to Binance `BTCUSDT`. For liquidations, `AGGREGATED`
becomes native `exchange=aggregated`; currency spelling is case-sensitive.
Both new native routes default to page 1/limit 10, with a maximum of 1440 rows.
Liquidation resolution samples timestamp/side observations, not interval sums.
Spot candle request bounds clip edge-bucket contributions. See the field guide
before changing window shapes or treating a sampled observation as a daily total. The one-contract route takes the venue contract identifier (`BTCUSDT` on Binance, `BTC-PERPETUAL` on Deribit) and returns the stored row per observation and side, not a currency total; `AGGREGATED` is not accepted there.

## Before switching a collector

1. Choose a released compatibility alias or intentionally adopt the native
   schema. Do not replace an old historical route with OHLCVT merely because
   the names sound similar.
2. Compare a known closed window at your actual exchange, instrument,
   resolution and page size; read every declared page. Include empty windows
   and expired instruments in your acceptance checks.
3. Keep explicit UTC bounds, pagination, missing-value handling and field
   units. Instrument-history resolutions sample observations; they do not
   construct OHLC bars or fill absent minutes.
4. For actual risk reversal/butterfly, native/MCP join before paging while the
   compatibility response preserves the legacy input-page intersection. For
   snapshots, native timestamp counts can differ from legacy slot accounting.
   Do not compare these different contracts using page totals alone.
5. Do not treat latest retained history as certified originally published
   point-in-time data. Existing corrections and dataset-specific gaps still
   apply. Migration does not reconstruct retired venues or missing sources.
6. Handle a 400 for invalid or missing parameters. A history request without
   `start` is refused with 400, where the legacy v1 endpoint answered 403.

## Verify and switch gradually

Download `verify-history.mjs`, `legacy-history-routes.json` and
`cases.example.json` from the kit into one local folder. Use Node.js 22 or
later; the verifier has no package dependencies. Inspect the script and its
manifest digest before running. Replace the examples with closed windows
your subscription allows and which your collector actually uses.

```sh
node verify-history.mjs --cases cases.example.json
```

This is a dry run: it checks the mapping and shows the requests without
network calls or credentials. After setting `LAEVITAS_API_KEY` through your
normal secure environment mechanism, explicitly opt in to read-only probes:

```sh
node verify-history.mjs --cases cases.example.json --live > migration-report.json
```

The verifier reads every declared page, including pages after an empty page;
it stops as incomplete if its request/page/response-size bounds are reached.
It compares parsed responses exactly (object-key order is immaterial), keeps
nulls distinct from zeros and absent fields, and reports any numeric difference
for review rather than applying a blanket financial tolerance. Some unrounded
floating-point aggregates can differ in their last bits; do not round or alter
stored history to make a comparison pass. Raise unresolved differences with
support. Two expected empty responses are not proof of populated coverage.

Include a populated multi-page window, a second page size, a shifted window
and expected-empty controls in your plan. Use at least two rounds separated
by 80 seconds to exercise more than one instant. Snapshot and some joined
legacy-series counts describe input slots rather than output rows; the verifier
compares their envelopes but does not assert that all totals are output counts.
It checks compatibility aliases, not native response normalization or full-history
completeness. Its requests consume your normal shared account allowance.

Switch one supported route family first. Monitor HTTP status, latency, page
accounting and your own collection checks before extending the switch. To roll
back, restore that family's original v1 host and path. Keep the mapping in one
configuration layer; do not introduce a hidden fallback that masks authorization
failures, silently mixes datasets or overwrites previously stored history.

## Access, coexistence and limits

The new host is `https://apiv2.laevitas.ch`; the existing host remains
`https://api.laevitas.ch`. Use an API-key header (`X-API-Key` or `apiKey`), not
keys in copied URLs. MCP also accepts OAuth; an older connection may ask you
to sign in again to bind the current subscription. Never send both an API key
and an OAuth bearer token on the same request.

Your existing v1 subscription history rules and account exceptions continue
to apply. These migrated datasets share v1's account request allowance across
the old host, compatibility routes, native routes and their MCP calls. There
is no additional migration charge or new per-request payment for these routes.
Other, non-migrated API v2 products retain their existing access rules.

From release 1.41.5, retained-source reads no longer have the initial rollout's
additional 60-per-minute pilot ceiling. Your shared subscription quota still
applies. Source protection allows two simultaneous reads per account and four
service-wide, with a bounded wait of up to 1.5 seconds for brief bursts (internal
operations also have their own deadlines). These are upper bounds, not a
throughput promise: large queries can exhaust shared capacity sooner.
REST returns HTTP 429 with
`history_rate_limited` or `history_capacity_exceeded`; MCP returns the same
code in a tool error. Back off for at least `retry_after_ms` when provided and
add jitter. HTTP 503 means a required source or access authority is unavailable,
not that history is empty. Do not retry these errors in a tight loop.

This release changes neither retention nor the available source history.
The migrated datasets also accept x402, priced by the age of the oldest requested point. The remaining legacy routes
are not aliases until they appear in the released mapping.
