mooncitydev
crypto-prediction-bot
TypeScript

TypeScript bot for automated BNB-USD predictions on PancakeSwap & CandleGenie with smart betting strategies and auto-claiming features.

Last updated Jun 19, 2026
41
Stars
9
Forks
0
Issues
0
Stars/day
Attention Score
45
Language breakdown
TypeScript 99.7%
JavaScript 0.3%
โ–ธ Files click to expand
README

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:
- Against Strategy: Bets against the majority when odds are favorable - With Strategy: Bets with the majority when conditions are optimal
  • 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
Create a .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:
- Analyzes bull vs bear betting amounts - Places bets against the majority when the ratio is favorable (< 5:1) - Exploits market inefficiencies and herd behavior
  • With Strategy:
- Bets with the majority when conditions suggest momentum - Uses similar ratio analysis but follows the crowd

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
Need Help? Contact the developer:

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.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท mooncitydev/crypto-prediction-bot ยท Updated daily from GitHub