A real-time analytics assistant for Polymarket "Bitcoin Up or Down" 15-minute markets. Public-facing product site with docs, whitepaper, and live dashboard.
| Route | Description |
|---|---|
/ |
Marketing landing page |
/app |
Live dashboard (behind disclaimer gate) |
/docs |
Documentation index |
/docs/* |
MDX docs (Overview, Architecture, Data Sources, Edge Math, Risk + Limits, Local Development, Deployment) |
/whitepaper |
MDX whitepaper |
/changelog |
Release feed |
/about |
About page |
View on GitHub: https://github.com/FrondEnt/PolymarketBTC15mAssistant
# Install
npm install
cd visualizer && npm install
# Run (bot + UI)
npm run devOpen http://localhost:3333 — landing at /, dashboard at /app, docs at /docs.
- Polymarket market selection + UP/DOWN prices + liquidity
- Polymarket live WS Chainlink BTC/USD CURRENT PRICE (same feed shown on the Polymarket UI)
- Fallback to on-chain Chainlink (Polygon) via HTTP/WSS RPC
- Binance spot price for reference
- Short-term TA snapshot (Heiken Ashi, RSI, MACD, VWAP, Delta 1/3m)
- A simple live Predict (LONG/SHORT %) derived from the assistant’s current TA scoring
- Node.js 18+ (https://nodejs.org/en)
- npm (comes with Node)
git clone https://github.com/FrondEnt/PolymarketBTC15mAssistant.gitAlternative (no git):
- Click the green
<> Codebutton on GitHub - Choose
Download ZIP - Extract the ZIP
- Open a terminal in the extracted project folder
Then open a terminal in the project folder.
npm installYou can run without extra config (defaults are included), but for more stable Chainlink fallback it’s recommended to set at least one Polygon RPC.
$env:POLYGON_RPC_URL = "https://polygon-rpc.com"
$env:POLYGON_RPC_URLS = "https://polygon-rpc.com,https://rpc.ankr.com/polygon"
$env:POLYGON_WSS_URLS = "wss://polygon-bor-rpc.publicnode.com"Optional Polymarket settings:
$env:POLYMARKET_AUTO_SELECT_LATEST = "true"
# $env:POLYMARKET_SLUG = "btc-updown-15m-..." # pin a specific marketset POLYGON_RPC_URL=https://polygon-rpc.com
set POLYGON_RPC_URLS=https://polygon-rpc.com,https://rpc.ankr.com/polygon
set POLYGON_WSS_URLS=wss://polygon-bor-rpc.publicnode.comOptional Polymarket settings:
set POLYMARKET_AUTO_SELECT_LATEST=true
REM set POLYMARKET_SLUG=btc-updown-15m-...Notes:
- These environment variables apply only to the current terminal window.
- If you want permanent env vars, set them via Windows System Environment Variables or use a
.envloader of your choice.
This project reads configuration from environment variables.
You can set them in your shell, or create a .env file and load it using your preferred method.
POLYMARKET_AUTO_SELECT_LATEST(default:true)- When
true, automatically picks the latest 15m market.
- When
POLYMARKET_SERIES_ID(default:10192)POLYMARKET_SERIES_SLUG(default:btc-up-or-down-15m)POLYMARKET_SLUG(optional)- If set, the assistant will target a specific market slug.
POLYMARKET_LIVE_WS_URL(default:wss://ws-live-data.polymarket.com)
CHAINLINK_BTC_USD_AGGREGATOR- Default:
0xc907E116054Ad103354f2D350FD2514433D57F6f
- Default:
HTTP RPC:
POLYGON_RPC_URL(default:https://polygon-rpc.com)POLYGON_RPC_URLS(optional, comma-separated)- Example:
https://polygon-rpc.com,https://rpc.ankr.com/polygon
- Example:
WSS RPC (optional but recommended for more real-time fallback):
POLYGON_WSS_URL(optional)POLYGON_WSS_URLS(optional, comma-separated)
The bot supports HTTP(S) proxies for both HTTP requests (fetch) and WebSocket connections.
Supported env vars (standard):
HTTPS_PROXY/https_proxyHTTP_PROXY/http_proxyALL_PROXY/all_proxy
Examples:
PowerShell:
$env:HTTPS_PROXY = "http://127.0.0.1:8080"
# or
$env:ALL_PROXY = "socks5://127.0.0.1:1080"CMD:
set HTTPS_PROXY=http://127.0.0.1:8080
REM or
set ALL_PROXY=socks5://127.0.0.1:1080-
Take your proxy host and port (example:
1.2.3.4:8080). -
Add your login and password in the URL:
- HTTP/HTTPS proxy:
http://USERNAME:PASSWORD@HOST:PORT
- SOCKS5 proxy:
socks5://USERNAME:PASSWORD@HOST:PORT
- Set it in the terminal and run the bot.
PowerShell:
$env:HTTPS_PROXY = "http://USERNAME:PASSWORD@HOST:PORT"
npm startCMD:
set HTTPS_PROXY=http://USERNAME:PASSWORD@HOST:PORT
npm startImportant: if your password contains special characters like @ or : you must URL-encode it.
Example:
- password:
p@ss:word - encoded:
p%40ss%3Aword - proxy URL:
http://user:p%40ss%3Aword@1.2.3.4:8080
npm start
# or
npm run botThe bot runs the Polymarket/BTC logic and prints the dashboard in the terminal every second.
The visualizer is a separate Next.js app that shows live bot state in the browser. It does not parse terminal output; the bot broadcasts structured JSON over WebSocket.
Two terminals:
-
Terminal 1 – bot (WebSocket on 3334):
npm run bot
You should see:
[viz] WS server on ws://localhost:3334 -
Terminal 2 – UI (HTTP on 3333):
npm run viz
First time:
cd visualizer && npm installthennpm run dev. -
Browser: open http://localhost:3333
The UI connects to ws://localhost:3334 and updates live. If the bot is not running, the UI loads but shows “Waiting for bot…”.
Env vars:
| Variable | Default | Description |
|---|---|---|
VISUALIZER_ENABLE |
true |
Set to false to run bot without starting the WS server (terminal-only). |
VIS_WS_PORT |
3334 |
Port the bot’s WebSocket server binds to. |
NEXT_PUBLIC_VIS_WS_PORT |
3334 |
Port the Next.js app uses to connect to the bot (set in visualizer if different). |
Terminal-only mode (no WebSocket):
VISUALIZER_ENABLE=false npm run botThe bot runs as before; no WS server is started. The UI at http://localhost:3333 can still be opened but will show disconnected.
Root cause of “localhost invalid response”: Previously the bot served the dashboard on 3333; path/timing issues caused 404 or invalid HTTP. This is fixed by serving the UI from Next.js on 3333 and the bot only exposing WebSocket on 3334. See docs/ROOT_CAUSE_AND_FIX.md.
Step-by-step: See docs/HOW_TO_USE.md for setup, two-terminal run, and troubleshooting.
Customization & hotkeys (dashboard at /app):
The visualizer uses a modern YC-style layout with a Settings drawer. Options are saved in localStorage.
| Hotkey | Action |
|---|---|
⌘K / Ctrl+K |
Open command palette — jump to modules, toggle visibility |
Settings (gear icon, stored in localStorage):
- Density: Comfortable / Compact — padding and spacing
- Accent color: green / cyan / purple — highlight color
- Module visibility: show/hide Setup Quality, Market Prices, BTC Price, Conditions, TA Snapshot, Microstructure, Sources
SETUP QUALITY: 0–100 score (Poor/Fair/Good/Great) with one-line rationale. "View details" expands the breakdown (liquidity/cost, volatility regime, trend vs chop, signal agreement).
A Bloomberg-style terminal is available at /terminal with a dark, dense, keyboard-first layout.
One command (runs bot + UI together):
npm run devThis starts:
- UI on http://localhost:3333 (Next.js + WebSocket + ingest API)
- Bot with
INGEST_URLset, POSTing snapshots to/api/ingestevery tick
Browser: open http://localhost:3333/terminal
Or run separately (two terminals):
-
Terminal 1 – UI:
npm run dev:ui
(or
cd visualizer && npm run dev) -
Terminal 2 – Bot with ingest:
INGEST_URL=http://localhost:3333/api/ingest npm run bot
On Windows CMD:
set INGEST_URL=http://localhost:3333/api/ingest && npm run botOn Windows PowerShell:
$env:INGEST_URL="http://localhost:3333/api/ingest"; npm run bot -
Browser: http://localhost:3333/terminal
Terminal keyboard shortcuts:
g– Toggle green/cyan themer– Reconnect streams– Pause/resume updates?– Show help modal
Smoke test (exact steps):
npm install(from project root)cd visualizer && npm install(first time only)npm run dev(from project root)- Wait ~5–10 seconds for the bot to fetch data and POST to ingest
- Open http://localhost:3333/terminal in a browser
- Verify: connection status shows LIVE (green), BTC price and market panels populate
- Press
?to open help modal,gto toggle green/cyan theme,sto pause updates
Press Ctrl + C in the terminal.
git pull
npm install
npm start- If you see no Chainlink updates:
- Polymarket WS might be temporarily unavailable. The bot falls back to Chainlink on-chain price via Polygon RPC.
- Ensure at least one working Polygon RPC URL is configured.
- If the console looks like it “spams” lines:
- The renderer uses
readline.cursorTo+clearScreenDownfor a stable, static screen, but some terminals may still behave differently.
- The renderer uses
npm run build # From project root (builds visualizer)
cd visualizer && npm run build # Visualizer onlyBoth should complete without errors. The visualizer is a Next.js app with marketing landing (/), docs (/docs), whitepaper (/whitepaper), changelog (/changelog), about (/about), and the live dashboard (/app). Use ⌘K (or Ctrl+K) for the command palette.
OG image: Add visualizer/public/og.png (1200×630) for social sharing previews. Metadata references /og.png.
https://github.com/FrondEnt/PolymarketBTC15mAssistant
This is not financial advice. Use at your own risk. The dashboard uses PASS/WATCH language; no "trade now" or buy recommendations.
created by @krajekis