PyArb2 is a work-in-progress arbitrage trading bot designed to exploit price differences between Uniswap V3 and SushiSwap on the Polygon network. The bot continuously scans for arbitrage opportunities and will eventually execute trades to profit from price discrepancies.
- Automated Arbitrage Scanning: The bot scans for arbitrage opportunities at regular intervals.
- Trade Execution: (To be implemented) Executes trades on Uniswap V3 and SushiSwap to capitalize on arbitrage opportunities.
- Flashloan Support: (To be implemented) Utilizes flashloans to maximize trading capital without upfront liquidity.
- Configurable Parameters: Easily adjust trade amounts, slippage tolerance, and other parameters.
- Node.js and npm
- Solidity compiler
- A Polygon RPC URL and a private key with sufficient funds for gas fees
-
Clone the repository:
git clone https://github.com/yourusername/PyArb2.git cd PyArb2 -
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add your environment variables:RPC_URL=your_polygon_rpc_url PRIVATE_KEY=your_private_key
-
Start the bot:
node index.js
-
The bot will scan for arbitrage opportunities every 3 seconds and log the results to the console.
-
Compile the Solidity contracts:
npx hardhat compile
-
Deploy the
FlashloanV3contract:npx hardhat run scripts/deploy.js --network polygon
-
Update the
index.jsfile with the deployed contract address if necessary.
The integration with the FlashloanV3 smart contract is currently under development. Future updates will include:
- Executing trades using flashloans.
- Handling the entire arbitrage process on-chain.
- Trade Amount: Adjust the
amountToTradeInWBTCvariable inindex.jsto change the trade amount. - Slippage Tolerance: Modify the
slippageTolerancevariable inindex.jsto set the slippage tolerance.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.