- This project is an arbitrage trading bot for the Solana blockchain.
- It fetches Raydium, Orca, Meteora token pools from the CoinGecko API, filters them based on liquidity, and identifies arbitrage opportunities between the highest and lowest price pools.
- The bot can execute swaps to take advantage of these opportunities.
- Node.js
- Yarn or npm
- A Solana wallet with some SOL for gas fees
-
Clone the repository:
git clone https://github.com/liam0413/arbitrage-trading-bot.git cd arbitrage-trading-bot -
Install dependencies:
yarn install # or npm install -
Create a
.envfile in the root directory and add your environment variables:CG_API_KEY=your_coingecko_api_key
-
Create a
config.jsfile in the root directory and add your configuration:export const GAS_FEE = 0.000005; export const SLIPPAGE = 0.005; export const JITO_FEES = 0.000001; export const SWAP_AMOUNT = 1; // Amount in SOL export const wrappedSolTokenAddress = "So11111111111111111111111111111111111111112"; export const secretKey = "your_base58_encoded_secret_key"; export const minLiquidityUsd = 1000; export const connection = new Connection(clusterApiUrl("mainnet-beta"), "confirmed");
-
Create a
token.jsonfile in the root directory and add the tokens you want to monitor:[ "token_address_1", "token_address_2" ]
To start the bot, run:
node index.jsThe bot will continuously fetch and filter pools, identify arbitrage opportunities, and log them to opportunities.json and profit_opportunities.log.
- Ensure your wallet has enough SOL to cover gas fees.
- The bot uses a retry mechanism to handle rate limits from the CoinGecko API.
- The bot logs profitable opportunities and can execute swaps if configured to do so.
- Currently the bot only uses the amount specified in the env file for swaps each time.
This project is licensed under the MIT License.