What Is a Keeper Bot on Hyperliquid?
A keeper bot is an automated program that monitors Hyperliquid's order book for positions that have fallen below their maintenance margin. When a position becomes eligible for liquidation, the keeper submits a liquidation transaction. In return, the keeper receives a portion of the liquidation penalty — the fee the liquidated trader pays for having their position forcibly closed.
This is not arbitrage or market making. It is a protocol-level service. Hyperliquid incentivizes keepers to ensure that underwater positions are closed promptly, maintaining the solvency of the entire system. As a keeper, you are paid for performing this essential maintenance function.
How Keeper Rewards Work
When a trader's position is liquidated on Hyperliquid, a penalty is applied — typically a percentage of the position's notional value. This penalty is split: a portion goes to the insurance fund, and a portion goes to the keeper who executed the liquidation. The exact split is defined in Hyperliquid's liquidation parameters, which are publicly verifiable on-chain.
Keeper rewards are paid in the asset being liquidated (e.g., USDC for USDC-margined positions). There is no vesting or lockup — rewards are credited to your wallet immediately upon successful liquidation execution.
What You Need to Run a Keeper Bot
Running a keeper is technically more demanding than running a simple trading bot. Here is the minimum setup:
- A server or VPS: Keepers must run 24/7. Any downtime means missed liquidation opportunities. A basic VPS with 2 vCPUs and 4GB RAM is sufficient to start. Low latency is critical — choose a VPS provider with nodes geographically close to Hyperliquid's validators.
- Hyperliquid API key: You need an API wallet with trading permissions. This is a separate wallet from your main trading wallet — it holds only the margin needed to execute liquidations.
- Sufficient margin: Keepers must have enough USDC in their keeper wallet to cover the position they are liquidating. The exact capital requirement depends on the liquidation strategy you choose (full vs. partial liquidations).
- The keeper software: You can use Hyperliquid's open-source reference keeper implementation available on GitHub, or build a custom one using the Hyperliquid Python or TypeScript SDK.
Setting Up Your Keeper Bot — Step by Step
Step 1: Create a dedicated keeper wallet. Never use your main trading wallet for keeper operations. Generate a new Ethereum private key specifically for your keeper. Fund it with USDC on Hyperliquid L1 — start with 1,000 USDC to test, then scale up as you verify profitability.
Step 2: Generate an API key. On Hyperliquid, go to the API section and create a new key for your keeper wallet. Grant it trading permissions only — no withdrawal permissions. Store the private key and API credentials securely.
Step 3: Deploy the keeper software. Clone Hyperliquid's keeper reference implementation and configure it with your API credentials. The software connects to Hyperliquid's WebSocket feed to receive real-time position data and margin status. It evaluates which positions are liquidatable and submits liquidation transactions when profitable.
Step 4: Monitor and tune. Start with conservative settings, especially for gas limits and minimum profit thresholds. A liquidation that costs more in gas than it earns in penalties is a net loss. Monitor your keeper's performance for at least 48 hours before scaling up capital.
Profitability and Competition
Keeper profitability depends on three factors: the volume of liquidations, the penalty percentage, and the level of competition from other keepers. During high-volatility periods, liquidations spike and keeper earnings can be significant. During quiet markets, there may be hours with zero liquidations.
Competition among keepers on Hyperliquid has increased as the platform has grown. The first keeper to submit a valid liquidation transaction wins the reward. This means speed matters — your VPS latency, your software's processing speed, and your transaction submission pipeline all affect how often you win liquidation races.
Sophisticated keepers optimize their setup with techniques like transaction pre-signing, direct validator connections, and priority gas pricing. These are advanced optimizations you can adopt as you gain experience.
Risks to Understand
Running a keeper is not risk-free. The primary risk is smart contract risk — if Hyperliquid's liquidation logic has a bug, keepers could theoretically lose funds. Hyperliquid's contracts are audited, but no smart contract is risk-free.
There is also operational risk: if your keeper software has a bug, it could submit invalid transactions that waste gas or, worse, execute unintended trades. Always test on Hyperliquid's testnet first, and monitor your keeper's activity closely during the first week of live operation.
Start Trading on Hyperliquid
Whether you are running a keeper or trading perpetuals, use code HOLYGRAIL for zero gas fees and access to Hyperliquid's deep liquidity.
Join Hyperliquid →