An open-source arbitrage bot built with Go, designed to identify and execute profitable trades on the Solana blockchain using the Jupiter API. The bot continuously monitors token prices, calculates arbitrage opportunities, and executes swaps when profitable conditions are met.
- Continuous Arbitrage Monitoring: Tracks token price discrepancies between pairs to identify arbitrage opportunities.
- Automatic Swap Execution: Executes profitable swaps autonomously via Jupiter's API.
- Customizable Parameters: Easy to configure inputs like RPC endpoints, private keys, and token pairs.
- Go 1.23+
- A Solana wallet with private key access.
- RPC endpoint and WebSocket endpoint for Solana blockchain.
- Jupiter API access.
-
Clone the repository:
git clone https://github.com/fape-labs/arbitrage-bot.git cd arbitrage-bot
-
Install dependencies:
go mod tidy
-
Configure environment variables:
- Replace
your-rpc-endpoint
,your-rpc-wss-endpoint
, andyour private key
in the code with your actual values.
- Replace
-
Build the project:
go build
go run main.go
- The bot:
- Fetches quotes from the Jupiter API for token pairs (e.g., SOL -> USDC -> SOL).
- Calculates the profitability of potential trades.
- Executes swaps if a profitable opportunity is found.
- RPC Endpoint: The Solana RPC endpoint to connect to.
- WebSocket Endpoint: The Solana WebSocket endpoint for real-time updates.
- Private Key: Your Solana wallet's private key (ensure secure handling).
- Input Token Amount: The amount of the initial token for arbitrage calculations.
- Use Jito-Enabled RPC: For the best performance and faster transaction processing, use a Jito-enabled RPC endpoint.
- Self-Hosted Jupiter API: Host your own Jupiter Swap API for better reliability and customization. Refer to Jupiter's documentation for setup instructions.
Contributions are welcome! If you have ideas for improving the bot or adding new features:
- Fork the repository.
- Implement your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Have questions or want to contribute to the discussion?
- Discord: Join our server
- Twitter: Follow us
Let’s automate arbitrage opportunities and maximize profits in the Solana ecosystem!