8 months, 5 million: Analysis of profits from the HyperEVM top arbitrage robot

CN
3 hours ago

How to Build the Ultimate Arbitrage Bot on HyperEVM?

Author: CBB

Translated by: Deep Tide TechFlow

In March 2025, the crypto market looked precarious. The impact of tariffs made the situation even more severe, and we began to think about where the best opportunities lay next.

With 40% of $HYPE in the HyperEVM ecosystem yet to be allocated to the community, we saw this as a potential opportunity. In February, we had tested some market-making strategies on UNIT assets, but it was not in-depth, just small-scale operations.

HyperEVM had just launched, accompanied by some decentralized exchanges (DEXs). My brother suggested, "What if we try arbitraging between HyperEVM and Hyperliquid? Even if it might lead to losses, it could pave the way for Hyperliquid's liquidity mining in Q3?"

We decided to give it a try. Arbitrage opportunities did exist, but we were unsure if we could truly compete successfully.

Why Are There Arbitrage Opportunities on HyperEVM?

HyperEVM has a block time of 2 seconds, meaning the price of $HYPE updates every 2 seconds. Within these 2 seconds, the price of $HYPE may fluctuate. Therefore, $HYPE on HyperEVM often appears "undervalued" or "overvalued" compared to the price on Hyperliquid.

Initial Attempts and Results

We built the first version, which was very basic. Whenever there was a price difference between the AMM DEX pool on HyperEVM and the spot market on Hyperliquid, we would send a transaction on HyperEVM while hedging on Hyperliquid.

For example:

  • If the price of $HYPE rises on Hyperliquid while being undervalued on HyperEVM:

  • Action: Buy "cheap" $HYPE with USDT0 on HyperEVM → Sell $HYPE for USDC → Exchange USDC back to USDT0 on Hyperliquid.

In the initial days, our daily trading volume on Hyperliquid was about $200,000 to $300,000, and we did not incur any losses. Even better, we made a few hundred dollars in profit.

At first, we only executed arbitrage trades with profits exceeding 0.15% (after deducting the fees from AMM DEX and Hyperliquid). Two weeks later, as profits gradually increased, we saw more potential and discovered two competitors with similar strategies, albeit on a smaller scale. We decided to "take them out."

In April 2025, Hyperliquid launched the $HYPE staking feature for trading fee rebates. This was a perfect update: we had more capital than our competitors. We staked 100,000 $HYPE, received a 30% fee discount, and lowered the profit threshold for arbitrage from 0.15% to 0.05%.

We began to apply more pressure on our competitors, trying to force them to give up so we could monopolize the market opportunity. At the same time, our goal was to achieve over $500 million in trading volume within two weeks to elevate our trading fee tier on Hyperliquid.

As both trading volume and profits grew, we successfully surpassed $500 million in trading volume, making it difficult for our competitors to keep up. I remember one day when both of our competitors shut down their bots. At that time, my brother and I were flying from Paris to Dubai, frantically watching our bot "print money." In that 24 hours, our profits reached $120,000.

Despite the high trading fees, our competitors did not give up and forced us to lower our margins, which were about 0.04%, essentially the gap between their fees and ours. Even so, trading volume remained strong, and our daily profits stabilized between $20,000 and $50,000.

Scaling Issues

As we scaled up, we began to encounter bottlenecks. The gas limit for each block on HyperEVM is 2 million, and each arbitrage trade consumes about 130,000 gas, meaning each block can accommodate a maximum of 7-8 arbitrage trades. This became tight as more pools and DEXs went live. Some trades got stuck, and we needed to resolve this quickly to avoid transaction queue buildup and ledger imbalances. To address this, we implemented the following measures:

  1. Created over 100 wallets, each independently sending arbitrage trades to avoid long transaction queues for a single wallet.

  2. Executed a maximum of 8 arbitrage trades per block.

  3. Gas management: When the gas price on HyperEVM surged, we raised the required return on investment (ROI) threshold to avoid trades getting stuck due to high gas fees.

  4. Rate limiting: If the number of trades sent in the past 12 seconds exceeded a certain value, we would raise the profit requirement before sending new trades.

Era of Improvements

As we continued to profit, with trading volumes reaching 5-10 times that of our competitors, we became obsessed with optimization. This was not our first attempt. Today, you might be "printing money" while drinking beer, but tomorrow you could be "sent to hell" by a new force.

Becoming a Maker on Hyperliquid

In June 2025, my brother proposed an idea he had been brewing for weeks: to initiate arbitrage trades on Hyperliquid as a Maker (the one placing orders) instead of a Taker (the one taking orders).

Two major benefits:

  • Focus on pinning price movements on HYPE → Create more arbitrage opportunities.

  • Save 0.0245% on fees per trade → Thus increasing profits.

This was a challenging update because we had executed a trade on Hyperliquid, but we were unsure if we could perform the opposite trade on HyperEVM (someone might be faster than us).

Previously, we initiated arbitrage by sending trades on HyperEVM. If the trade failed, we did nothing on Hyperliquid; if the trade succeeded, we executed the trade on Hyperliquid.

But as a Maker, we needed to take on risk because orders on Hyperliquid might get filled, but there was no guarantee that the corresponding trade on HyperEVM would also be completed. This situation could lead to ledger imbalances and potential losses.

At first, each test caused the value of HYPE to fluctuate by 10,000. We struggled to understand why this imbalance occurred, as we sometimes sent 100 trades within 20 seconds but lacked data analysis tools to track the reasons, making it a complete mess.

To execute arbitrage as a Maker, we introduced some new concepts and translated them into new code and parameter sections:

  1. Profit Range: Determine when to create orders, when to hold orders, and when to cancel or replace orders.

  2. AMM Pool Selection: Specify which AMM pools we are willing to trade as a Maker (e.g., the HYPE/USDT0 0.05% pool on HyperSwap, or the HYPE/UBTC 0.3% pool on PRJX).

  3. Order Size and Quantity: Set size and quantity limits for orders for each AMM pool.

The parameters for Taker trades are as follows:

After several days of fine-tuning, we finally avoided most ledger imbalance issues. Even when imbalances occurred, we would immediately use the TWAP (Time Weighted Average Price) strategy to quickly balance the risk. This change was a game changer. Meanwhile, competitors were still only using Taker strategies, while we had increased our trading volume to 20 times theirs.

Skipping USDT/USDC Trades on Hyperliquid

The next challenge was a specific issue regarding USDT0.

On Hyperliquid, USDC is the number one stablecoin, while on HyperEVM, USDT0 is the number one stablecoin.

The pool with the highest trading volume and most arbitrage opportunities on HyperEVM is the HYPE-USDT0 pool. However, since we needed USDT0 on HyperEVM and USDC on Hyperliquid, we had to execute two trades on Hyperliquid to balance these two assets.

For example, when the price of HYPE rises:

  1. Order filled → Sell HYPE for USDC (0% fee)

  2. Buy HYPE with USDT0 on HyperEVM

  3. As a Taker on Hyperliquid, exchange USDC back to USDT0 (0.0245% fee)

But this third step is very problematic:

  • We need to pay the Taker fee (leading to reduced profits and decreased competitiveness)

  • The USDT0/USDC market on Hyperliquid is still immature, with large spreads and inaccurate pricing

We decided to skip this step whenever possible. To do this, we developed new parameters and logic:

  1. USDC Threshold: Only skip the USDT0→USDC trade if the USDC balance exceeds 1.2 million.

  2. USDT0 Threshold: Only skip the USDC→USDT0 trade if the USDT0 balance exceeds 300,000.

  3. Real Price Information: Request real-time USDT0/USDC prices from the Cowswap API every minute instead of relying on Hyperliquid's order book.

Introducing Perpetual Contracts for Arbitrage Trading

Before we begin, it should be stated: throughout our entire cryptocurrency trading career, we have almost never used leverage or perpetual contracts (except for a failed attempt on Bitmex in 2018, which is laughable). Therefore, we are not familiar with how they work.

However, we noticed that at a certain point, the trading volume of HYPE perpetual contracts was far higher than that of the spot market, and the fees were slightly lower (spot 0.0245%, perpetual contracts 0.019%).

So, we decided to try incorporating perpetual contracts into our strategy. No other competitors were using perpetual contracts, which meant we wouldn't be competing with them on the same order book liquidity.

During our testing of perpetual contracts, we discovered that we could make money through the funding rate and gain more arbitrage opportunities when the HYPE perpetual contract was at a premium or discount compared to the spot market. This was an area that competitors had not yet ventured into.

We designed a brand new system parameter for this:

  • Boundary Value: Maximum HYPE long/short position size → To avoid liquidation or depleting USDC/HYPE balance.

  • Premium/Discount: The current premium or discount of the perpetual contract.

  • Maximum Premium/Discount: If the premium is too high, we stop creating long orders and switch to spot trading.

  • Progressive ROI: As long/short positions increase, we raise profit requirements to avoid quickly falling into unfavorable long/short positions.

  • ROI Formula: Dynamically adjusted based on the premium/discount of the perpetual contract and position size.

This is the parameter interface for configuring HYPE short positions, which looks quite complex:

Introducing perpetual contracts may be one of our most significant upgrades, earning about $600,000 just from the funding rate, while also profiting more from premium/discount arbitrage opportunities.

On the Collaboration and Dynamics Between the Two Brothers

Many people ask how we divide our work. I am often seen as the "loudmouth" in the team, randomly speaking on Crypto Twitter (which I do not deny); while my brother is considered the "tech geek" who buries himself in coding.

But it's much more complex than that. Our dynamics are very similar to the collaborative model incentivized by the Blur token. For such an arbitrage bot, you never know what will happen next. We face challenges and problems every day that must be resolved quickly. We discuss improvements daily and only act once we reach a consensus. He is responsible for writing code while also developing tools for me to manage parameters.

I can't code at all, but I know how to configure the bot; he, on the other hand, doesn't understand how to configure the bot but can write code.

Interestingly, we have completely different personalities at work. My brother likes to frequently update and try new features (too frequently, in my opinion), while I tend to be more conservative (too conservative, in his view), preferring to stick with the existing version as long as it can still "print money."

A typical conversation:

  • Me (very sarcastic): "The bot is acting weird… Did you change anything???"

  • Him: "No… uh, maybe I changed a little something."

When two people collaborate on developing a bot without formal business processes, after 250 updates, you feel like you've created something that you can no longer fully understand or control.

Every time a new update is pushed, it's hard to fully anticipate all the impacts it will bring.

Conclusion

Over the past 8 months, we have been fully committed to the development and optimization of this arbitrage bot. Especially in June, when Wintermute entered the fray with a large amount of liquidity and a "worker army," we felt immense pressure.

I remember the 5 days we spent between Istanbul and Bodrum in July, originally planned for relaxation, but in reality, we were locked in a room continuously improving the bot.

We successfully maintained our market leadership for 8 months, but as our market share gradually declined in October, we felt it was time to exit.

Final results:

  • $5 million in profit

  • $12.5 billion in Hyperliquid trading volume

  • Paid $1.2 million in gas fees on HyperEVM (accounting for 20% of the total since HyperEVM launched)

  • Over 2000 hours of effort

  • 5% of the total trading volume on Unit

We look forward to the arrival of Hyperliquid Q3 and Unit Q1.

Thank you for reading! We look forward to seeing everyone again in new chain adventures.

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。

Share To
APP

X

Telegram

Facebook

Reddit

CopyLink