Skip to content

Repository files navigation

Binance Prediction Bot

Automated trading bot for the Binance Web3 Up/Down prediction market (5-minute candles). It follows the market trend using a multi-signal consensus and only enters a position when the signals strongly agree, then holds until settlement.

Built with Node.js, with a live dashboard to monitor rounds, scores and orders, and a simulation mode for testing without risking real funds.

License: MIT Node.js Version

Status: this bot is under active development. The long-term goal is to help users generate passive income. Please test with the minimum stake before using real funds.

⚠️ Warning: Binance API latency can cause the final settled amount to differ from the quoted amount shown before entry.

Features

  • Trend-following strategy — predicts the direction the market is pushing, not reversals.
  • Multi-signal consensus — weighted score from 5 signals (see below).
  • Volatility filter — skips flat and chaotic markets.
  • Anti-whipsaw persistence — consensus must hold N seconds before entering.
  • Live dashboard — per-round score, orderbook imbalance, trend, consensus and orders.
  • Simulation + real modes — paper-trade first, go live when ready.
  • Automatic claim — redeems winning positions in real mode (with WebSocket confirmation).
  • Fully configurable from the dashboard — no secrets hardcoded in the source.

How it works

Each round, every signal votes with a weighted, normalized value in [-1, 1]. The total score is compared against a threshold, and a buy is placed only when the consensus is strong and sustained.

Signal Weight Source
priceTrend 1.0 Spot price linear-regression slope (15s/60s)
chanceMomentum 1.0 Up-chance slope (REST + orderbook)
depthImbalance 0.8 Prediction orderbook bid/ask depth imbalance
vwap 0.5 Price deviation vs 90s VWAP
priceVsStart 0.4 Price deviation vs round start price

Max score: ±3.7. A buy requires |score| >= minScore sustained for persistSec seconds, with the winning side's chance inside [chanceMin, chanceMax]. Positions are held until settlement (no early sell / stop-loss).

Requirements

  • Node.js 18+
  • A Binance account with a Web3 Prediction wallet and API key/secret
  • API permissions for the Web3 Prediction endpoints

Binance API setup

The bot uses the Binance Web3 Prediction API (signed) to list markets, place orders, redeem winnings and stream wallet events.

Required permissions

When creating the API key, enable:

  • Enable Reading — to list markets, wallets and positions.
  • Enable Spot & Margin Trading — to place and manage prediction orders.

Do not enable withdrawals — keep Enable Withdrawals disabled. The bot never moves funds out of your account; it only redeems winnings back to the prediction wallet.

Creating the API key

  1. Log in to Binance and open your profile menu (top-right) → API Management.
  2. Click Create API and choose System generated (recommended) or Self-generated (Ed25519).
  3. Complete the security verification (2FA).
  4. Under API restrictions, enable Enable Reading and Enable Spot & Margin Trading.
  5. (Recommended) enable Restrict access to trusted IPs only and add your server's IP address.
  6. Copy the API key and Secret key — the secret is shown only once.
  7. Create the Web3 Prediction wallet on Binance and fund it with USDT.

Then set the credentials in .env or from the dashboard Config modal.

Installation

git clone https://github.com/thericksanchezdev/bot-prediction-binance.git
cd bot-prediction-binance
npm install

Configuration

Everything can be configured either from environment variables or from the dashboard (recommended). Environment variables take precedence.

Option A — .env

cp .env.example .env
# edit .env with your Binance API credentials

Option B — Dashboard

Run the bot and open the dashboard, then use the Config modal to set the API key, API secret and every trading parameter. Values are persisted locally (gitignored).

npm start
# Dashboard: http://localhost:3020

Configuration reference

Parameter Default Description
stakeAmount 1 USDT per order
minScore 2.5 Minimum score to enter (max 3.7)
chanceMin / chanceMax 0.5 / 1 Winning-side chance window
maxTimeToEntry 120 Entry window in seconds
waitSeconds 10 Initial wait after round start
persistSec 10 Consensus persistence (anti-whipsaw)
consensusGrace 2 Tolerated consecutive "blips"
symbols BTCUSDT,ETHUSDT,BNBUSDT Traded symbols
modeSim / modeReal true / false Simulation / real modes
simCapital 1000 Simulation starting capital
slippageBps 800 Order slippage tolerance
feeRateBps 200 Fee rate for quotes
orderType MARKET Order type
claimDelaySec 120 Delay before auto-claim (real mode)
port 3020 Dashboard port

Dashboard

The dashboard (http://localhost:3020) shows live rounds, the weighted score with its breakdown, orderbook imbalance, trend, consensus progress, orders table and session PnL. From the Config modal you can adjust any parameter (including API credentials) without editing code.

Screenshots

Header — session capital, PnL and mode badges:

Bot Prediction dashboard header

Live rounds grid — score, countdown, trend, orderbook imbalance and consensus:

Bot Prediction dashboard rounds grid

Orders table — history with stake, payout, PnL and status:

Bot Prediction dashboard orders table

Roadmap

  • Optional early sell — we are currently adding an optional feature to sell an open position when the trend reverses after entry.
  • Passive income — the long-term goal is to let every user generate passive income automatically with minimal configuration.

Donations

If this bot is useful to you, you can support its development:

  • Bitcoin (BTC): bc1qt22xsm0ws22nnpn2d5f9m0jmgdp6m7w8s6zdu5
  • Ethereum (ETH): 0xa09AD7AdE3215D0623F87b384372B3695eC521B5

Disclaimer

This software is provided for educational and informational purposes only. Trading cryptocurrency involves substantial risk of loss and is not suitable for every investor. Use at your own risk. The author is not responsible for any financial loss.

License

MIT © 2026 thericksanchezdev

About

Binance Web3 Up/Down prediction market bot — trend-following multi-signal consensus with dashboard, sim/real modes and auto-claim

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages