Aperiodic/Markets from First Principles
Markets from First Principles/Part 3, Today's markets

Lesson 7 of 10

A contract that never expires

How do you trade bitcoin without ever holding any, and what happens when everyone borrowed to do it?

DMBy Daniel and Mark
14 min

So far: Every trade pushes the price a little and a big one pushes it more; part of the push fades and part of it stays (lesson 6).

You can trade bitcoin without ever owning one, through a contract that pays as if you held the coin: when bitcoin rises by 100 dollars, the buyer of a contract for one coin makes 100 dollars and the seller loses them.

The classic contract of this kind is a futures contract: a promise to buy something on a set date at a price agreed today. Its price can drift away from the price of the thing itself, the spot price, until the date pulls it back: on the day, a contract to buy bitcoin right now is worth exactly what bitcoin is worth.

A perpetual is a futures contract with the date taken away, so nothing on the calendar pulls its price to spot. Something else has to.

Funding

Every contract has two sides. Whoever bought it is long and gains when the price rises; whoever sold it is short and gains when the price falls, without ever having owned a coin.

The perpetual is measured against an index, a price for the coin built from spot exchanges. At set times the two sides settle up with a payment called funding: every eight hours by default on Binance, every hour on Hyperliquid. When the perpetual trades above the index, longs pay shorts. When it trades below, shorts pay longs.

Step 1 of 4

Move the perpetual's price above and below its index. Watch which way the payment flows.

99.799.899.9100.0100.1100.2100.3perpetual 100.10index 100.00
Longspay
$10 to shorts
Shortsreceive
100.10
Live: Longs pay shorts
Premium over the index
+0.10%
Funding rate
+0.10%
A $10,000 long pays
$10

The perpetual costs more than the coin, so longs pay shorts: $10 on every $10,000 they hold, at every funding time. Holding the short now earns something.

The payment is the position times the ƒfunding rate. In this toy the rate is simply the premium, the gap as a share of the index: at 0.10% above it, a long holding $10,000 pays $10 at each funding time. Binance and Hyperliquid average the premium over the period and add a small interest term.

While longs pay shorts, a trader can buy a coin on a spot exchange and sell the same amount of the perpetual. One side gains what the other loses, so the trader carries no price risk and collects funding for as long as the premium lasts. This is an arbitrage, and its selling pushes the perpetual's price down toward the index. The next figure starts a week with the perpetual 0.30% above its index.

Step 2 of 4

Choose how many traders buy the coin and sell the perpetual, then run the week. Watch the gap, and what the longs pay.

3

Start of the week. The perpetual is 0.30% above its index. Run the week with 3 arbitrageurs.

With nobody arbitraging, the premium sits at 0.30% all week and a long holding $10,000 pays $630 in funding. With three arbitrageurs it's down to 0.03% by the end of the week, and the long pays $246. It never quite reaches zero, because arbitrageurs stop once funding no longer covers their fees and the money tied up in the coin.

The gap between a perpetual's price and its index is its ƒbasis. Funding charges whichever side holds the price away from the index, and pays whoever helps close the gap.

The maths

With the perpetual at price F, the index at I and a position worth Q dollars:

premium = (F − I) / I

toy funding rate r = premium; a long pays Q · r, a short receives it

Binance's rate for an eight-hour period, with P the premium averaged over the period and an interest term of 0.01%:

r = P + clamp(0.01% − P, −0.05%, 0.05%)

So while P sits between −0.04% and 0.06%, the rate is 0.01%.

Open interest

Every contract has one long and one short, so counting either side counts the contracts still open: the ƒopen interest. Each trade has a buyer and a seller, and each of them is either opening a position or closing one.

Step 3 of 4

Pick who buys and who sells, then trade one contract. Watch open interest and volume part ways.

Long
ABC
Short
DEF
The buyer
The seller

Three contracts open. Every trade has a buyer and a seller. Choose what each of them is doing, and trade.

When both sides open, a contract is created. When both close, one ends. When one opens and the other closes, a contract changes hands and the count stays put. Volume counts every contract traded, so a busy day can leave open interest exactly where it started.

Borrowed money

A perpetual asks only for a deposit, the margin, and the venue lets you hold a position several times bigger. Hold $10,000 of bitcoin on $1,000 of margin and your leverage is 10×: every 1% the price moves is 10% of your money.

If the losses use up the whole margin, the venue closes the position for you before anyone else has to cover them, selling at whatever the book will pay. That is a liquidation. In this lesson's toy it happens when the loss reaches the margin: after a 10% fall at 10×, or 5% at 20×. Binance, for one, steps in earlier, at a smaller amount it calls the maintenance margin (its liquidation rules), and it judges the loss by a mark price rather than the last trade, so one odd trade can't liquidate anyone (how Binance builds it).

A liquidation is a forced sale, and a forced sale walks the price down the book (lesson 5), where it can reach the next trader's liquidation price. Below, 20 traders are all long from 100, each with their own leverage.

Step 4 of 4

Pick how much the crowd borrowed, then let a big seller knock the price down. See whose lines it reaches, and how far it falls.

Typical leverage in the crowd

Everyone is long from 100. At 10×, the highest line is at 96.2. Let the big seller in.

At 2× and 5× nobody's liquidation line is within reach of 96. At 10× the highest line sits just above 96, and each forced sale pushes the price into the next line until half the crowd, 10 of 20, is gone and the price is at 91. At 20× the chain runs through everyone and ends at 86. The big seller moved the price by 4 every time; what changed was how much everyone had borrowed.

Each liquidation closes a long. When the buyer on the other side is a short closing out, a contract disappears, so a cascade can show up as open interest falling sharply while the price falls.

The maths

With margin M on a position worth Q, bought at price E:

leverage L = Q / M

toy liquidation price for a long = E · (1 − 1 / L)

At 10×, from 100: 100 · (1 − 1/10) = 90, a fall of 10%.

In real data

Bitcoin's perpetual, one bar

Last trade103,817.20
Mark price103,817.20
Index price103,859.74
Basis, mark minus index−42.54 (−4.1 bps)
Funding rate0.0055%
Open interest81,053 BTC, $8.41 billion

At the end of the five minutes from 14:00 UTC on 14 May 2025, Binance's bitcoin perpetual last traded at 103,817.20 dollars, and its mark price was the same. The index stood at 103,859.74, so the basis, mark minus index, was −42.54 dollars or −4.1 basis points: the perpetual was a little cheaper than the coin. Over the hour below, the mark sat under the index at the close of every bar.

103,600103,800104,000104,20013:05 UTC14:00 UTC
  • mark price
  • index price

Even so, Binance's next funding, at 16:00 UTC, had longs paying shorts: 0.0055%, about 55 cents on every $10,000. Its interest term holds the rate at 0.01% while the averaged premium sits between −0.04% and 0.06% (its funding rules), so a rate a little under 0.01% means that premium was a little under −0.04%.

Open interest was 81,053 bitcoin, about $8.41 billion at the mark price. Each bar's basis, funding rate and open interest are in ƒBasis, ƒFunding and ƒOpen Interest, and its last, mark and index prices in ƒDerivative Price.

Binance BTC-USDT perpetual, the five-minute bar from 14:00 UTC on 14 May 2025 and the eleven before it, from Aperiodic's free sample. Prices in US dollars; each value is the last one in its bar.

What you learned

Futures contract
A promise to buy or sell on a set date at a price agreed now. The date pulls its price to the price of the thing itself.
Perpetual
A futures contract with no date. Funding keeps its price near an index instead.
Funding rate
What longs pay shorts at each funding time when the perpetual is above its index, or shorts pay longs when it is below, as a share of the position.
Basis
How far the perpetual's price is from its index, often in basis points. Funding charges whoever holds it apart.
Open interest
The contracts still open, each with one long and one short. Opening and closing change it; a contract changing hands doesn't.
Leverage
A position bigger than your margin. When losses use up the margin the venue sells you out, and that sale can push the price to the next trader's liquidation price.

Check yourself

  1. 1. A perpetual trades at 100.20 while its index is at 100.00. Who pays funding?

  2. 2. Open interest is 3. Someone opening a new long buys from a long who wants out. What is open interest after the trade?

  3. 3. You hold $10,000 of a perpetual on $1,000 of margin. Under this lesson's toy rule, how far must the price fall before you are liquidated?

Lesson 7 of 10.

Next

Lesson 8: A stock that trades on Sunday

What is a Tesla perpetual, and what does it do while Nasdaq is closed?

Read lesson 8All lessons

Your progress stays in this browser. A free account keeps it on any device and lets you pull the data behind these lessons yourself: every metric for 2025 on BTC, ETH, SOL and 10 RWA perps, on an API key of your own. Get the data

Read every lesson on one page

14 min left
  1. A contract that never expires
  2. Funding
  3. Open interest
  4. Borrowed money
  5. In real data
  6. What you learned
  7. Check yourself
Aperiodic

Built from hundreds of terabytes of raw data and distilled into point-in-time metrics you can pull as parquet files. Plus the raw trades, quotes and derivatives data behind them.

Use Cases
  • Improve your backtest
  • Find new alpha
  • Execute smarter
Indices
  • All indices
  • Aperiodic Cost Index
  • Aperiodic Depth Index
  • Aperiodic Impact Index
Metrics
  • Metrics library
  • Data Catalog
  • Free data
  • Live markets dashboard
  • Every perp, A–Z
  • Global Liquidity
  • Unusual activity
  • Order Flow
  • L1 & L2
  • Derivatives
  • RWA
  • Live funding rates
  • Raw Data
Developers
  • Docs
  • API Docs
  • MCP Server
  • Notebooks
  • Integrations
  • For AI Agents
  • Atlas Security Master
  • TParquet
  • Binance OI history API
  • OKX history APIs
  • Pre-flight
  • Changelog
  • Roadmap
  • llms.txt
Learn
  • Markets from First Principles
  • Replays
  • Microstructure Guide
  • Architecture
  • Research Blog
  • FAQ
Compare
  • All vendors
  • Pricing compared
  • vs. Tardis
  • vs. CoinGlass
  • vs. Kaiko
  • vs. Amberdata
  • vs. Crypto Lake
  • vs. Laevitas
  • vs. Coinalyze
  • vs. Binance public data
  • vs. Hyperliquid data
  • Binance archive
  • Hyperliquid data
Company
  • Team
  • Pricing
  • Contact
  • Book a call
  • Terms of Service
  • Privacy Policy
  • Licensing
  • SLA

© Copyright 2026 Aperiodic. All Rights Reserved.

Aperiodic Limited · Registered in Ireland · Company No. 815273 ·
136 Capel Street, Dublin D01 T2C9, Ireland