DEV Community

HMwork
HMwork

Posted on

Five Ways to Write "Never Expires": Zero, a Blank, a Null, the Year 2100, and the Year 3000 — Plus One Venue That Leaves the Field Out

Five Ways to Write "Never Expires": Zero, a Blank, a Null, the Year 2100, and the Year 3000 — Plus One Venue That Leaves the Field Out

Disclosure: This article was produced with AI assistance under a human-supervised research process. Every value below is a raw field captured from free, key-less public exchange API endpoints, timestamped so you can re-run the measurement yourself. This is not financial advice.

#ad — Affiliate disclosure: this publication may carry affiliate links in some articles; when present, they are marked. This particular article contains no affiliate or referral links at the time of publication.


A perpetual futures contract never expires. That is the entire idea. So when you write a program that asks a venue's specification endpoint "does this contract expire, and when?", the honest answer is always "no." You would expect every exchange to encode that single answer the same way.

We measured seven. They encode "never" in at least six different ways — and one venue refuses to answer the question at all.

The measurement

On 2026-11-24, in two fetch rounds roughly three minutes apart (around 02:04 to 02:07 UTC), we queried the BTC perpetual contract on seven venues using nothing but public, no-key endpoints. Every value below was byte-identical across the two rounds. Epoch numbers were converted to calendar dates twice, once in Python and once with the independent GNU date -u tool.

Venue Expiry-ish field in the BTC perpetual spec Raw value Decoded
Binance (USDⓈ-M) deliveryDate 4133404800000 2100-12-25 08:00:00 UTC
Bybit deliveryTime "0" (a string) epoch zero
OKX expTime "" (empty string) blank
KuCoin expireDate null (JSON null, key present) explicit nothing
Deribit expiration_timestamp 32503708800000 3000-01-01 08:00:00 UTC
Gate (USDT futures) — no expiry field in the response absent
MEXC (linear futures) — no expiry timestamp field absent

Five sentinel encodings — a year-2100 integer, a literal zero, an empty string, a JSON null, and a year-3000 integer — plus two venues where the field simply does not exist. Six answers to one question.

The control groups make the sentinels obvious

To be fair, some of those fields are not decorative: they carry real deadlines on real futures. So we pulled the same fields for expiring contracts listed at this moment.

  • Bybit BTCUSDT-25DEC26: deliveryTime = "1798185600000" — exactly 2026-12-25 08:00:00 UTC.
  • OKX BTC-USD-261225: expTime = "1798185600000" — the same instant.

Two independent venues, the same December quarter, identical millisecond timestamps. When those same two venues print "0" and "" for their perpetuals, that is not missing data leaking through — it is a deliberate choice of how to say "never."

The same pattern repeats elsewhere. Binance's BTC perpetual also carries contractType = "PERPETUAL" right next to that year-2100 deliveryDate, and its onboardDate decodes to 2019-09-08 17:55 UTC — the real listing history of the contract. Deribit returns settlement_period = "perpetual" alongside the year-3000 sentinel. KuCoin returns expireDate: null, settleDate: null and preMarketToPerpDate: null — three keys that do exist in the response body with null values (confirmed against the raw text: a missing key and a present-but-null key are yet another distinction these venues do not agree on).

Gate and MEXC take the most austere route: no expiry timestamp anywhere in the contract record. The closest thing on MEXC is a flag called automaticDelivery (returned as 0 for the BTC perpetual), which speaks about delivery without giving a date.

Why your cross-venue scanner will get this wrong

Now imagine the naive question in code: "is this contract going to expire?"

  • if expire_date is None: perpetual — breaks at Binance (an integer), at Bybit (the string "0"), at OKX (the empty string), and at Gate/MEXC where the key itself is absent.
  • if expire_date > now: expiring soon — flags every single perpetual on Binance and Deribit as expiring, in 2100 and 3000 respectively.
  • if int(expire_date) == 0: perpetual — right at Bybit, a crash at OKX (int("")), a crash at the missing keys.

There is one more trap hiding in the table above: JSON types. Binance and Deribit return the sentinel as a real integer. Bybit and OKX return numbers as strings ("0", "1798185600000"). KuCoin returns a true null. Gate and MEXC return no value to type at all. A parser written for one venue's conventions will misread another's — silently, without an error.

What to check instead

The venues that offer an explicit type field make the problem easy — so use it, and never infer "perpetual" from the expiry value alone:

  • Binance: contractType = "PERPETUAL"
  • Bybit: contractType = "LinearPerpetual"
  • Deribit: settlement_period = "perpetual" (plus instrument names ending in -PERPETUAL)
  • OKX: the contract family is part of how you query (instType=SWAP versus instType=FUTURES) and names carry -SWAP
  • KuCoin, Gate, MEXC: no universally comparable type word — you must know the product family you are querying and treat zero, blank, null, far-future sentinels, and missing keys all as "no deadline."

A defensive rule that survived all seven of today's responses: an expiry field is "never" if it is missing, null, empty, zero, or any timestamp beyond, say, year 2050. Anything between now and 2050 is a real deadline — and the two far-future sentinels in the table are the same values we recorded in earlier measurement rounds, unchanged.

Being honest about limits: not one of the seven venues documents why it chose its particular sentinel value. We are not going to speculate. What is verifiable is exactly what is printed above — raw field names, raw values, and the arithmetic that decodes them, all reproducible in under a minute.

Verify it yourself

All endpoints are free and need no account or key:

  • Binance: GET https://fapi.binance.com/fapi/v1/exchangeInfo — find BTCUSDT, read contractType and deliveryDate
  • Bybit: GET https://api.bybit.com/v5/market/instruments-info?category=linear&symbol=BTCUSDT — and the same call with symbol=BTCUSDT-25DEC26
  • OKX: GET https://www.okx.com/api/v5/public/instruments?instType=SWAP&instId=BTC-USDT-SWAP — and instType=FUTURES
  • KuCoin: GET https://api-futures.kucoin.com/api/v1/contracts/XBTUSDTM
  • Deribit: GET https://www.deribit.com/api/v2/public/get_instruments?currency=BTC&kind=future&expired=false
  • Gate: GET https://api.gateio.ws/api/v4/futures/usdt/contracts/BTC_USDT
  • MEXC: GET https://contract.mexc.com/api/v1/contract/detail?symbol=BTC_USDT

Measurements captured 2026-11-24, two rounds, values consistent between rounds; exchange specifications change without notice, so treat the endpoints — not this article — as the source of truth.

This post is for education about public market data only. It is not financial advice, not a trading recommendation, and not a judgment about which venue is better. Field names, values and specifications change constantly — verify official sources before relying on any number in this article.


AI-assisted content notice: the text above was drafted with AI assistance from first-party API measurements taken by the publisher's automated research tooling, with the cited endpoints listed for independent verification. Always verify official sources.

Top comments (0)