Tyler Youk

Polymarket market-making bot

Videos

2 recorded

1. Intro: walking through your post and the plan

Nov 9, 2026 · 5:33

2. Technical implementation: deployment, secrets and the two repos

Nov 9, 2026 · 3:50

Architecture, animated

Proposed
Read from both repos

warproxxx/poly-maker: the base we keep 1,526 stars

  • Stack: Python 3.12, asyncio + uvloop, py-clob-client-v2 (Polymarket CLOB V2), web3, websockets, httpx, pydantic, structlog, typer CLI.
  • Storage: SQLite (tables positions, fills, order_log, pnl_snapshots) plus TOML config files (config, strategy profiles, market list). No external database.
  • Market data: Gamma API scanner ranks markets by rewards + rebates vs volatility; a live order book per token from the market WebSocket.
  • Pricing: fair value = depth-weighted microprice nudged by an EWMA of signed trade flow. Reservation r = FV − skew(inventory); half-spread δ = base + c_vol·σ + c_tox·toxicity. Bids YES at r − δ and NO at (1 − r) − δ.
  • Exit: when both sides fill, merge.py merges the YES + NO pair back to USDC at the locked edge 1 − p − q, so it never crosses the spread.
  • Risk: per-market notional cap, event-group cap, total exposure cap, daily-loss kill switch, stale-WebSocket halt, exchange heartbeat dead-man switch, and a regime machine (QUIET, TRENDING, EVENT, REDUCE_ONLY, HALTED).
  • Gap: built for long-dated political markets, not 5- and 15-minute crypto rounds.

nexosdata/polymarket-market-maker-bot: the math we port 0 stars, 2 commits

  • Stack: Python, numpy, httpx. A library plus a simulator, not a live trading engine.
  • Pricing: Avellaneda-Stoikov in logit space for prices bounded 0 to 1. logit(r) = logit(mid) − q·γ·σ²·τ + OFI drift, with Bernoulli variance σ²·p(1 − p).
  • Spread: S* = γσ²τ + (2/γ)·ln(1 + γ/κ). Wider with risk aversion γ, tighter with liquidity κ.
  • Order flow imbalance (OFI) and depth imbalance come from its level-2 order book (orderbook.py).
  • Risk: the adverse-selection guard cancels a resting quote when the mid moves 0.02 past it, but only inside SimulatedExecutionEngine. It has to be rebuilt as a live check.
  • Port only market_maker/strategy.py and orderbook.py, behind unit tests, since the repo is a week old.

How the two merge One process

  • poly-maker stays the engine: Gamma scanner, order gateway, rate limiter, reconciler, heartbeat, merge, SQLite state.
  • nexosdata's logit A-S reservation price and spread replace poly-maker's quote step for the 5m/15m markets.
  • The AS guard moves into poly-maker's reconciler as a live cancel on adverse mid moves.
  • The Gamma scanner gets a 5m/15m Up/Down filter per coin (BTC, ETH, SOL), each switchable in config.

New for this job Built

  • Fair value from Binance: a spot WebSocket per coin; P(Up) from the distance between spot and the round's strike price and the time left, giving Fair_Up and Fair_Down.
  • The 0.97 rule, checked before every order: total USD spent on Up + Down must stay under 0.97 × the smaller share count. If buying a side would break it, stop buying that side and hold to settlement.
  • Time cutoff: cancel_all 40 s before a 5m round and 90 s before a 15m round, then hold.
  • Paper mode: poly-maker's --paper switch, exposed on the dashboard.

Dashboard, hosting and operations AWS eu-west-1

  • Dashboard: FastAPI behind a login, served over HTTPS (Caddy). Start, stop and restart the bot; edit coins, 5m/15m toggles, size, spread and caps; live open orders, Up vs Down inventory and PnL read from the SQLite state.
  • Host: your Ubuntu EC2 in eu-west-1 (Ireland). The bot runs as a systemd service with Restart=always; the dashboard is a second service.
  • Setup as code: an Ansible playbook installs Python 3.12 + uv, the services, Caddy and the firewall, so the box can be rebuilt in one command. Docker is optional.
  • Secrets: the wallet key lives in a root-only .env, never in the dashboard's config file or in git. Logs go to journald.
  • Rollout: Milestone 1 runs paper mode against live markets; Milestone 2 goes live with a small burner wallet.

Questions for you

  • How do you deploy today: is the EC2 instance already up, and do you use Docker or Terraform?
  • poly-maker uses TOML config; is config.json a must, or is one TOML file the dashboard edits fine?
  • Which wallet type: a plain EOA, a Gnosis Safe, or a Polymarket deposit wallet? It changes how merges are signed.

Meta prompt

For agents to understand this architecture
Harness

Have an agent explain the Polymarket market-making bot architecture

Read-only. One paste. Ends in a brief.

Company info

Researched 2026-11-09
  • Upwork profile: Saudi Arabia, Finance & Accounting, small company (2–9 people), member since Oct 30, 2026, payment verified, 1 job posted, 0 hires.
  • The post's pricing module is nexosdata/polymarket-market-maker-bot, published by the GitHub account nexosdata (created Oct 30, 2026; 12 repos, all prediction-market tools, homepage naxosdata.com).
  • naxosdata.com was registered Oct 30, 2026: NaxosData, a prediction-market data API. Synchronized L2 order-book and tick data across Polymarket, Kalshi, ForecastEx, Limitless, PredictIt, Drift BET and Smarkets; REST at api.naxosdata.com/v1, WebSocket/SSE streams, Python and TypeScript SDKs, MCP servers.
  • NaxosData pricing: Hobbyist $0, Quant Pro $30/mo, Institutional $100/mo ("for macro funds, market makers & primes"). No people or location are named on the site.
  • Where it fits: NaxosData's historical L2 archives could back-test the bot's paper mode before Milestone 2.