A high-performance Solana arbitrage bot that automatically detects and executes profitable trading opportunities across different DEX routes using Jupiter aggregator and fast transaction submission methods.
- Automated Arbitrage Detection: Continuously monitors price differences between trading pairs
- Jupiter Integration: Uses Jupiter aggregator for optimal swap routes and best execution prices
- Fast Transaction Submission: Supports multiple fast transaction submission methods:
- Jito MEV: Bundle transactions for faster processing and MEV protection
- Solayer: High-speed transaction submission for competitive advantage
- Smart Route Optimization: Automatically finds the most profitable arbitrage paths
- Real-time Monitoring: Continuous operation with configurable delays
- Token Management: Automatic ATA (Associated Token Account) creation and cleanup
- Slippage Protection: Configurable slippage tolerance for safe trading
The bot operates on a continuous loop that:
- Monitors price differences between USDC and target tokens
- Calculates potential arbitrage opportunities
- Executes trades when profit thresholds are met
- Uses fast transaction submission for competitive advantage
- Manages token accounts efficiently
- Node.js (v16 or higher)
- Solana CLI tools
- A Solana wallet with SOL for transaction fees
- USDC balance for trading
-
Clone the repository
git clone jupiter-arbitrage-bot-master cd jupiter-arbitrage-bot-master
-
Install dependencies
npm install # or yarn install
-
Set up environment variables Create a
.env
file in the root directory:PRIVATE_KEY=your_wallet_private_key_here MAINNET_RPC=your_mainnet_rpc_endpoint_here UPPER_AMOUNT_WITH_DECIMAL=1000000
PRIVATE_KEY
: Your Solana wallet private key (required)MAINNET_RPC
: Mainnet RPC endpoint (required)UPPER_AMOUNT_WITH_DECIMAL
: Minimum profit threshold in lamports (default: 0)
The bot is currently configured to trade between:
- Base Token: USDC (
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
) - Target Token: USDT (
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
) - Trade Amount: 5 USDC per trade (5,000,000 lamports)
- Delay: 500ms between trades
npm run dev
# or
yarn dev
npm start
# or
yarn start
Edit src/index.ts
to modify the trading pairs:
// Change the target token mint address
await getRoute(STABLE_COIN.usdc, "NEW_TOKEN_MINT_ADDRESS", 5_000_000);
Modify the amount parameter in the getRoute
call:
// Change from 5 USDC to 10 USDC
await getRoute(STABLE_COIN.usdc, "TOKEN_MINT", 10_000_000);
Adjust the sleep duration in the main loop:
await sleep(1000); // Change to 1 second delay
- Slippage Protection: Configurable slippage tolerance
- Profit Thresholds: Minimum profit requirements before execution
- Error Handling: Graceful error handling with logging
- Account Management: Automatic cleanup of temporary token accounts
- Mainnet: Full production support
- Devnet: For testing (requires configuration changes)
@coral-xyz/anchor
: Solana program interaction@solana/web3.js
: Solana blockchain interaction@solana/spl-token
: Token program utilitiesundici
: HTTP client for API callsdotenv
: Environment variable management
src/
βββ config/ # Configuration files
βββ constant/ # Constants and addresses
βββ fast-landing-api/ # Fast transaction submission
βββ module/ # Core bot modules
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
βββ index.ts # Main bot entry point
- Private Key Security: Never commit your private key to version control
- Risk Management: This bot involves real money trading - use at your own risk
- Testing: Always test on devnet before mainnet deployment
- Monitoring: Keep an eye on the bot's performance and adjust parameters as needed
This software is for educational and research purposes. Trading cryptocurrencies involves substantial risk of loss and is not suitable for all investors. The value of cryptocurrencies can go down as well as up, and you may lose some or all of your investment. Past performance is not indicative of future results.
Contributions are welcome! Please feel free to submit a Pull Request.
For questions, support, or collaboration opportunities:
Telegram: @moooncity
Made with β€οΈ for the Solana ecosystem