Skip to content

Arbitrage bot

How the arbitrage bot holds a long and a short in one coin on Hyperliquid and Aster to earn the funding gap: costs, risks, settings and safety orders.

On this page

An arbitrage bot holds two positions in the same coin at once: a long on one market and a short on another. Together they are a pair, and each position is a leg. When the coin's price moves, one leg gains about what the other loses. What is left is the difference in funding between the two markets, minus fees.

How it works

The bot looks for three kinds of spread. You choose which ones it may trade.

StrategyLongShortEarns
Funding spreadThe perp with the lower funding (Hyperliquid or Aster)The perp with the higher fundingThe funding difference, settled every hour on Hyperliquid and every 1 to 8 hours on Aster
Spot–perp (HL)The coin on Hyperliquid spotIts Hyperliquid perpPositive funding on the perp. Only when funding is positive: spot can't be shorted. Where Prow hasn't turned spot–perp on, it shows live numbers only and a bot with it on can't be started
Price gapThe cheaper venueThe dearer venueThe gap closing back to its usual level. Off by default

Funding spreads usually close within days, and price gaps within seconds. Most of what looks like a price gap between Hyperliquid and Aster is a steady difference between USDC and USDT prices, not a gap that closes. So the bot measures each coin's usual gap and only counts the part above it.

Most of the time nothing qualifies and the bot waits. It opens a pair only when the spread pays for both legs' costs within your horizon (72 hours by default) and still leaves at least your entry threshold (8% a year, after costs).

What we found

Before building the bot we tested this trading on 25 coins over 2025 and 2026, with Hyperliquid, Aster and Lighter prices:

  • Trading as this bot does, one leg as a limit order and the other at market, with the liquidation guard, it earned about 0.3–1.4% a year on the capital.
  • With both legs as limit orders it earned 3–7% a year. A bot can't do that and stay hedged: while one limit order waits, the other leg is exposed.
  • In Prow's tests on past prices, the bot with its default settings, on 24 of those coins over the last 180 days, lost about 0.9% a year. It entered few pairs, almost all in HYPE and ZEC.
  • The two main risks are modelled only roughly: one leg being stopped or liquidated while the other is open, and limit orders filling just before the price moves against them.

These are past, simulated results. They don't predict what the bot will do next.

Before you start

  • A Hyperliquid account for every strategy, and an Aster account for funding spreads and price gaps. The same wallet on both venues signs once; two wallets sign once each.
  • Money already on each venue. The bot uses the free balance of each account: USDC on Hyperliquid and USDT on Aster. It can't move funds between venues, or between spot and perps. Before each pair it reads both balances again and opens the pair only if each venue still has your Keep free on each venue share (20% by default) free afterwards; if not, it tells you once a day.
  • Spot–perp buys with USDC in your Hyperliquid spot balance. Move USDC from perps to spot with your wallet first. The bot opens a spot–perp pair only while your spot account holds less than $10 of that coin, so its coins are never mixed with yours. After a start it needs about 10 minutes of prices before its first spot–perp pair.
  • Aster needs one-way position mode and single-asset margin, as for every bot.
  • Lighter: bots can't trade on Lighter.

The settings

Open the builder from Start a bot > Arbitrage (see Start an arbitrage bot). Its header row shows the coin, its price on Hyperliquid and on Aster, the gap between them and each venue's funding. The chart shows both legs' funding (Funding) or the prices (Price) over 24h, 7D or 30D, next to both venues' order books.

The panel shows which leg goes where (for example Short on Aster and Long on Hyperliquid), the Hyperliquid account and Aster account the legs trade on, and then:

FieldDefaultWhat it does
InvestmentThe most the bot may use across both venues: each futures leg's margin (its size ÷ leverage), and a spot leg at its full value. The field shows what is available on the venue with less, and what goes to each venue. Signed
Leverage per leg2x1x to 3x, isolated. Its (i) says how far the price can move before a futures leg is liquidated; a spot leg can't be liquidated

Under them, The pair now shows Funding gap now (a year), Fees paid back in (how long today's gap takes to pay for a round trip), Size per leg and Opportunities now (your markets on the scanner and whether the bot would enter each one, or why not).

Manual adjustment sums the entry up in one line, for example "From 8% a year, horizon 72 h, hold up to 7 days". Open it for:

FieldDefaultWhat it does
StrategiesFundingFunding (funding spread), Spot–perp and Price gap. Spot–perp and Price gap are offered only where Prow has turned them on
MarketsBTC, ETH1 to 10 coins, Add market to add one: listed on both venues for funding spreads and price gaps, on Hyperliquid spot and perps for spot–perp. A market another of your bots runs on is skipped while that bot runs
Max pairs at once1Up to 3
Size per pair (each leg)Investment × leverage ÷ (2 × max pairs); with spot–perp on, investment ÷ (max pairs × (1 + 1 ÷ leverage))The size of each leg. The bot builds it in 4 orders
Enter at net APR ≥8%After both legs' venue fees, Prow's fee, slippage and gap risk
Horizon72 hoursHow long the spread has to pay back the costs, 8 to 720 hours. Not longer than Max hold
Max hold7 daysA pair closes after this, whatever the spread, 1 to 30 days. Signed
Hedge with a limit firstOffWhere Prow has turned it on: tries a limit order for up to 2 seconds before hedging at market

Safety limits, at the end of Manual adjustment:

FieldDefaultWhat it does
Max unhedgedOne order's size, for 5 secondsHow much may be open without its other leg, and for how long (for at most, up to 30 seconds). If the second leg doesn't fill in time, the bot sells the first back. Signed
Liquidation guard75%The pair closes when a leg has moved this far toward its liquidation price (50% to 85%)
Venue stop at80%Each leg's stop on its venue, past the guard. Signed
Mirror margin0.5%How far past the other leg's stop each leg's mirror order sits. Up to 1%. Part of the limits you sign
Hedge slippage0.3%The worst price the second leg may fill at. Up to 1%. Part of the limits you sign
Price gap: exit within0.02%A price-gap pair closes when the gap is back within this of its usual level
Cooldown per coin12 hoursWait after a pair closes before the same coin opens again
Keep free on each venue20%Margin the bot leaves for your own trading, at least 10%
Max loss5% of capitalThe bot closes every pair and stops. Signed

How a pair opens and closes

  1. A limit order waits on one venue

    Usually on Aster, priced from Hyperliquid's order book. If Hyperliquid's price moves, the bot cancels and re-prices it.

  2. The other leg is bought or sold at market the moment it fills

    Within your hedge slippage. Each fill is hedged on its own, so the pair grows clip by clip and stays balanced.

  3. If the second leg doesn't fill in time

    The bot sells the first leg back (or buys it back), within your Max unhedged amount and time.

  4. The pair closes by its rules

    Spread closed (price gap back to its usual level), Funding flipped (for 2 settlements in a row), Max hold, Liquidation guard or Max loss. Both legs close together.

Limit orders tend to fill just after the price moved against them. The bot measures this on its own fills and stops using limit orders on a coin where it costs more than it saves.

Safety orders on every leg

As soon as a leg holds a position, it carries two orders on its own venue:

  • A venue stop at your Venue stop at level (80% of the way to liquidation by default). It fires even if Prow's servers are down.
  • A mirror order that closes the leg if the other leg's stop fires, placed your mirror margin past that level. So a stop on one venue closes both legs, even while Prow is down. It works off this venue's price, so in a fast move it can fire a little later than the other leg's stop, or not at all, and one leg can stay open.

The bot's own Liquidation guard closes the pair earlier, at 75% of the way by default.

Pauses and safety switches

  • Pause (yours or Prow's) stops new pairs. A pair that is still being opened is sold back. Hedged pairs stay managed and close by their own rules.
  • Prow's safety switches work the same way. Only Stop (you) and an emergency close by Prow close pairs at market.
  • If Prow's servers can't reach their database, the bot places nothing. Each leg keeps its stop and mirror order on its venue.
  • If one venue can't be reached or its key was removed, the pair shows Held: the bot keeps the other leg with its stop, so you aren't left with one side. The bot's page names the unreachable venue; if you close that leg with your wallet, close only that one, then contact support or wait: Prow closes the other leg once the venue can be reached again and shows the first one closed. Confirming the close yourself in Prow isn't available, and Stop doesn't close a held pair (it closes every other pair).

Start an arbitrage bot

  1. Open the builder

    Press Start a bot on the Bots page and pick Arbitrage: its pane lists the funding gaps between Hyperliquid and Aster now. Tap one to open the builder on that coin, or press Set up myself. Or Start arbitrage bot on a row of Market signals > Arbitrage opportunities, which fills in the coin and strategy.

  2. Pick the accounts, the investment and the leverage

    The panel shows the free balance on the venue with less, what goes to each venue, and what the pair earns now. Manual adjustment has the strategies, markets and limits.

  3. Let Prow check the settings

    Prow checks the settings each time you change them (the accounts, the markets, the limits). Continue turns on when the check is done; until then the line under it says what is missing.

  4. Press Continue and review

    Review Arbitrage bot shows the cost of a pair round trip, the break-even at today's spread, the margin used on each venue and the nearest liquidation. Turn on the risk acknowledgement and press Continue.

  5. Press Sign and start

    Start BTC Arbitrage (with your coins) lists the strategies, markets, size per side, where it enters, the steps your wallet signs, and Limits you sign, All settings and What the bot key can do. Enable bots on Hyperliquid and Enable bots on Aster: one signature per account without a Prow Bots key, plus Approve the Prow fee on Hyperliquid if it's missing.

  6. Sign the bot's limits

    One signature if the same wallet owns both accounts, one per wallet otherwise. Prow's servers refuse any order of either leg outside them.

If you enabled a key less than an hour ago, the bot starts 15 minutes later. You can cancel until then.

The limits you sign

Your wallet shows: the accounts on each venue, the markets, the strategies, max pairs, max leverage, capital, the largest leg and order, max unhedged amount and time, hedge slippage, the venue stop and mirror margin, the closest a leg may open to liquidation, max hold, max loss, the highest Prow fee and an end date (30 days). Open pairs close 2 hours before the limits or a bot key expire. To keep trading after that, start a new bot.

Manage it

The bot's page shows Total PnL, Funding earned, Gap PnL (the legs' prices moving apart), Fees, Open pairs, Unhedged now, Margin used on each venue and the Liquidation distance (estimated from the leverage). Unhedged now should read $0. It turns amber above $0 and red past your signed limit.

Tabs:

  • Pairs: open and closed pairs, each with both legs, the spread at entry, funding, PnL, age and why it closed. Tap a coin for both legs' details.
  • Opportunities now: the scanner's rows for the bot's markets and why each one isn't entered.
  • Orders: both legs' open orders with their venue. Cancelling one elsewhere pauses the bot.
  • Settings and Log.

An arbitrage bot's settings are part of its signed limits, so there is no Edit: stop it and create a new one.

Stop offers two choices. No choice keeps a single leg.

ChoiceWhat happens
Close all pairs at market (default)Both legs of each pair close together. If a venue can't be reached, that pair is kept with its stops until the venue can be reached again (or contact support)
Keep pairs with their stopsProw stops managing them. A pair still opening is first trimmed to two matching legs (or closed if nothing matches). Each leg keeps its stop and mirror order; in a fast move one leg can stay open

Stop all on the Bots page stops arbitrage bots too, with the same choice: close all pairs, or keep them with their stops.

How it was tested

Prow tested the bot's own code on past prices: 1-hour candles and settled funding of every leg, for 30, 90 or 180 days. The test counted the costs of both legs, how far the legs moved apart while a pair was held, how close a leg came to liquidation and when the liquidation guard closed a pair. Each limit-order fill was charged the measured cost of filling just before the price moves (1.5 bps until Prow has measured 200 fills). The builder runs no such test on your settings: it shows today's spreads.

Price gaps can't be tested from candles: candles from two venues aren't taken at the same moment and miss gaps that last seconds. Prow records live gaps, and its tests use them once they cover 80% of the period. Until then they cover funding only. See Past results.

Market signals > Arbitrage opportunities lists live funding spreads, spot–perp basis and price gaps across Hyperliquid, Aster and Lighter, refreshed every 10 seconds. Each row says in one line what you'd do and what it would earn after costs in dollars per $1,000 over the next N hours if today's funding holds (the yearly pace is shown only as a note), with Start arbitrage bot prefilled on rows a bot can run. Rows that cost more than they earn and Lighter rows (view only) are hidden by default; Show all brings them back. Details has the cost split, both venues' funding, the gap, how long such spreads usually last and the largest size the order books allow.

Common questions

Is this free money? No. The bot earns the funding difference only while it lasts, pays fees on four trades per pair, and can lose when one leg closes without the other. In our tests it earned less than cash.

Why do the venues' prices differ even without a gap? Hyperliquid prices in USDC and Aster in USDT, and the two dollars trade slightly apart. The bot measures each coin's usual difference and only counts what is above it. Your profit and margin are in USDC on Hyperliquid and USDT on Aster.

Can the bot move my money between Hyperliquid and Aster? No. Each Prow Bots key trades on its own venue only. If one venue runs short of margin, deposit there.

Spot–perp on BTC, ETH or SOL? On Hyperliquid spot these are bridged tokens (UBTC, UETH, USOL, through Unit). If the bridge failed they could lose their peg. HYPE is native.

What does it cost? The venues' fees on both legs, plus Prow's fee: 0% until Dec 31, 2026, then 0.025% per trade. See Fees.

Last updated