Low-latency Polymarket scanner and execution skeleton. It defaults to paper trading and is designed to prove signal quality before moving the execution-critical path to Rust.
EXECUTION_MODE=paperby default.- Live execution requires explicit env vars and code path.
- Hard risk checks run before every order.
- Orders use a short cancel timeout.
- No seed phrases. Use a limited wallet and small funded balance only.
cd /home/polymarket-sniper-ts
npm install
cp .env.example .env
npm run devPaper mode scans live public market data and logs the orders it would send:
EXECUTION_MODE=paper npm run devFor a quick diagnostic that avoids waiting on strict closing-time filters:
SCANNER_MODE=tradable EXECUTION_MODE=paper npm run devBTC-only crypto close-sniper mode:
npm run paper:btcStricter BTC tuning for better paper validation:
npm run paper:btc:tunedObserve BTC close-window orderbooks without aiming to trade:
npm run observe:btc:shortBTC, ETH, XRP, and SOL together:
npm run paper:cryptoCurrent price feed note: PRICE_FEED_SOURCE=binance is a prototype signal feed. Live crypto execution is blocked with Binance by default because Polymarket crypto up/down settlement should be matched to its resolution source, not an exchange proxy.
Paper crypto mode writes evaluated results after each market closes:
npm run report:paperResult records are stored as JSONL at PAPER_RESULTS_PATH, defaulting to logs/paper-results.jsonl.
The tuned scripts write to logs/paper-results-tuned.jsonl.
To widen the window for diagnostics without waiting for the final seconds:
SCANNER_MODE=crypto-updown CRYPTO_PAIRS=btc CRYPTO_ENTRY_START_MS=-300000 CRYPTO_ENTRY_END_MS=120000 EXECUTION_MODE=paper npm run devTune these first:
MAX_TIME_TO_CLOSE_MS=30000
SCAN_INTERVAL_MS=250
MAX_BUY_PRICE=0.970
MIN_CONFIDENCE=0.850
MIN_EDGE=0.012
CRYPTO_MIN_MOVE_BPS=3
CRYPTO_MIN_DEPTH_USD=0
CRYPTO_OBSERVE_BOOKS=false
MAX_ORDER_SIZE_USDC=10
Live mode should only be enabled after paper results show real edge.
EXECUTION_MODE=live PRIVATE_KEY=0x... npm run devUse a dedicated wallet with limited funds. Do not use a seed phrase. Do not run live mode until you have verified allowances, funder/proxy wallet settings, and the exact SDK v2 signature type required by your Polymarket account.
Gamma scanner -> CLOB orderbook -> Signal scorer -> Risk gate -> Executor
The TypeScript MVP should be used for paper trading and strategy validation. Once fills and edge are proven, move the ExecutionIntent contract to the Rust executor sketch in rust-executor-sketch/.
For lower latency:
- Run near Polymarket/CLOB network region.
- Keep API credentials derived once at startup.
- Keep orderbook snapshots hot through WebSocket when added.
- Move only
ExecutionIntent -> signed order -> post -> cancel timeoutinto Rust. - Re-run risk limits inside Rust so TypeScript cannot accidentally over-order.