Polytraders Dev Guide
internal
v3 spine Phase 1 · Shared contracts 9 demo-wired · 0 shadow-ready · 0 production-live · 100 pending · 109 total 15/33 infra tasks the plan status board

← Principles & schemas

API surfaces

Every Polymarket interaction belongs to exactly one of these surfaces. Every input field on every bot declares which surface it consumes. If you find yourself unable to put an input in one of these eleven buckets, file an issue against this page.

The eleven surfaces

EnumEndpointAuthWhat it carries
gammahttps://gamma-api.polymarket.comNoneMarkets and events metadata. Includes negRisk and enableNegRisk booleans.
datahttps://data-api.polymarket.comNoneHistorical fills, prices, volumes, median spreads.
clob_publichttps://clob.polymarket.com (read endpoints)NoneLive order books, recent trades, market status.
clob_authhttps://clob.polymarket.com (auth endpoints)HMAC L1 + EIP-712 L2Order placement, cancel, replace; user balances and orders.
ws_marketwss://ws-subscriptions-clob.polymarket.com/ws/marketNonebook / price_change / tick_size_change / last_trade_price / best_bid_ask / new_market / market_resolved.
ws_userwss://ws-subscriptions-clob.polymarket.com/ws/userEIP-712 ClobAuthUser-scoped fills, order updates, balance changes.
ws_sportswss://sports-api.polymarket.com/wsNoneLive game state, score updates, period changes.
ws_rtdswss://ws-live-data.polymarket.comNoneReal-time crypto and equity prices, comment streams.
bridgehttps://bridge.polymarket.comWallet signatureDeposits and withdrawals; proxies fun.xyz.
onchainPolygon RPCWallet signature for writesCTFExchangeV2, NegRiskAdapter, pUSD ERC-20, UMA Optimistic Oracle.
internalPolytraders busmTLSInter-bot messaging: OrderIntent, RiskVote, ExecutionPlan, GovernanceLog.

Why we declare them

If a Polymarket endpoint moves, we want to find every bot affected by grepping a single field rather than searching for hostnames. Equally, if the operator changes the WS user-channel auth, we want a one-line audit of which bots will need re-auth wiring.

Ownership

SurfaceWho in Polytraders owns the wrapper
gamma, data, clob_publicSDK team — pure read wrappers, no state
clob_authExecution pod — owns signing, retry, idempotency
ws_market, ws_userSDK team — connection manager, last-message-id resume
ws_sports, ws_rtdsIntelligence pod — schema validation per topic
bridgeUser Tools pod — UI-driven only
onchainSecurity pod — every write goes through ContractAddressGuard
internalPlatform pod — bus, schemas, replay

Forward compatibility

If Polymarket adds a new surface (Solana CLOB, a Layer-2 settlement option, or a new public read-only endpoint), we add one enum value here and the corresponding wrapper to the SDK. Bots opt in by declaring the new value in their api_surface array — no shotgun surgery.