Skip to content

About

polymarket-strategy-archive

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Polymarket Sniper TypeScript MVP

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.

Safety Defaults

  • EXECUTION_MODE=paper by 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.

Setup

cd /home/polymarket-sniper-ts
npm install
cp .env.example .env
npm run dev

Paper Mode

Paper mode scans live public market data and logs the orders it would send:

EXECUTION_MODE=paper npm run dev

For a quick diagnostic that avoids waiting on strict closing-time filters:

SCANNER_MODE=tradable EXECUTION_MODE=paper npm run dev

BTC-only crypto close-sniper mode:

npm run paper:btc

Stricter BTC tuning for better paper validation:

npm run paper:btc:tuned

Observe BTC close-window orderbooks without aiming to trade:

npm run observe:btc:short

BTC, ETH, XRP, and SOL together:

npm run paper:crypto

Current 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:paper

Result 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 dev

Tune 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

Live mode should only be enabled after paper results show real edge.

EXECUTION_MODE=live PRIVATE_KEY=0x... npm run dev

Use 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.

Architecture

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/.

Millisecond Path

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 timeout into Rust.
  • Re-run risk limits inside Rust so TypeScript cannot accidentally over-order.

About

polymarket-strategy-archive

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages