Skip to content

Trading9 min read

Crypto pairs trading: spreads, z-scores and hedge ratios explained

How crypto pairs trading and basket trading work, from hedge ratios and z-score entries to cointegration, sizing, funding on both legs and leg risk.

, Founder of Hypr Markets

Published

On this page

Crypto pairs trading means buying one market and selling another that usually moves with it, then waiting for the gap between them to return to normal. You are not betting on the direction of the market. You are betting on the relationship between two markets. On perpetual futures both legs are easy to hold, long or short, which is why pairs and baskets are common on exchanges like Hyperliquid.

This guide is for traders who want to understand the mechanics before they try it, and for operators who offer the tools. It covers the spread, the hedge ratio, z-score entries and exits, why cointegration matters more than correlation, how to size each leg, a worked example with costs, and the risks that catch people out.

It is education, not trading advice. Every number below is an example.

What is crypto pairs trading?

Pairs trading is a relative value strategy. Take two markets that tend to move together. When one rises much more than the other, sell the one that rose and buy the one that lagged. If the relationship holds and the gap narrows, the trade gains whether the whole market went up or down.

The idea is old. One of the best-known studies, by Gatev, Goetzmann and Rouwenhorst, matched US stocks whose normalized prices moved together and opened a trade when a pair diverged. In crypto the same logic applies to markets that share a driver: two layer-one tokens, a token and its sector, or two assets that tend to be priced against each other.

Basket trading crypto

A basket extends the idea to more than two markets. You might hold three or four markets long against three or four short, weighted so the overall exposure is close to neutral. Baskets spread the risk of one market misbehaving across several, at the cost of more orders, more fees and more funding lines to watch.

The spread and the hedge ratio

The spread measures the gap between the two legs. With log prices it is usually written:

spread = ln(price A) - beta × ln(price B)

Beta is the hedge ratio: how much A tends to move for each move in B. It is commonly estimated with a regression of A's log price on B's over a lookback window. A beta of 1.2 means that, over that window, A tended to move about 1.2% for every 1% move in B.

Fixed vs rolling hedge ratio

  • Fixed: estimate beta once over a long window and keep it. Simple and stable, but it goes stale if the relationship changes.
  • Rolling: re-estimate beta on every new candle over the last N candles. It adapts to change, but a short window makes beta jump around with noise, and a moving beta also moves the spread you are trading.

There is no correct window. Short windows react and overfit; long windows are steady and slow. Test both on history before trusting either.

Z-score entries and exits

A raw spread is hard to compare across pairs, so traders standardize it:

z = (spread - mean of spread) / standard deviation of spread

The mean and standard deviation come from the same lookback window. A z-score of 2 means the spread is two standard deviations above its recent average.

A typical rule set, with example levels:

RuleExample levelAction
Enter short spreadz above +2.0Short A, long B
Enter long spreadz below -2.0Long A, short B
Exitz back inside ±0.5Close both legs
Stopz beyond ±3.5Close both legs at a loss

The stop matters. A spread that keeps widening may not be a bargain: the relationship may have broken.

Cointegration vs correlation

Correlation measures whether two markets' returns move together day to day. It says nothing about whether the gap between their prices comes back. Two markets can be highly correlated while one steadily outgrows the other, and a spread between them would trend away and never return.

Cointegration is the property pairs traders actually need. In the definition from Engle and Granger's 1987 paper, two series that each wander without a fixed mean are cointegrated when some combination of them is stationary: it keeps returning to a stable level. That combination is the spread.

A common two-step check: regress one price on the other to get beta, then test the leftover spread for stationarity. A pair that passes on one window can fail on the next, so the test is a starting filter, not a guarantee.

Dollar-neutral vs beta-neutral sizing

Dollar-neutral sizing puts the same notional on each leg: $10,000 long and $10,000 short. It is simple, but if A moves 1.2 times as much as B, the pair still carries market exposure.

Beta-neutral sizing scales one leg by the hedge ratio so a market-wide move cancels out. With beta at 1.2 and $10,000 short A, the long B leg is 1.2 × $10,000 = $12,000.

Example: the whole market rises and B gains 10%. With beta at 1.2, A would be expected to gain about 12%.

SizingShort A ($10,000)Long BNet from the market move
Dollar-neutral-$1,200+$1,000 on $10,000-$200
Beta-neutral-$1,200+$1,200 on $12,000about $0

Beta-neutral removes the expected market effect, but only to the extent beta is right.

A worked crypto pairs trading example

All numbers are examples, not market data.

  1. Setup. Markets A and B. Beta over the lookback is 1.2. The spread's mean is 0 and its standard deviation is 0.03 (in log terms).
  2. Signal. The spread reaches +0.066, a z-score of 2.2. The rule says short the spread: short A, long B.
  3. Size. Beta-neutral: $10,000 short A and $12,000 long B.
  4. Exit. Three days later the spread falls to +0.015, a z-score of 0.5. Both legs close.

For small moves, the gain on a short spread is roughly the notional of A times the change in the spread: $10,000 × 0.051 = $510 before costs.

Now the costs:

  • Trading fees. Four fills (open and close on both legs) on $44,000 of total notional. At an example rate of 0.05% per fill, that is $22. Real rates depend on the venue and maker or taker; see Hyperliquid fees explained.
  • Funding. Hyperliquid pays funding every hour, and each payment is position size × oracle price × funding rate. Say A's rate is +0.0010% an hour and B's is +0.0030%. Positive funding means longs pay shorts, so short A receives about $0.10 an hour and long B pays about $0.36. Net: about $0.26 an hour, or about $18.72 over 72 hours if the rates stayed constant.

Net in this example: about $510 - $22 - $19, roughly $469. Had the spread hit the stop at z 3.5 instead (spread +0.105), the loss would have been about $10,000 × 0.039 = $390, plus the same kind of costs.

Funding on both legs

On perpetuals, funding is a cost or income on each leg independently. A pair that is long the market with high positive funding and short the market with low funding pays the difference every hour, whatever the spread does. When funding on the two legs diverges sharply, it can outweigh a slow-moving spread. Check both rates before entry and watch them while the trade is open. The basics are in funding rates explained.

Leg risk and execution

A pair is two trades, and they do not have to fill the same way.

  • Partial and failed fills. Hyperliquid's order action takes a list of orders and returns a status for each one: resting, filled or an error. One leg can fill while the other rests or is rejected, leaving you with an outright position you did not want.
  • Slippage. The less liquid leg usually moves more against you. A thin market can eat a large part of the expected edge.
  • Margin. In isolated margin each leg has its own liquidation price, so one leg can be liquidated while the pair as a whole is fine. In cross margin the legs share equity. The trade-offs are in isolated vs cross margin.

Pairs and baskets on a Hypr Markets terminal

Pairs and baskets is a module on the Scale plan (the "Contact us" tier on pricing). On a terminal that switches it on:

  • Pair trades follow the z-score of the spread between two markets, with a fixed or rolling hedge ratio (rolling from 10 to 500 candles), and entry, exit and stop levels set on the z-score.
  • Pair sizing is dollar-neutral or beta-neutral.
  • Baskets hold 2 to 12 markets, long and short, with weights that rebalance on a schedule, when they drift too far, or both.
  • Every leg is sent in one exchange action and unwound if a leg does not fill.
  • A paper test on history and pre-trade checks for leverage, margin and net exposure come before anything goes live, and a monitor shows every leg, every decision and its z-score.

The Pairs and baskets page has the details. For rules that go beyond spreads, the guide to building a Hyperliquid trading bot without code covers Strategy Studio.

Frequently asked questions

Does pairs trading work in crypto?

The mechanics work the same way as in other markets, but results are never guaranteed. Crypto relationships can shift quickly, and funding, fees and slippage on two legs reduce the edge. Test a pair on history and with small size before relying on it.

What is a good z-score to enter a pair trade?

Many traders start with an entry around ±2 and an exit near 0 or ±0.5, but these are conventions, not rules. Tighter entries trade more often with smaller moves; wider entries trade less and risk more in a broken relationship. A stop beyond the entry level limits the damage when the spread keeps widening.

What is the difference between cointegration and correlation?

Correlation measures whether returns move together. Cointegration means a combination of the two prices, the spread, tends to return to a stable level. Pairs trading needs the second: a correlated pair whose spread trends away can lose money steadily.

What is a hedge ratio in pairs trading?

It is how much of one market offsets a move in the other, often estimated by regressing one log price on the other. A hedge ratio of 1.2 means sizing the second leg at 1.2 times the first for a beta-neutral pair. It can be fixed or recalculated on a rolling window.

How does funding affect a pairs trade on perpetuals?

Each leg pays or receives funding on its own. On Hyperliquid funding is paid every hour. If the long leg's funding is much higher than the short leg's, the pair pays the difference continuously, which can outweigh a slow-moving spread.

All articles