Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

My Arbitrage Journey

Описание и применение

Автор создал автоматизированный бот для арбитража на Arbitrum, но изначальные тесты оказались обманчивыми из‑за загрязнения состояния. После изоляции тестов и добавления симуляций все сделки оказались убыточными, подтверждая, что рынок слишком эффективен и конкуренция со стороны HFT‑ботов делает арбитраж почти невозможным.

Задача

Build a production‑grade flashloan arbitrage bot on Arbitrum and discover why it ultimately fails.

Результат

The bot initially appeared profitable due to flawed testing, but realistic isolation and fee analysis showed all trades were unprofitable, confirming that DEX‑to‑DEX arbitrage on Arbitrum is dominated by HFT bots and fee structures.

Рабочий процесс

  • 1. Set up Node.js + Ethers v6 to monitor real‑time prices via WebSockets. 2. Use Balancer V2 for 0% fee flashloans. 3. Write and test Solidity ArbitrageExecutor contract with Foundry. 4. Deploy contract and link to Node.js bot. 5. Run Foundry tests on a forked mainnet; observe initial profit. 6. Identify state contamination by running isolated tests. 7. Build a Node.js scanner to monitor price differences across Uniswap V3, Camelot V3, and PancakeSwap. 8. Add staticCall simulation and minPnl guard to prevent costly failed transactions. 9. Pause bot and analyze lessons learned.

Доказательства

I built a Solidity contract that could hold the logic: request a flashloan, swap on DEX 1, swap back on DEX 2, repay the loan, and sweep the profit.

Источник

SUCCESS! pnl (wei): 21742847117914354 (A profit of ~$52)

Источник

The $52 profit was actually false.

Источник

Once I accepted that my test was flawed, I built a Node.js scanner to check the real‑time price differences across Uniswap V3, Camelot V3, and PancakeSwap for multiple mid‑cap Arbitrum tokens.

Источник

If I hadn't added that, every time the bot detected a gap, it would send the transaction to the Arbitrum network, fail on‑chain, and burn gas. At $0.10 per failed transaction, it might look small, but it's still data.

Источник

  • Дата записи: 2026-10-21T20:26:05.706Z