# Hyperliquid Funding Rate Arbitrage: Spot Long + Perp Short, With a Free Bot

> How funding rate arbitrage works on Hyperliquid: buy spot, short the perp, collect hourly funding. Live rates, a worked break-even, the risks, and an open-source bot.

*Source: https://hyperliquidguide.com/guides/trading/hyperliquid-funding-rate-arbitrage*

Funding rate arbitrage is the most common "arbitrage" people mean when they search for it on Hyperliquid. You hold a spot token, short the same dollar size on that token's perpetual market, and let the perp's funding payments accrue to you. The price of the token goes up or down and your two positions mostly offset each other. What you keep, if anything, is funding minus costs.

It sounds like free money and it is not. This guide walks through how Hyperliquid funding works, the actual math of the trade with a worked break-even, the risks that sit outside funding, and how to run our open-source bot on testnet. Live funding figures were pulled on 21 November 2026.

> **Key takeaway:** The short leg earns funding while the spot leg hedges price. At base-tier taker fees, opening and closing a $1,000 pair costs about $2.30 in fees, and at the HYPE funding rate we pulled (0.00125% per hour) it takes roughly 7.7 days of funding just to pay for that. Nothing here is guaranteed, and funding changes every hour.

## How Hyperliquid Funding Works

Funding is a peer-to-peer payment between longs and shorts. Hyperliquid takes no cut. The [Hyperliquid funding docs](https://hyperliquid.gitbook.io/hyperliquid-docs/trading/funding) describe it like this:

- **Paid every hour.** The formula produces an 8-hour rate, and each hour pays one eighth of it.
- **Positive funding means longs pay shorts.** Negative means shorts pay longs.
- **The rate is a premium plus an interest component.** The interest component is fixed at 0.01% per 8 hours, or 0.00125% per hour, which the docs describe as about 11.6% APR paid to the short. Simple hourly x 24 x 365 math gives 10.95%. The premium part moves with the gap between the perp and the spot oracle price.
- **Capped at 0.5% per hour.** The docs say the cap does not depend on the asset.
- **Payment = position size x oracle price x funding rate.** It uses the spot oracle price, not the mark price.

For the full formula and the HIP-3 differences, see our [funding rates explained guide](/guides/trading/funding-rates-explained). For this trade you only need one number: the hourly rate from the API. The `metaAndAssetCtxs` info call returns it as the `funding` field for each perp, and annualizing is `hourly x 24 x 365`.

### Live Funding Rates (pulled 21 November 2026, 17:35 UTC)

| Perp | Hourly funding | Simple APR |
|------|----------------|------------|
| HYPE | +0.00125% | +10.95% |
| ZEC | +0.00125% | +10.95% |
| BTC | +0.000658% | +5.76% |
| ETH | +0.000217% | +1.91% |
| SOL | -0.001414% | -12.39% |

Two things stand out. First, a lot of markets sat at exactly 0.00125% per hour, the interest component from the docs. Second, SOL was negative: a spot-long, perp-short pair would have been paying funding, not earning it. The highest rate among perps trading over $5M a day was VVV at about 78.6% APR, but when we checked, VVV had no USDC-quoted spot pair, so it cannot be hedged this way on Hyperliquid spot. These figures are one snapshot. For the current numbers, use the [live funding rates table](/tools/funding-rates).

## The Trade, Step by Step

![Diagram of funding rate arbitrage on Hyperliquid: buy spot, short the same size on the perp, collect hourly funding, exit both legs when funding falls](/images/build/diagram-funding-arb.svg)

1. **Check funding.** Look for a perp whose hourly funding is positive and, ideally, has been for a while.
2. **Buy spot.** Buy the token on its spot market with USDC.
3. **Short the perp, same size.** Match the token quantity, not just the dollar amount, so the legs offset as the price moves.
4. **Collect funding each hour** while it stays positive.
5. **Close both legs** when funding drops below what the position is worth to you.

### What You Earn and What You Pay

You earn the hourly funding rate times your short's notional. You pay trading fees on four fills: buy spot, sell perp (to open), then sell spot and buy back the perp (to close). From the [fee reference](/guides/fees/fees-explained), the base tier is:

| Fill | Taker | Maker |
|------|-------|-------|
| Spot | 0.070% | 0.040% |
| Perp | 0.045% | 0.015% |

Volume tiers, [HYPE staking](/guides/fees/fee-tiers) and referral discounts bring these down. You also cross the spread on any taker fill, which is cost on top of the fee.

### A Worked Break-Even Example

Take $1,000 of HYPE on each leg at the funding rate we pulled, 0.00125% per hour, and assume it stays there (it will not).

- **Funding earned:** $1,000 x 0.0000125 = $0.0125 per hour, or $0.30 per day.
- **Fees with all four fills as taker:** spot 0.070% ($0.70) + perp 0.045% ($0.45) = $1.15 to open, and another $1.15 to close. Total **$2.30**.
- **Break-even on fees:** $2.30 / $0.30 = about **7.7 days** of funding at that rate, before slippage.
- **Fees with all four fills as maker:** (0.040% + 0.015%) x 2 = 0.11%, or **$1.10**, which breaks even in about 3.7 days. Maker orders can sit unfilled, though, and an unfilled leg leaves you unhedged.
- **Return on capital:** 30 days at that rate pays $9.00. You tie up the $1,000 for the spot leg plus margin for the short. With $200 of margin (5x on the perp) that is $1,200 in total, so the same 10.95% rate works out to about 9.1% a year on your capital, before fees and before any rate change.

That rate is the interest-component baseline, not a windfall. When funding is closer to BTC's 5.76%, break-even stretches to weeks. If it flips negative while you are holding, you are paying to wait.

## Which Perps Offer the Best Opportunities?

Most people ask which perp pays the most. The more useful question is which perps you can actually hedge.

**1. It needs a spot pair.** Many Hyperliquid perps have no USDC-quoted spot market. HIP-3 perps, which include stock and commodity markets, have no spot leg at all. For native perps, the spot token is often wrapped and carries a "U" prefix: the BTC perp pairs with UBTC on spot, ETH with UETH, SOL with USOL, while HYPE keeps its plain name. Our [spot trading guide](/guides/trading/spot-trading-guide) covers how spot markets and token names work.

**2. Spot liquidity limits your size.** Using the same 24-hour snapshot, HYPE had about $135M of spot volume and UBTC about $210M, but UZEC had about $15M against roughly $525M on the ZEC perp, and the ENA spot pair had about $0.2M against about $14M on its perp. A deep perp with a thin spot book is a trap for anything beyond small size, because the spot leg is the one that moves the price against you.

**3. Funding has to last.** A rate that is 78% for one hour and 5% for the next hundred does not pay. Look at funding history, not just the current print. Our [funding rates guide](/guides/trading/funding-rates-explained) shows where to find it, and the [live funding table](/tools/funding-rates) shows the current rate for every market.

**4. Fee tier matters more than it looks.** Your tier decides the break-even. See [Hyperliquid fees explained](/guides/fees/fees-explained) and what [Hyperliquid perps actually cost](/ecosystem/what-hyperliquid-perps-cost) over 90 days, market by market.

## The Risks That Are Not Funding

"Delta-neutral" describes the price exposure on paper. These are the ways the position can still lose money.

- **Funding flips.** Funding is variable. If it turns negative while you hold, the short leg pays longs. The bot's exit threshold exists for this, but an exit costs two more fills.
- **Basis and spread risk.** The perp tracks an oracle price while spot trades on its own order book. If the two drift apart when you open or close, that drift lands in your P&L. Wide spreads on thin spot books make it worse.
- **Slippage on four fills.** Taker fills pay the spread. On a thin spot pair it can exceed the fee.
- **Liquidation on the short.** A rising price loses money on the short even though the spot leg gains. How well the spot gain protects the short depends on your account type. In a Unified Account, perps are collateralized by USDC only, so the spot token does not back the short unless you use Portfolio Margin. See our [unified accounts guide](/guides/trading/unified-accounts-guide). Lower leverage and isolated margin leave more room. Read [liquidation explained](/guides/trading/liquidation-explained) and [isolated vs cross margin](/guides/trading/isolated-vs-cross-margin) before sizing the short.
- **Standard (Manual) accounts keep spot and perp balances apart.** You need USDC in the spot balance to buy the token and separate margin in the perp balance. A Unified Account shares the USDC between the two.
- **Capital is tied up on both sides.** The yield is on the total you commit, not on the notional of one leg.
- **Execution can fail halfway.** If one leg fills and the other does not, you hold a directional position. The bot below buys spot first and checks the fill before it sends the short.

This is not tax advice. Funding payments and spot trades both generate records, so see our [tax reporting guide](/guides/trading/hyperliquid-tax-reporting-guide) and talk to a professional.

## Our Open-Source Funding Arbitrage Bot

 We publish a free, MIT-licensed starter bot in the [hyperliquid-starter-bots repository](https://github.com/Hyperliquidguide/hyperliquid-starter-bots), in `bots/funding_arb.py`. It is part of the [/build](/build) page's set of bots. It is a teaching file, short enough to read in a sitting, built on the official Python SDK. We read it to write this section, so this is what it does.

**What it does, each loop (every 30 seconds by default):**

1. Reads the hourly `funding` rate from `meta_and_asset_ctxs` and converts it to APR with `hourly x 24 x 365`.
2. Finds the spot pair for the perp's base token. It tries the plain name first and then the "U" prefix (BTC becomes UBTC), and keeps the USDC-quoted pair. If there is none, it exits with a message.
3. Reads both legs from your account, so a restart picks up where it left off.
4. If it is flat and funding APR is at or above `--min-apr`, it **buys spot first**. The order is an immediate-or-cancel order priced within 1% of the mid. **It sends the perp short only if the spot buy filled**, sized to what you actually got. If the short fails, it sells the spot back.
5. If it is hedged and funding falls below `--exit-apr`, it sells the spot and closes the short with a reduce-only order.
6. On exit (Ctrl+C or `--run-seconds`), it cancels open orders but leaves positions as they are.

**What it refuses or checks:**

- Coins with a colon in the name, which are HIP-3 markets, are rejected because they have no spot leg.
- If the account is short of spot USDC, it logs that the spot leg cannot fill instead of sending a rejected order.
- It skips an entry if the smallest tradable lot is well above your order size.
- A loss limit (`--max-loss-usd`) stops the bot if equity drops that much, and order sizes are capped around 125% of `--order-usd`.

**Arguments:**

| Flag | Default | Meaning |
|------|---------|---------|
| `--coin` | BTC | Perp base name with a spot token, e.g. BTC, ETH, HYPE |
| `--min-apr` | 15 | Enter when annualized funding is at least this many percent |
| `--exit-apr` | 5 | Exit when it falls below this |
| `--order-usd` | 15 | Notional per leg (minimum $10) |
| `--max-loss-usd` | 15 | Stop when equity falls by this much |
| `--dry-run` | off | Log orders instead of sending them |
| `--run-seconds` | 0 | Stop after this many seconds, 0 means run until Ctrl+C |

Entry looks at the current rate only. It does not include fees in the entry test, it pays taker fees on both legs, and it does not rebalance if the legs drift. The file's own notes list those as things to build on.

### Run It on Testnet First

You need Python 3.10+ and a wallet that has made a mainnet deposit, which the testnet faucet requires. Then:

```bash
git clone https://github.com/Hyperliquidguide/hyperliquid-starter-bots
cd hyperliquid-starter-bots
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt

# Get testnet USDC at https://app.hyperliquid-testnet.xyz/drip, then create an API wallet
python -m scripts.setup_wallet

# Watch the bot decide without sending orders
python -m bots.funding_arb --coin HYPE --min-apr 20 --dry-run
```

Once the dry run reads sensibly, drop `--dry-run` to trade on testnet. Our [trading bot setup guide](/guides/trading/trading-bot-setup-guide) and [API guide](/guides/trading/hyperliquid-api-guide) cover API wallets and the endpoints it uses.

> **Warning:** **No returns are promised.** This is a starting point, not a strategy with a proven edge. Real money can be lost, quickly. Run it on testnet, keep sizes small, and read the repository's DISCLAIMER.md before you point it at mainnet.

> **Note:** **Referral disclosure.** On mainnet, if your account has no referrer yet, the bot applies our referral code (CONCEPT211). That gives you 4% off trading fees on your first $25M of volume, and we receive a share of the fees you pay. It never replaces an existing referrer, it skips testnet, and `HL_REFERRAL=off` in your `.env` opts out.

**Open a Hyperliquid Account for Spot and Perps** — Sign up through our link for 4% off fees on your first $25M of volume. Fees decide the break-even on a four-fill trade. [Join Hyperliquid](https://app.hyperliquid.xyz/join/Concept211)

## Before You Put Real Money In

- **Check funding history, not one reading.** One hourly value says little about the next week.
- **Include fees and slippage in your break-even.** Compute it with your own tier, as in the example above.
- **Know your account type.** Unified, Portfolio Margin and Manual handle collateral differently, which changes liquidation risk on the short. See the [unified accounts guide](/guides/trading/unified-accounts-guide).
- **Size the spot book, not just the perp.** Your hedge is only as good as the thinner side.
- **Start with a dry run, then testnet, then a small mainnet position.**

Funding arbitrage also sits next to other bot strategies. Our [Hyperliquid trading strategies](/guides/trading/hyperliquid-trading-strategies) guide compares it with market making and trend following, and the [market making guide](/guides/trading/hyperliquid-market-making-guide) covers the fee side from the maker's view. If you are new here, [how to trade on Hyperliquid](/guides/getting-started/how-to-trade-on-hyperliquid) is the place to begin.

**Check Live Funding Before You Trade** — See the current funding rate for every Hyperliquid perp, then run the numbers with your own fee tier. [Join Hyperliquid](https://app.hyperliquid.xyz/join/Concept211)
