大数跨境
0
0

如何通过在 HyperEVM 上运行套利机器人赚取 500 万美元

如何通过在 HyperEVM 上运行套利机器人赚取 500 万美元 Lemon (跨境电商)
2025-10-22
13
导读:作者@Cbb0fe 2025/10/20 时间是 2025 年 3 月。加密货币看起来完蛋了。

作者@Cbb0fe 2025/10/20

 时间是 2025 年 3 月。加密货币看起来完蛋了。关税打击严重,我们在思考下一个最佳机会在哪里。

$HYPE 还有 40% 尚未分配给社区,我们认为这可能是一个潜在的机会。2 月时,我们已经在 UNIT 资产上测试过一些做市策略,但都不太认真,只是小规模操作。

HyperEVM 刚刚上线了一些去中心化交易所(DEX)。我弟弟说:“要不我们试试在 HyperEVM 和 Hyperliquid 之间做套利?哪怕亏钱也能顺便刷 HL 第三季空投积分?”

我们决定试一试。确实有套利机会,但我们还不确定自己能不能真正竞争得过别人。

为什么 HyperEVM 上会有套利机会?

HyperEVM 的区块时间是 2 秒。意味着 $HYPE 的价格每 2 秒才更新一次。而在这 2 秒里,$HYPE 的价格就可能发生波动。          
因此,HyperEVM 上的 $HYPE 经常会“低估”或“高估”相较于 Hyperliquid 的价格。

初步尝试与结果

我们先搭建了一个非常基础的套利机器人。          
只要检测到 HyperEVM 上的 AMM 池与 Hyperliquid 现货市场之间存在价格差,我们就会在 HyperEVM 发起交易,同时在 Hyperliquid 对冲。

例如:          
如果 HYPE 在 Hyperliquid 上的价格上升,那么在 HyperEVM 上它就被低估。          
操作如下:

·在 HyperEVM 用 USDT0 买入“便宜”的 HYPE

·再卖出 HYPE 换取 USDC

·最后在 Hyperliquid 上把 USDC 换回 USDT0

最初几天,我们在 Hyperliquid 上的日交易量达到 20–30 万美元,而且没亏钱,甚至小赚几百美金。

起初,我们设定的套利触发门槛是 扣除手续费后利润 > 0.15%(包括 AMM DEX 手续费和 Hyperliquid 手续费)。

两周后,利润开始上升,我们发现另外两个竞争者也在做和我们一样的套利,但规模不大。于是我们决定“煮熟他们”。

4 月,Hyperliquid 推出了 $HYPE 质押机制,可以获得交易手续费返还。          
这对我们非常有利,因为我们的体量更大。我们质押了 100,000 HYPE,拿到 30% 手续费返还,于是把利润门槛从 0.15% 降到了 0.05%。

我们想最大化地压制竞争者,让他们放弃,从而独占市场。          
同时,我们的目标是两周内达成 超过 5 亿美元交易量,以提升 Hyperliquid 的手续费等级。

交易量上涨,利润也上涨。我们最终突破了 5 亿美元交易量,竞争者彻底崩溃。          
我还记得那天,我和弟弟在从巴黎飞往迪拜的路上,疯狂地盯着机器人“印钞”——24 小时盈利 12 万美元。

尽管手续费较高,竞争对手依然没有完全放弃,逼得我们必须在 仅 0.04% 的利润空间 下操作,也就是我们手续费返还后的差额。

但交易量依然强劲,每日利润稳定在 2–5 万美元 区间。

扩展瓶颈

随着规模扩大,我们开始遇到系统极限。          
HyperEVM 每个区块的 gas 上限是 2,000,000。          
每次套利大约消耗 130,000 gas,意味着每个区块最多只能执行 7–8 笔套利。          
随着更多交易池和 DEX 上线,我们的部分交易开始卡住,队列延迟导致账面不平衡。

于是我们做出以下改进:

·使用 100+ 钱包 并行发送套利交易,防止单钱包堵塞

·限制每个区块最多 8 笔套利

·gas 动态调整:当 gas 飙升时,提高最低 ROI 要求,避免交易被卡在高 gwei 状态

·速率限制:如果过去 12 秒内发送的交易超过一定数量,就自动提高利润门槛后再发新交易

改进时代

随着我们不断“印钞”,并且交易量达到竞争者的 5–10 倍,我们开始陷入“优化狂热”。          
这不是我们第一次这样干——今天你可能一边喝啤酒一边数钱,明天某个更强的玩家就可能出现,把你打回“地精镇”(Goblintown)。

→ 转向 Hyperliquid 做市(maker)模式

到 6 月,我弟弟提出一个想法:          
“我们何不在 Hyperliquid 上当挂单方(maker) 来开启套利,而不是像以前一样当吃单方(taker)?”

两大好处:

1.可以捕捉 K 线的“影线”波动 → 获得更多套利机会

2.每笔交易节省 0.0245% 手续费 → 提高净利润

但这是一项风险极高的更新。          
因为作为挂单方(maker),你先在 Hyperliquid 上挂单,但不确定能否在 HyperEVM 上及时完成对冲。          
如果对手方比你快,你可能只在一边成交,造成账面不平衡(unbalanced book),甚至亏损。

刚开始测试时,我们每次测试都出现 ±10,000 HYPE 的不平衡。          
而且因为我们有时在 20 秒内发出上百笔交易,却没有合适的分析工具,完全一团乱。

为了让挂单套利顺利执行,我们引入了新的逻辑与参数:

·利润区间:何时挂单、何时保留、何时取消与替换

·可接受的 AMM 池:例如

oHYPE/USDT0(0.05% 手续费,HyperSwap)

oHYPE/UBTC(0.3% 手续费,PRJX)

·每个池的下单数量与规模

最后,他们又定义了 吃单模式(taker trades) 的参数配置。 

经过几天的精细调校,我们终于成功避免了大多数的头寸不平衡(unbalancing)。          
即使出现不平衡,我们也会**立即通过 TWAP(时间加权平均价格)**进行平衡,以控制风险。          
这彻底改变了游戏规则。竞争对手仍然只是吃单方(taker),而我们在疯狂碾压他们,交易量是他们的 20 倍。

→ 跳过 HL 上的 USDT/USDC 交易

接下来我们遇到的新挑战是 USDT0 的特殊情况。

USDC 是 Hyperliquid 上的第一大稳定币,          
USDT0 是 HyperEVM 上的第一大稳定币。

而 HyperEVM 上成交量最高、套利机会最多的池子是 HYPE–USDT0 池。

但因为我们需要在 HyperEVM 上持有 USDT0、在 Hyperliquid 上持有 USDC,          
所以仍然必须在 Hyperliquid 上执行两笔交易来平衡两边的资产。

举例(当 HYPE 上涨时):

·在 Hyperliquid 挂单成交 → 卖出 HYPE 换 USDC(0% 手续费)

·在 HyperEVM 用 USDT0 买入 HYPE

·在 Hyperliquid 上卖出 USDC 换 USDT0(吃单方,0.0245% 手续费)

第三步很糟糕:

·我们需要支付吃单手续费 → 净利润减少,竞争力下降

·HL 上的 USDT0/USDC 市场还不成熟 → 点差大、定价不准

于是我们决定尽可能跳过这一步交易。          
为此,我们设计了新的参数与逻辑:

·USDC 阈值:仅当 USDC 余额 > 120 万时,才跳过 USDT0→USDC 转换

·USDT0 阈值:仅当 USDT0 余额 > 30 万时,才跳过 USDC→USDT0 转换

·真实价格源:每分钟调用 Cowswap API 获取真实的 USDT0/USDC 汇率,而不是信任 HL 的订单簿

→ 在套利中引入永续合约(perps)

先声明一下:          
在整个加密之旅中,我们从未使用过杠杆或永续合约(perps),          
(除了 2018 年在 BitMEX 上的黑历史,那次不太成功,笑)          
所以我们对其运作方式了解并不多。

但我们注意到某个时刻,          
HYPE 永续合约的交易量远高于现货,且手续费更低          
(现货 0.0245%,永续仅 0.019%)。

我们觉得该尝试一下这个策略。          
而且竞争者没有在用永续,所以我们在这方面不会与他们争夺相同的订单簿流动性。

我们还发现:          
在使用永续合约测试时,我们不仅能做套利,          
还能顺带赚取资金费率(funding),          
并在永续价格相对现货**溢价(premium)或折价(discount)**时获得更多套利机会。          
而这些,是竞争对手完全没有利用到的。

于是我们设计了一套新系统,包含如下参数:

·Bound(限制):做空或做多 HYPE 的最大仓位规模 → 防止爆仓或耗尽 USDC/HYPE 余额

·Premium / Discount:当前永续合约相对现货的溢价或折价比例

·Max premium / Max discount:若溢价过高,则停止创建多单,转向做现货

·Progressive ROI(渐进式收益率):仓位越大,要求的利润率越高,以防太快陷入单边风险

·ROI 计算公式:基于永续溢价/折价 + 仓位大小综合确定

以下是他们配置 HYPE 做空(taker 模式) 的界面示意

添加永续合约(perps)大概是最重要的升级之一,仅资金费 alone 就产生了约 60 万美元的收益,并且带来了更多通过溢价/折价进行套利的机会。          
以下是关于我和我兄弟在改进这个套利机器人时的合作关系与默契。

很多人常常问我们:你们到底是怎么分工、怎么合作的?          
大家通常认为我是那个整天在 CT(Crypto Twitter)上乱喷、发牢骚的“嘴炮选手”(这点我也不否认),而我兄弟则是那个闷头写代码的技术宅。

但事情其实比这复杂得多。我们的动态更像 Blur 农场时代的搭档模式。像这种套利机器人,你永远不知道下一秒会遇到什么问题。我们每天都在面对新的挑战,不断修 bug、改策略。我们几乎每天都在讨论如何优化,不会做任何改动,除非两个人都同意。他负责写代码,也会为我做出一些工具,让我能管理参数。

我完全不会写机器人程序,这点我承认。          
但他完全不知道怎么配置机器人,这点他也承认。

有趣的是,我们在做机器人的时候性格完全相反。          
他喜欢频繁更新、疯狂尝试(在我看来太激进了);          
我则非常保守(在他看来太固执),只要机器人还能稳定赚钱,我就绝不动它。

典型对话是这样的:          
我(很毒舌):“机器人运行感觉怪怪的……你是不是改了什么?”          
他:“没有……好吧,也许改了一点小东西。”

当两个人在没有标准化流程的情况下连续推出 250 次更新后,你会突然发现——          
你们创造了一个自己都不完全理解或控制的怪物。

每次推新版本,都很难预料所有连锁反应。

总结:          
过去 8 个月,我们几乎全身心都投入在这个套利机器人上。特别是今年 6 月 Wintermute 那帮人带着一堆流动性和打工仔军团进场之后,我们压力更大了。

我记得 7 月那 5 天,我和我兄弟从伊斯坦布尔到博德鲁姆(本来是去度假的),结果全程都在封闭式调试和优化机器人。

我们成功保持了 8 个月的榜首位置,直到 10 月市场份额逐渐下滑,才决定退一步。

最终成绩:          
盈利:500 万美元          
   交易量:125 亿美元(在 Hyperliquid 上)          
Gas 费用:120 万美元(占 HyperEVM 总量的 20%)          
打磨时长:2000+ 小时          
占 Unit 总交易量的 5%

祈祷 Hyperliquid 有第三季,也希望 Unit 迎来第一季。

感谢阅读,期待下次新的链上冒险。

 

Crypto速通车社区整理翻译,附原文:

 

How We Made $5M Running the #1 Arbitrage Bot on HyperEVM

 

It’s March 2025. Crypto looks doomed. Tariffs are hitting hard. We wonder what the next best opportunities are. With 40% of 

$HYPE

still to be allocated to the community, we see it as a potential play. In February we had already tested some market-making strategies on UNIT assets but nothing serious. Just small moves. HyperEVM just launched with some DEXs and my brother goes: “What if we try arbitraging between HyperEVM and Hyperliquid to farm a possible HL Season 3 even if it costs us money?” We give it a try. Arb opportunities are there, but we don’t know if we can actually compete. Why are there arbitrage opportunities on HyperEVM? Blocks last for 2 seconds on HyperEVM. It means the price of 

$HYPE

updates only every 2 seconds there. In 2 seconds, 

$HYPE

can move. So 

$HYPE

on HyperEVM often becomes "underpriced" or "overpriced" compared to Hyperliquid. First steps and results We build a first version, quite basic. Whenever there is a price difference between a HyperEVM AMM DEX pool and Hyperliquid spot, we send a tx on HyperEVM and hedge on Hyperliquid. Example:

·If HYPE is moving up on Hyperliquid, it’s underpriced on HyperEVM.

·Trade: buy “cheap” HYPE on HyperEVM with USDT0 → sell HYPE for USDC → swap USDC back to USDT0 on Hyperliquid.

First few days, we make around $200k-300k daily volume on Hyperliquid and we don’t lose money. Even better, a few hundred dollars. At the beginning, we execute arb trades when profit is above 0.15% after fees (Fees on the AMM DEX and on Hyperliquid)

2 weeks later, we start to see some potential as profit is going up. We identify 2 other competitors who are doing exactly like we do. They don’t seem really big though. We want to cook them.

In April, Hyperliquid introduces 

$HYPE

staking for trading fee rebates. Perfect update: we have more size than competitors. We stake 100k HYPE to get a 30% rebate on trading fees and lower our profit threshold from 0.15% to 0.05%. We want to put maximum pressure on them so they give up and let us eat the cake alone. Our goal is also to achieve >$500m in 2 weeks to improve our trading fee tier on HL. Volume goes up, profit goes up and we reach >500m volume that puts competition in shambles. I remember this day when both competitors turned off their bots, my brother and I are travelling from Paris to Dubai and just frenetically watching the bot printing money. $120k profit in 24 hours. Despite higher trading fees, competitors don't give up and are forcing us to go for tight margin, around 0.04% margin, basically the gap between their fees and ours. Volume is still going strong and daily profit is sitting in the 20k-50k USD range. Scaling issues As we scale, we start hitting limits. Gas per block on HyperEVM is capped at 2M. One arb eats ~130k gas, so we can only fit 7–8 arbs per block. That’s not much, especially as more pools and more DEXs launch on HyperEVM. Some of our txs get stuck, and we need to fix this quickly to avoid queued txs and unbalanced book. We respond by introducing a few things:

·100+ wallets, each sending arb transactions so no single wallet queues up

·Max 8 arbs per block

·Gas control: when HyperEVM gas spikes, we raise required ROI so we don’t send txs that will just get stuck in high gwei.

·Rate limiting: if we send more than x txs in the past 12 seconds, we increase profit requirements before sending new ones. 


Improvements era

As we keep printing money and doing 5–10x more volume than the competition, we get OBSESSED with improvements. This isn’t our first rodeo. One day you’re printing while drinking beers, the next day some entity shows up and sends you straight to goblintown. → Becoming makers on Hyperliquid In June, my brother wants to test an idea he’s been sitting on for weeks: start the arbitrage trade as a maker on Hyperliquid instead of a taker.

Two big benefits:

·Catch wick candles on HYPE → more arb opportunities

·Save 0.0245% fee per trade → more profit 

This is a challenging update because we take one trade on Hyperliquid and we are not sure we will be able to take the opposite trade on HyperEVM (someone might be faster than us). Before that, we were starting our arb trades by sending one transaction on HyperEVM. The tx failed? We do nothing on HL. The tx succeeds? We execute trade on HL. But as a maker, you take a risk as you agree to be filled on Hyperliquid without being sure to be filled on HyperEVM where the price opportunity is. This generates unbalancing risks in our book and then potential losses. At first, every test ends up with +-10k HYPE unbalancing. We actually have a hard time to understand why these unbalancing setups are happening as we sometimes send 100 txs in 20 seconds and we don’t have any data analysis tool. Absolute mess. In order to execute arb with trades as makers, we need to add new concepts that we translate into new parts of code and parameters:

·Profit range: when to create an order, when to keep it, and when to cancel + replace

·AMM pools we’re willing to trade as makers (e.g. HYPE/USDT0 0.05% on HyperSwap, HYPE/UBTC 0.3% on PRJX)

·Size & order count per AMM pool 

Parameters for taker trades look like this 🤓

After days of fine-tuning, we finally avoid most of the unbalancing. And in case of unbalancing, we TWAP asap to limit risk. Total game changer. Competitors are still only takers and we’re cooking them, hitting 20x their volume.

 

→ Skipping USDT/USDC trades on HL

 

The next challenge we see is USDT0 specific case.

 

USDC is top 1 stablecoin on Hyperliquid and USDT0 is top 1 stablecoin on HyperEVM.

 

The best pools on HyperEVM by volume and arb opportunities are HYPE-USDT0 pools.

 

But as we need USDT0 on HyperEVM and USDC on Hyperliquid, we still have to execute 2 trades on Hyperliquid to rebalance between the two assets.

 

Example when HYPE pumps:

Maker order fills → sell HYPE for USDC (0% fee)

Buy HYPE with USDT0 on HyperEVM

Sell USDC for USDT0 on HL as taker (0.0245% fee)

That 3rd part sucks:

We pay taker fees (less profit, less competitive)

USDT0/USDC market on HL is not mature → spread, mispricing

 

We decide to skip this trade whenever possible. To do that, we build new parameters and logic:

USDC threshold: skip USDT0→USDC only if USDC balance >1.2M

USDT0 threshold: skip USDC→USDT0 only if USDT0 balance >300k

True price feed: request Cowswap API every minute to get real USDT0/USDC price instead of trusting HL orderbook

 

→ Introducing perps on arb trades

 

Disclaimer before anything else: we have never used leverage or perps in our entire journey in crypto (except on Bitmex back in 2018 which was not very successful lmao) and have not much idea how it works.

 

But what we notice at some point is that volume on HYPE perps is much higher than on spot and fees are slightly better (0.0245% on spot vs. 0.019% on perp).

 

We feel like we should give a try to our strat with perps. No other competitors are using perps so we won’t be competing with them with the same orderbook liquidity.

 

What we understand is that while running tests with perps, we could also farm funding and get access to more arb opportunities when HYPE perp is trading at a premium or at a discount vs. spot. That’s something competitors are not doing.

 

We design a new system with parameters:

Bound: max HYPE size to short/long → avoid liquidation or draining USDC/HYPE balances

Premium/Discount: current premium/discount on perp

Max premium/ Max discount: if premium is too high, we stop creating long orders and go for spot instead

Progressive ROI: the larger the short/long, the higher profit we require to avoid getting trapped too fast into a short/long position

ROI formulas: depend on perp premium/discount + position size

This is how it looks like to configure short on HYPE as takers             

Adding perps has probably been one of the most significant upgrades, it generated around $600k alone from funding and much more arb opportunities with premium/discount.

About our dynamics and synergies as two brothers while improving the bot Very often, people ask us what do we do and how do we work together. I’m usually seen as the shitposter of the duo just yapping bullshit on CT (part that I don’t deny) and my brother is sometimes just seen as the geek coding stuff. Things are much more nuanced than this. The dynamics that emerge are very similar to the ones during Blur farming era actually. With such bot, you never know what’s coming up. We face challenges and issues on a daily basis that we need to fix. We talk nonstop about improvements, every day. We don’t do anything until we reach agreement. He codes, but he also builds tools so I can manage parameters. I have no fucking clue about coding a bot. My bro has. He has no fucking clue about how to configure the bot. I have. Funny thing about my brother and me is that we have very different personalities when working on a bot. My brother likes to push updates and try things (too much in my opinion) while I’m very conservative ((too much in his opinion) and want to keep the same version as long as we are printing. Typical exchange:

·Me (very toxic): “Bot looks weird… did you change something???”

·Him: “No.. well, maybe something minor.”

One strange thing about building a bot as two without proper corporate processes is that after 250 updates, you feel like you have created something you don’t fully understand or control anymore. When you push new updates, it’s sometimes hard to grasp all the impacts it will have.

Conclusion

These last 8 months have been dedicated to building and improving this bot. Especially when these mfers of Wintermute joined the party in June with their shit ton of liquidity and army of wagies. I remember our 5 days in July between Istanbul and Bodrum with my brother where we were supposed to chill and were just LOCKED IN improving the bot. We managed to be top 1 for 8 months and felt like it was time for us to step back as our market share was progressively going down in October. We end with:

·$5M profit

·$12.5B volume on HL

·$1.2M gas fees paid on HyperEVM (20% of total since HyperEVM launch)

·+2000 hours of grind

·5% of Unit volume 

Praying for a HL Season 3 & Unit Season 1 🙏 Thanks for reading and see you soon on a new on-chain adventure 

 

【声明】内容源于网络
0
0
Lemon (跨境电商)
跨境分享吧 | 每日更新跨境心得
内容 52640
粉丝 0
Lemon (跨境电商) 跨境分享吧 | 每日更新跨境心得
总阅读318.0k
粉丝0
内容52.6k