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

Signal template

Copy templates/signal-bot/ into the implementation repo. Fill in decide(). Run the fixtures.

Files

templates/signal-bot/
  README.md
  bot.ts
  config.schema.json
  default.config.json
  input.fixture.json
  expected.output.json
  tests.spec.ts

Bot interface bound

This template implements Bot<RawClobUpdate, MarketSnapshot>. The contract is the canonical bot interface.

The only function you write

async decide(input: RawClobUpdate, ctx: BotContext): Promise<MarketSnapshot> {
  const observedAt = ctx.now();
  return {
    schemaVersion: "1.0.0",
    marketId: input.conditionId,
    conditionTokens: input.tokens,
    resolution: { status: input.status },
    prices: { yes: input.yesPusd, no: input.noPusd },
    liquidityPusd: input.liquidityPusd,
    source: "clob_v2",
    observedAt,
    freshnessMs: observedAt - input.exchangeTimestampMs,
    provenance: hash(input.raw),
  };
}

What's already wired for you

Promotion checklist

  1. Implement decide().
  2. Run npm test — all four test classes must pass.
  3. Open a PR with the bot's spec page linked in the description.
  4. Promote through the modes ladder: stub → shadow → advisory → enforced.