Hyperliquid Trading Bot: Automate Perps
How to run a trading bot on Hyperliquid — API setup, strategy types, fee optimization, and why the venue is built for automation.
Hyperliquid is the most bot-friendly perpetual futures exchange in crypto. Maker rebates mean your bot earns fees instead of paying them. The API is fast, well-documented, and doesn't gate features behind VIP tiers. And the non-custodial architecture means your capital stays in your wallet — not on an exchange balance sheet that can freeze, rug, or go bankrupt.
If you're running automated strategies on perpetual futures, Hyperliquid's structural advantages make it the default venue. This guide covers how to set up a bot, which strategies work best on the platform, and where the pitfalls are.
Why Hyperliquid for Bot Trading
Not all exchanges treat bots equally. Most CEXs tolerate automated trading but optimize for retail. Hyperliquid optimizes for makers — which means it optimizes for bots.
Maker Rebates Change the Math
On Binance, a market-making bot pays 0.02% maker fees at the best VIP tier (or earns -0.01% rebate at the top). On Hyperliquid, every maker order earns -0.02% across all tiers — no volume requirement.
On $10M monthly maker volume:
- Binance (VIP 0, paying 0.02%): -$2,000 (cost)
- Binance (VIP 9, earning -0.01%): +$1,000 (rebate)
- Hyperliquid (any tier, earning -0.02%): +$2,000 (rebate)
The difference: $4,000/month between Binance standard and Hyperliquid. For a bot running continuously, that's $48,000/year in structural edge before any P&L.
API Quality
Hyperliquid's API is production-grade:
- WebSocket connections: ~50-100ms latency for order updates, fills, and tick data
- REST API: Standard endpoints for order placement, position queries, account info
- Rate limits: 100 requests/second (REST), WebSocket subscriptions not rate-limited the same way
- Batch orders: Submit multiple orders in a single request — critical for grid strategies and multi-leg positions
- Order types: Market, limit, post-only, reduce-only, GTC, IOC, FOK
- Libraries: Community-maintained Python and TypeScript SDKs
Compare to some CEXs where the REST API has 10 req/second limits at standard tier and you need VIP status to unlock WebSocket access. Hyperliquid doesn't gate performance behind volume commitments.
Non-Custodial Execution
Your bot trades through your wallet. Funds sit in the Hyperliquid smart contract, not on a centralized exchange. If the exchange experiences downtime, your funds are recoverable from the contract. No withdrawal freezes, no account suspensions, no arbitrary position closures.
For bot operators who manage significant capital, this custody model eliminates the counterparty risk that keeps institutional traders up at night.
Strategy Types That Work on Hyperliquid
Market Making
Market-making bots place limit orders on both sides of the book, capturing the bid-ask spread plus maker rebates. On Hyperliquid, the rebate (+0.02%) makes tight-spread market making viable even on less liquid pairs.
How it works: Your bot quotes a bid at $67,990 and an ask at $68,010 for BTC/USDC. When both fill, you earn $20 spread + 0.02% on both legs. Rinse and repeat hundreds of times daily.
Hyperliquid advantage: The -0.02% maker rebate means you earn fees on every fill. On a CEX where you pay 0.02% maker, your spread needs to exceed 0.04% just to break even. On Hyperliquid, any positive spread is profit.
Risk: Adverse selection — informed traders hit your quotes before you can cancel. Volatile markets widen effective spreads. Inventory risk accumulates if one side fills more than the other.
Grid Trading
Grid bots place a ladder of buy and sell orders across a price range. If BTC trades between $65,000 and $70,000, the bot places buys every $250 below mid and sells every $250 above.
Hyperliquid advantage: Every grid order is a maker order (limit, sitting on the book), earning the -0.02% rebate. Over hundreds of grid fills per day, the rebate income supplements the grid profit. On Binance at 0.02% maker fee, grid income is reduced by 0.04% round-trip in fees.
Risk: Trending markets. If BTC breaks above $70,000, all your sells have filled and you're holding spot below the market. If it breaks below $65,000, all your buys have filled and you're holding an increasingly underwater position.
Funding Rate Arbitrage
The spot-perp basis trade: buy spot BTC, short BTC perps, collect funding rate payments. Hyperliquid's higher-than-average funding rates (4-8% annualized on BTC, 10-30% on alts) create wider carry spreads than CEXs.
Bot automation: The bot monitors funding rates across pairs, opens basis positions when funding exceeds a threshold (e.g., >5% annualized), sizes positions based on available margin, and closes when funding compresses below the break-even threshold.
Hyperliquid advantage: Zero maker fees on the short perp leg. Higher baseline funding than Binance. On-chain transparency for real-time funding data via the API.
For the full strategy breakdown, see funding rate arbitrage.
Cross-Exchange Arbitrage
Your bot monitors the same pair across Hyperliquid and Binance. When the price diverges beyond fees + slippage, it buys on the cheaper exchange and sells on the more expensive one.
Example: ETH perp on Hyperliquid: $3,420. ETH perp on Binance: $3,425. Spread: $5 (0.15%). After fees (0.05% Hyperliquid taker + 0.10% Binance taker = 0.15%), the trade breaks even. But with Hyperliquid maker orders (-0.02%), you can capture spreads as tight as 0.08%.
Risk: Execution timing. Both legs need to fill near-simultaneously. Network latency between exchanges creates fill risk. Capital split across two venues reduces position sizing on each.
Liquidation Hunting
When large positions get liquidated on Hyperliquid, the protocol auctions the liquidated collateral. Bots that monitor liquidation events can bid on distressed positions at a discount.
How it works: The insurance fund absorbs liquidated positions. If the fund can't absorb at mark price, it auctions the position. Bots that bid aggressively on these auctions can acquire positions below market price.
Hyperliquid advantage: Liquidation events are visible on-chain in real-time. The API streams liquidation data. On CEXs, liquidation processing is opaque.
Setting Up Your First Bot
Prerequisites
- Wallet: MetaMask or any EVM-compatible wallet
- USDC on Arbitrum: Bridge from Ethereum if needed (5-15 minutes)
- Hyperliquid deposit: Transfer USDC to the Hyperliquid smart contract
- API key generation: Create an API wallet through the Hyperliquid interface. This generates a separate signing key that your bot uses — it can trade but cannot withdraw funds
Basic Architecture
A typical Hyperliquid bot stack flows top to bottom: your bot code (Python or TypeScript) talks to Hyperliquid's WebSocket for real-time market data and fills, and to the REST API for order placement and position management. Both channels submit to Hyperliquid L1, which executes orders on-chain against collateral held in the smart contract — collateral your wallet controls directly.
Most community libraries handle the connection lifecycle, authentication, and message parsing, so you can focus on strategy logic rather than transport plumbing.
Key API Endpoints
- POST /exchange — Place, cancel, modify orders
- POST /info — Query positions, account state, funding history
- WebSocket /ws — Subscribe to order book, trades, fills, funding updates
Rate limit: 100 requests/second. For most strategies, this is more than sufficient. Grid bots with 50+ levels might approach the limit during rebalancing.
For platform fundamentals and integration context, see the Hyperliquid overview.
Fee Optimization for Bots
Fee optimization is where bots gain their structural edge on Hyperliquid.
Post-only orders: Use post-only mode to guarantee maker execution. If the order would cross the book and become a taker, it's rejected instead of filling at taker rates. This ensures every fill earns the -0.02% rebate.
Volume tier progression: At Tier 2 ($2M+ monthly volume), taker fees drop to 0.03%. At Tier 3 ($10M+), takers pay 0.025% and makers earn -0.025%. Bots that generate significant volume naturally tier up, compounding the fee advantage.
Batch order optimization: Submitting multiple orders per request reduces latency and API call count. A grid bot that updates 20 price levels can do it in 1 batch call instead of 20 individual calls.
Risks and Limitations
Depth limitations. Hyperliquid's order book is 2-5x thinner than Binance on BTC. Market-making bots need to account for adverse selection risk in a thinner book — large informed orders will hit your quotes harder. Size your quotes proportional to available depth.
Smart contract risk. Your funds are in a smart contract. Audited doesn't mean bug-free. Run a fraction of total capital on Hyperliquid initially and scale up as confidence builds.
API downtime. No API has 100% uptime. Build reconnection logic, stale-order cancellation, and position health checks into your bot. If the WebSocket disconnects during a volatile move, your bot should cancel all open orders immediately on reconnection.
Slippage on alts. New Hyperliquid listings have thin order books. A bot that works on BTC may get destroyed on a small-cap alt where a $50K order moves the market 2%. Always paper-test new pairs before deploying capital.
FAQ
Do I need coding skills to run a bot on Hyperliquid?
For custom bots, yes — Python or TypeScript proficiency is required. Community libraries handle the Hyperliquid API integration, but you still need to write the strategy logic, risk management, and execution flow. For a no-code alternative, deploy strategies on Hyperliquid with the agent — the AI trading agent handles execution without custom code.
What's the minimum capital for a Hyperliquid bot?
Depends on strategy. Market making: $10,000+ for meaningful quote depth. Grid trading: $5,000+ for a reasonable range. Funding arb: $20,000+ to generate material carry income. Start small, validate the strategy, then scale.
Is bot trading allowed on Hyperliquid?
Yes. Hyperliquid actively encourages algorithmic trading through maker rebates, a robust API, and batch order support. There are no restrictions on automated trading as long as you're not manipulating the market (wash trading, spoofing).
How do I protect my bot from API key theft?
Hyperliquid's API wallet system generates a separate signing key that can trade but cannot withdraw funds. Even if the key is compromised, the attacker can't drain your account — only place trades. Combine this with IP whitelisting (if available) and key rotation practices.
Can a bot trade multiple pairs simultaneously?
Yes. The WebSocket API supports multiple subscriptions, and the REST API handles orders across pairs. Most bots monitor 3-10 pairs simultaneously, allocating margin based on relative opportunity (funding rate, spread width, volume).
Automate Without the Infrastructure
Building a bot from scratch requires development time, infrastructure maintenance, and ongoing debugging. The API is accessible, but the strategy layer — when to trade, how to size, how to manage risk across pairs — is where most home-built bots fail.
Deploy strategies on Hyperliquid with the agent: the AI trading agent connects to Hyperliquid's API, manages position sizing and risk across multiple pairs, and adapts to changing market conditions. No code, no server maintenance, no 3 AM debugging sessions.
Related: Hyperliquid overview for platform fundamentals. AI crypto trading bots for the broader bot landscape. Hyperliquid review for an honest assessment of the venue.