- NEVER use your main wallet for this bot
- Create a dedicated bot wallet with minimal funds
- Only deposit what you're willing to lose
- This is experimental software - use at your own risk
This is a highly optimized settlement bot for the OpenOracle system on Arbitrum. The bot monitors for profitable settlement opportunities and executes them automatically.
-
Gas-Optimized Smart Contract (
CompetitiveSettleBot.sol)- Assembly optimizations for minimal gas usage
- Batch settlement capabilities
- MEV protection mechanisms
- Priority queue for maximum profitability
-
Intelligent Bot Runner (
bot-runner.js)- Real-time opportunity scanning
- Dynamic gas price management
- Concurrent transaction handling
- Performance tracking and metrics
-
Monitoring System (
monitor.js)- Health checks and alerts
- Discord notifications
- Performance reporting
- Error tracking
# Clone the repository
git clone <your-repo>
cd ClaudeCodeBOT
# Install dependencies
npm install
# Copy environment file
cp .env.example .envEdit .env file:
# REQUIRED - Bot wallet private key (create a new wallet!)
BOT_PRIVATE_KEY=your_private_key_here
# Optional - Deploy bot contract for better performance
BOT_CONTRACT=
# Optional - Discord alerts
DISCORD_WEBHOOK=your_webhook_urlOption A: Direct Settlement (No contract deployment)
# Run simulation first to check profitability
npm run simulate
# Start the bot
npm startOption B: Optimized with Smart Contract
# Deploy the contract
npm run deploy
# Add BOT_CONTRACT to .env
# Start the bot
npm startIn a separate terminal:
npm run monitor┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Bot Runner │────▶│ CompetitiveBot │────▶│ OpenOracle │
│ (bot-runner.js)│ │ (optional) │ │ Contract │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Monitor │ │ SmartAutoBeacon │
│ (monitor.js) │ │ (fallback) │
└─────────────────┘ └─────────────────┘
The bot includes multiple RPC endpoints for maximum reliability:
- Primary: Your custom RPC (if set in .env)
- Fallbacks:
- Arbitrum Official
- Lava Network
- Blast API
- Omnia Tech
- Alchemy
- BlockPI
- 1RPC
- Ankr
- PublicNode
The bot automatically switches to the next RPC if one fails, ensuring continuous operation.
- Minimal validation
- Direct execution
- Best for high-competition scenarios
- Profitability analysis
- Gas optimization
- Recommended for normal operation
- Commit-reveal mechanism
- Anti-frontrunning
- Use in high-value scenarios
- Use the bot contract for batch operations
- Monitor gas prices and set appropriate limits
- Focus on high-reward settlements
- Avoid settling during network congestion
- Run multiple bot instances with different strategies
- Use dedicated RPC endpoints
- Minimize logging in production
- Keep the processed reports cache small
- ✅ Use a dedicated bot wallet
- ✅ Start with small amounts
- ✅ Monitor bot performance
- ✅ Keep private keys secure
- ✅ Test on mainnet with tiny amounts first
- ❌ Use your main wallet
- ❌ Deposit large amounts
- ❌ Share your private keys
- ❌ Ignore error messages
- ❌ Run without monitoring
- Check if there are active reports:
npm run simulate - Verify gas price settings aren't too restrictive
- Ensure wallet has sufficient balance
- Check wallet balance
- Verify gas limits
- Look for reverted transactions on Arbiscan
- Adjust
MAX_GAS_PRICEin config - Use batch settlements
- Deploy and use the bot contract
// In bot-runner.js CONFIG object
MAX_GAS_PRICE: ethers.utils.parseUnits('0.2', 'gwei'),
MIN_PROFIT_WEI: ethers.utils.parseEther('0.0005'),
SCAN_INTERVAL: 500, // Faster scanning
BATCH_SIZE: 20, // Larger batchesRun different strategies in parallel:
# Terminal 1 - Conservative
MIN_PROFIT_ETH=0.001 npm start
# Terminal 2 - Aggressive
MIN_PROFIT_ETH=0.0001 SCAN_INTERVAL_MS=500 npm start- OpenOracle Docs: https://openprices.gitbook.io/openoracle-docs
- Contract: https://arbiscan.io/address/0xa935db8cb0f45256e3df77cbff1980cf7aeffbe4
- SmartAutoBeacon: https://arbiscan.io/address/0x0d623183d4a0de6e4871dfdd1350312c3b1538b6
For issues or questions:
- Check the troubleshooting section
- Review bot logs in
bot.log - Monitor health reports in
./reports/
MIT - Use at your own risk
Remember: This bot handles real money. Start small, monitor closely, and never risk more than you can afford to lose.