Automated trading bot for Polymarket crypto up/down markets. Beat Spike watches short-term price momentum on Binance or Chainlink, enters only when the move crosses the slug-open beat price, and buys in the direction of the spike (UP on a down→up cross, DOWN on an up→down cross).
Default mode is paper trading — no live orders until you configure credentials and enable execution.
Each Polymarket up/down market has a beat price (the reference price at market open). Beat Spike runs a two-stage pipeline:
- Momentum trigger — On the configured signal feed,
|price_now − price_{now−lookback}|must exceed a USD threshold (e.g. $24 for BTC with a 3s lookback). - Beat-cross direction — The lookback window must cross the slug-open beat:
- Price moves below → above beat → buy UP
- Price moves above → below beat → buy DOWN
- No cross → trade rejected
Orders are placed on the Polymarket CLOB (limit by default) during a configurable entry window (e.g. 240s after slug open on 5m BTC markets).
Feed tick
→ |Δ| ≥ threshold? (momentum spike)
→ ref and now straddle beat?
→ cross up → BUY UP
→ cross down → BUY DOWN
→ CLOB order on chosen token
| Component | Command | Port | Role |
|---|---|---|---|
| Dashboard server | make server |
8788 | Chainlink + Binance WebSocket feeds, beat resolution, REST/WS API |
| Trading bot | make bot |
— | Detection, beat filter, order execution |
| Web UI | make web |
5174 | Live feeds, charts, trade history |
| Profile monitor | make monitor |
— | Optional wallet watcher (disabled by default) |
The bot reads feeds from the dashboard server by default (feeds.source: server), so start the server before the bot.
- Git
- Python 3.10+ with
python3andvenvon your PATH - Node.js 18+ and npm (for the web dashboard)
- make (Linux/macOS; on Windows use WSL or Git Bash)
Optional for production-style background runs: PM2 (npm install -g pm2).
git clone https://github.com/zerosupercycle/Beat-Spike.git
cd Beat-Spikemake installThis creates a Python virtualenv, installs bot and server requirements, installs web npm packages, and copies .env.example to .env if .env does not exist yet.
Paper mode works out of the box. To customize behavior, edit config/default.yaml.
For live trading, set wallet and CLOB credentials in .env (see Environment variables) and set bot.mode: live plus execution.enabled: true in config.
Open three terminals from the project root:
# Terminal 1 — feeds + API (start this first)
make server
# Terminal 2 — paper trading bot
make bot
# Terminal 3 — dashboard UI
make webThen open http://localhost:5174 for the dashboard.
Verify the server is up:
make healthRun all services in the background:
make pm2-start # server + bot + web + monitor
make pm2-status
make pm2-logs
make pm2-stopPrimary config: config/default.yaml
| Section | Purpose |
|---|---|
bot.mode |
paper or live |
markets |
Assets and intervals (e.g. BTC 5m) |
entry |
Seconds after slug open / before close to allow entries |
strategy |
Signal feed, lookback, thresholds, beat-cross logic |
trading |
Share size, limit price, order style |
execution |
CLOB credentials gate (keep secrets in .env) |
feeds |
server (recommended) or local WebSocket feeds |
chainlink |
Optional Data Streams credentials for precise beat lookup |
Per-asset thresholds live under strategy.by_asset. Signal feed options: binance or chainlink.
Set in .env (see .env.example):
| Variable | Purpose |
|---|---|
BEAT_SPIKE_EXECUTION__PRIVATE_KEY |
Wallet private key (live only) |
BEAT_SPIKE_EXECUTION__FUNDER |
Polymarket proxy/funder address |
BEAT_SPIKE_EXECUTION__API_KEY |
CLOB API key |
BEAT_SPIKE_EXECUTION__API_SECRET |
CLOB API secret |
BEAT_SPIKE_EXECUTION__API_PASSPHRASE |
CLOB passphrase |
BEAT_SPIKE_BOT__MODE |
Override bot.mode |
BEAT_SPIKE_CHAINLINK__STREAMS_* |
Chainlink Data Streams credentials |
Legacy DAWN_* env names are still accepted as fallbacks.
- Set wallet and CLOB credentials in
.env. - Set
execution.enabled: trueandbot.mode: livein config (or via env). - Confirm risk limits under
riskif enabled. - Run
make serverthenmake bot.
Never commit .env or private keys.
| Feed | Source | Used for |
|---|---|---|
| Binance | Spot ticker WebSocket | Default signal feed; fast momentum |
| Chainlink | Polymarket RTDS or Data Streams | Resolution-aligned beat; optional signal feed |
Coinbase is not supported — use Binance or Chainlink.
config/monitor.yaml watches Polymarket profiles for up/down buys and captures price charts. It is disabled by default. Add your own profile URLs to targets and set enabled: true to use it.
| Path | Contents |
|---|---|
data/trades.jsonl |
Trade log |
data/bot_status.json |
Bot state |
data/trade_snapshots/ |
Chart snapshots at trade time |
data/beat-spike.log |
Bot log file |
data/feed_beats.json |
Persisted per-slug beat prices |
data/latency-probe.txt |
Latest Polymarket endpoint latency report |
bot/ Trading logic, feeds, Polymarket CLOB integration
server/ FastAPI dashboard + feed aggregator
web/ React/Vite dashboard
config/ YAML configuration
data/ Runtime logs and snapshots (gitignored in production)
Run make help for all targets. Common commands:
make install— Install dependenciesmake server/make bot/make web— Run componentsmake bot-stop— Stop a running botmake web-build— Production UI buildmake clean— Remove venv and node_modules
This software is for educational and research purposes. Trading on prediction markets involves financial risk. You are responsible for compliance with applicable laws and Polymarket terms of service. Use at your own risk.