TypeScript bot for automated BNB-USD predictions on PancakeSwap & CandleGenie with smart betting strategies and auto-claiming features.
PredictionBot - Automated Trading Bot for PancakeSwap & CandleGenie
A sophisticated TypeScript-based trading bot that automatically places bets on BNB-USD price predictions across PancakeSwap and CandleGenie platforms. The bot uses intelligent strategies to maximize winning probability by analyzing market sentiment and betting patterns.
๐ Features
- Dual Platform Support: Works with both PancakeSwap Prediction V2 and CandleGenie Prediction V3
- Smart Betting Strategies:
- Automatic Claiming: Automatically claims winnings and handles refunds
- Dynamic Timing: Adjusts betting timing based on network conditions
- Real-time Monitoring: Live console output with colored status updates
- Error Handling: Robust error handling with automatic retry mechanisms
๐ Prerequisites
- Node.js (v14 or higher)
- npm or yarn package manager
- BSC (Binance Smart Chain) wallet with BNB for betting
- Private key for your wallet
๐ ๏ธ Installation
- Clone the repository
git clone https://github.com/mooncitydev/crypto-prediction-bot.git
cd PredictionBot-main
- Install dependencies
npm install
# or
yarn install
- Set up environment variables
.env file in the root directory:
PRIVATEKEY=yourwalletprivatekey_here
BET_AMOUNT=0.1
โ๏ธ Configuration
Environment Variables
| Variable | Description | Default | Required | |----------|-------------|---------|----------| | PRIVATE_KEY | Your wallet's private key | - | โ
Yes | | BET_AMOUNT | Amount of BNB to bet per round | 0.1 | โ No |
Contract Addresses
- PancakeSwap Prediction V2:
0x18B2A687610328590Bc8F2e5fEdDe3b582A49cdA - CandleGenie Prediction V3:
0x995294CdBfBf7784060BD3Bec05CE38a5F94A0C5
๐ฏ Usage
PancakeSwap Predictions
Against Strategy (Default)
npm run start
With Strategy
npm run start -- --with
CandleGenie Predictions
Against Strategy (Default)
npm run cg
With Strategy
npm run cg -- --with
๐ง How It Works
Betting Strategies
- Against Strategy:
- With Strategy:
Timing Mechanism
- Waits ~281.5 seconds after round start before placing bets
- Dynamically adjusts timing based on network congestion
- Reduces wait time by 6 seconds (2 blocks) if transactions fail
Automatic Features
- Claiming: Automatically claims winnings from previous rounds
- Refunds: Handles refunds for invalid rounds
- Dues: Sends 2% of winnings to specified address (
0x74b8B9b7aa13D26056F4eceBDF06C917d15974C7)
๐ Project Structure
src/
โโโ index.ts # PancakeSwap bot main file
โโโ candle-genie.ts # CandleGenie bot main file
โโโ lib.ts # Shared utilities and strategies
โโโ types/
โโโ typechain/ # Generated contract type definitions
โโโ CandleGeniePredictionV3.d.ts
โโโ PancakePredictionV2.d.ts
โโโ factories/
๐ง Development
Running Tests
npm test
TypeScript Compilation
The project uses TypeScript with the following configuration:- Target: ES5
- Module: CommonJS
- Strict mode enabled
โ ๏ธ Important Notes
Risk Disclaimer
- This bot involves financial risk. Only use funds you can afford to lose
- Past performance does not guarantee future results
- Cryptocurrency trading is highly volatile and unpredictable
- The bot's strategies are based on historical patterns and may not work in all market conditions
Security Considerations
- Never share your private key
- Use a dedicated wallet for bot trading
- Monitor your bot's performance regularly
- Keep your private key secure and never commit it to version control
Network Considerations
- The bot uses BSC mainnet by default
- Ensure you have sufficient BNB for gas fees
- Network congestion may affect transaction timing
๐ Performance Tips
- Start Small: Begin with small bet amounts to test the bot
- Monitor Closely: Watch the bot's performance for the first few rounds
- Network Conditions: Consider network congestion when setting bet amounts
- Strategy Selection: Test both "against" and "with" strategies to see what works best
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐จโ๐ป Author
Egor Gavrilov - Initial work
๐ Support
If you encounter any issues or have questions:
- Check the console output for error messages
- Verify your private key and BNB balance
- Ensure your network connection is stable
- Review the contract addresses are correct
- Telegram: @moooncity
Remember: Trading cryptocurrencies involves substantial risk of loss and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade cryptocurrency, you should carefully consider your investment objectives, level of experience, and risk appetite.