Eth-Arbitrage 2.0 is an automated system designed to exploit price discrepancies between the ETH/LUSD pair on Uniswap and Liquity. By executing strategic trades between these platforms, the system ensures that profits are maximized while minimizing the risks and impact of large trades.
The system operates in two simple steps:
- Swap ETH for LUSD on Uniswap.
- Redeem LUSD for ETH on Liquity.
These steps are executed automatically when an arbitrage opportunity arises, which happens when there's a price difference between the two platforms.
- Node Server: Tracks ETH prices on Chainlink and Uniswap. When a potential arbitrage opportunity is identified, it triggers the smart contract.
- Smart Contract: Executes the arbitrage strategy between Uniswap and Liquity.
To ensure minimal market impact, the system takes into account:
- ETH in the wallet.
- The amount of LUSD that can be redeemed on Liquity.
- The reserve pool of the ETH/LUSD pair on Uniswap.
The bot calculates the amount of ETH to use in the arbitrage using the formula:
min( <ETH in Wallet>, <12.5% of Uniswap Pool> )
This keeps trades small and ensures better prices.
The bot checks for profitability using the formula:
profit = ETH_USED * (uniswapPrice/chainLinkPrice) * (1-redemptionFee) * (1-uniswap_fee) - GasCost
If the profit is positive, the system triggers the trade.
To ensure the system runs continuously, it uses a poller mechanism that subscribes to Ethereum's new block headers. This guarantees that prices are constantly monitored and the bot is always ready to act.
Once started, the server will begin polling prices automatically. Make sure to have enough LUSD in your wallet to execute the arbitrage.
Check out the contract on the Goerli Testnet:
- Email: [email protected]
- Telegram: @snipmaxi