Hyperliquid Cash-and-Carry Basis Trade: Step-by-Step Setup
A cash-and-carry on Hyperliquid means buying spot on a CEX while shorting the perpetual on Hyperliquid to lock in the annualized basis spread with near-zero delta. This tutorial covers position sizing, margin requirements, roll timing, and how to hedge liquidation risk during funding spikes.
The Hyperliquid cash-and-carry basis trade exploits the persistent premium that perpetual contracts trade at relative to spot. You buy the underlying on a CEX, short the equivalent notional on Hyperliquid's perp market, and collect the annualized basis spread plus any positive funding — all while holding near-zero net delta. It sounds simple, but the details around margin buffers, position sizing, and liquidation risk during funding spikes are where most implementations break down.
How the Basis Spread Actually Works
Hyperliquid perps have no expiry, so the funding mechanism is the only force anchoring them to spot. When the market is in a persistent bull trend — or when leveraged longs dominate open interest — the 1-hour funding rate can run at 0.05–0.15% per period, which annualizes to 43–131%. That's your gross yield.
The basis spread you capture is slightly different from the funding rate alone. It's the combination of:
- Funding income: received by your short position every hour when the rate is positive
- Cash-and-carry basis: the premium at which you can open the short versus the spot price you paid
When you open both legs simultaneously, you lock in the entry basis. From that point forward, your P&L is purely the sum of funding payments minus borrow costs and exchange fees, until you unwind both legs.
Position Sizing and Margin Requirements
Getting position sizing right is the first thing that separates a robust implementation from a fragile one.
Step 1 — Determine available capital. Say you have $100,000 to deploy. On Hyperliquid, the initial margin for a cross-margined perp short at 5x leverage requires 20% of notional. To keep a healthy buffer against liquidation, size to 3x effective leverage — meaning you allocate roughly $33,000 of margin for a $100,000 notional short. The remaining $67,000 sits in your spot position on the CEX.
Step 2 — Match notional exactly. Delta neutrality requires that the notional value of your spot long equals the notional value of your perp short, in the same asset. If you buy 1.0 BTC spot at $65,000, you short 1.0 BTC on Hyperliquid perps at whatever the mark price is. The slippage between those two fills is your entry basis — record it.
Step 3 — Maintain cross-margin buffer. Hyperliquid's cross-margin pool lets unrealized gains on other positions contribute to margin, but in a pure basis trade you typically run isolated margin per position. Keep at minimum 2x the initial margin as your buffer — more during high-volatility regimes. A $100K short at 5x leverage liquidates if the perp mark price rises more than ~20% above your entry. Your spot position has gained an equivalent amount, but you can't instantly transfer it to Hyperliquid to top up margin without the position going underwater first.
Hedging Liquidation Risk During Funding Spikes
Funding spikes are the biggest operational risk. When sentiment flips violently bullish, the mark price can gap up several percent in minutes, and if your margin buffer is thin, the liquidation engine hits you before you can react.
Three tactics that work in production:
- Auto top-up trigger: run a keeper process that monitors your margin ratio every 30 seconds. When it drops below 150% of initial margin, automatically transfer USDC from the CEX to Hyperliquid and top up. The transfer time via bridge is the critical latency here — factor 5–15 minutes for on-chain settlement.
- OTM call hedge on the spot leg: buying a slightly out-of-the-money call on the CEX (or via Deribit) gives you convex protection against a fast gap-up. Yes it costs carry, but it's cheaper than a forced liquidation on a $100K short.
- Hard position cap during elevated funding: if annualized funding exceeds 100%, the market is in a speculative frenzy. Reduce notional by 30–50%. The funding income is tempting, but liquidation risk is non-linear in these regimes.
Our funding-rate arbitrage bot automates both the margin monitoring and the auto top-up — it's wired into Hyperliquid's websocket and rebalances the hedge the moment margin thresholds are crossed.
Roll Timing and Execution
Because Hyperliquid perps have no expiry, there's no mandatory roll — but you do need an unwind strategy. The optimal exit is when the basis compresses: either because the market has de-leveraged, funding has gone flat or negative, or the spread between your entry basis and current mark has narrowed to near zero.
Entry timing: open both legs within the same minute. Use limit orders on Hyperliquid (post-only to avoid taker fees) and a market order on the CEX spot side, or vice versa. Price slippage between legs is your bleed-in basis — keep it under 0.1% for the trade to make sense.
Exit timing: close the Hyperliquid short first, then sell spot. Closing the perp short first reduces your risk exposure immediately. If you sell spot first, you're briefly running a naked long perp, which has tail risk.
Fee math: Hyperliquid maker fees are 0.02% per side; taker fees are 0.05%. On a $100K trade, round-trip taker fees are ~$100. Add CEX spot fees (~0.1% round trip = ~$100) and you need at least $200 in basis plus funding to break even. At 0.01% per hour (8.76% annualized), you break even in roughly 23 hours on a $100K position. Anything beyond that is profit.
Monitoring and Automation
Running this manually is viable for a single position but unscalable across multiple assets. In production, we wire up:
- Funding rate aggregator — polls Hyperliquid's
/infoendpoint every minute, ranks assets by annualized funding, and flags when a new trade opportunity crosses the minimum threshold (typically 15% annualized net of fees) - Margin ratio monitor — websocket subscription to account state, triggers alerts and auto top-ups
- PnL attribution — separates funding income from mark-to-market basis changes so you know whether you're actually earning carry or just riding a correlation
If you want something that handles this end-to-end, the architecture is closely related to what we build for Hyperliquid delta-neutral strategies. You can also see how we approached a similar cross-venue structure in the cross-venue arbitrage case study — the execution logic for matching legs across venues is nearly identical.
What Can Go Wrong
The trade looks low-risk but it isn't risk-free. The real P&L killers are:
- Negative funding: Hyperliquid funding can go negative, meaning your short pays out rather than receives. You don't lose your principal, but your carry flips negative. Monitor 8-hour rolling average funding; exit if it stays below -0.01% for more than 24 hours.
- Basis blowout on exit: if you need to exit quickly (e.g., a margin call on another position forces a cross-margin withdrawal), you may exit both legs at a wide spread. Always size so you can afford to hold through a 5% adverse basis move.
- Counterparty risk on the CEX leg: your spot is sitting on a centralized exchange. Use a reputable venue, keep CEX position sizes within insured or withdrawal-accessible limits, and don't concentrate all spot in one place.
The basis trade is one of the cleaner yield strategies in crypto precisely because the profit mechanism is mechanical, not predictive. But it rewards operators who instrument it properly and punishes anyone who underestimates the margin management overhead.
If you want a fully automated cash-and-carry system built around your capital and risk parameters, reach out to TierZero — we scope and build these in production.
Need a bot like this built?
We design, build and run trading bots on Solana, Hyperliquid and Polymarket.
Start a projectMore from the blog
Public vs Paid RPC: How to Run a Fair Benchmark
A fair comparison of public and paid RPC endpoints must account for quotas, workload, freshness and support guarantees.
Read articleRPC Benchmark Percentiles Explained: p50, p95 and p99
Why averages hide the latency spikes that break trading bots, wallets and production blockchain applications.
Read articleHyperliquid REST vs WebSocket Benchmark: What to Measure
A benchmark plan for Hyperliquid market data that separates request latency from streaming freshness and recovery.
Read article