A professional-grade arbitrage bot for decentralized exchanges (Uniswap V3 and Camelot) on Arbitrum. Built for precision execution, slippage-aware profitability modeling, and atomic smart contract-based routing.
This version of Okbitok is designed for two-hop arbitrage between Uniswap and Camelot. It uses normalized on-chain prices, gas-aware profit simulation, and an AtomicTerminator smart contract to ensure atomic execution. The bot is modular, configurable, and optimized for running on live networks.
- Arbitrage execution across Uniswap V3 and Camelot
- Real-time price tracking using WebSocket + Multicall
- Accurate sqrtPriceX96 decoding with decimal normalization
- Simulation of profit net of gas cost
- Smart contract-based execution with revert protection
- Pre-trade TVL filtering and token whitelisting
- Optional latency logging for optimization
The AtomicTerminator contract executes two swaps in sequence:
tokenIn→tokenOut(via routerA)tokenOut→tokenIn(via routerB)
Profit is validated on-chain by checking balance differences. Execution is permissioned and safe against reverts. Contract source is available in contracts/AtomicTerminator.sol.
main.py— Entry point: coordinates block subscriptions and arbitrage looparb_executor.py— Prepares and sends transactions to the contractprice_fetcher.py— Multicall interface and pool data loadingprofit_calculator.py— Handles slippage-aware profit modeling and TVL checkspool_filter.py— Optional revert filter and latency CSV logger
- Python 3.10+
- Packages:
web3,pandas,eth_abi,python-dotenv
-
Deploy the
AtomicTerminatorcontract to Arbitrum -
Create a
.envfile (see.env.example) -
Place a valid
matching_pools.csvwith token pairs and pool metadata -
Install dependencies:
pip install -r requirements.txt
-
Run the bot:
python main.py
- Only whitelisted tokens are used for execution
- No trade is executed unless simulated net profit > 0
- TVL threshold is enforced on both token sides and both pools
- Transactions are routed via the deployed smart contract
- Latency and arbitrage results are logged in CSV
MIT License — free to use with attribution.
Alex Bel — https://github.com/Alex-bitok