This project implements a cross-chain arbitrage bot designed to identify and execute profitable trading opportunities across different pools on Solana and Sui Network
The Cross-Chain Arbitrage bot monitors price discrepancies of assets (SOL/USDC) across the Solana and Sui networks. When a profitable arbitrage opportunity is identified, the bot automatically executes trades to capitalize on the price difference.
- Orca
- RaydiumV4
- Cetus
USDC prices are monitored in the SOL/USDC pool (other pairs can be configured). When there is a significant price difference across networks, the bot captures arbitrage opportunities as follows:
-
Price Monitoring: Prices are tracked on both networks.
-
Swap and Bridge: Upon detecting an opportunity, the bot can:
- Swap USDC for SOL on the source chain.
- Bridge SOL to the destination chain.
- Convert SOL back to USDC to generate more profit than initially deployed.
-
Cost Consideration: The bot factors in bridging costs, network gas fees, and other expenses before executing trades.
-
Recursive Execution: If a profit is still available after the first trade, the bot continues to bridge and trade as it monitors all the pools in realtime.
- Wormhole Bridge: Used for bridging assets between Solana and Sui.
- Node.js (v14 or higher)
- npm
- Access to Solana and Sui rpc nodes
-
Clone the repository:
git clone https://github.com/degenSumi/cross-chain-arbitrage.git cd cross-chain-arbitrage
-
Install dependencies:
npm install
Or, if you're using yarn:
yarn install
-
Configure environment variables:
- Copy the
.env.example
file to.env
. - Fill in your specific configuration details (API keys, network settings, etc.).
- Add threshold and swapamount in
config.json
- Copy the
To start the arbitrage bot, run:
npm start
Or with yarn:
yarn start
Contributions are welcome! Please feel free to submit a Pull Request.
This software is for educational purposes only. Use at your own risk. The authors are not responsible for any financial losses incurred through the use of this software.