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
HomeBy LayerStrategy3.24 MarketCreationScout

3.24 MarketCreationScout

Strategy Alpha Strategy Trade PLANNED Spec started capital · Direct P8 · Additional strategies pending stub

MarketCreationScout monitors newly created Polymarket markets and identifies those worth seeding with early maker liquidity before the spread tightens. It evaluates quality score, market age, and event category, then emits GTC post-only OrderIntents to seed the book with initial maker quotes, generating rebate income from early-adopter taker flow.

v3 readiness

Docs27/27
donehow scored
Impl0/15
pendinghow scored
Backtest0/4
pendinghow scored
Runtime0/8
pendinghow scored

A bot is done when all four scores are. What does done mean?

1. Bot Identity

LayerStrategy  Strategy
Bot classAlpha Strategy
AuthorityTrade
StatusPLANNED
ReadinessSpec started
Runs beforeRisk guardrail pipeline
Runs afterObservation bus / internal analytics
Applies toNewly created Polymarket binary markets within max_age_minutes of creation that score >= min_quality_score from the internal market evaluator
Default modeshadow_only
User-visibleAdvanced details only
Developer ownerPolytraders core — Strategy pod

2. Purpose

MarketCreationScout monitors newly created Polymarket markets and identifies those worth seeding with early maker liquidity before the spread tightens. It evaluates quality score, market age, and event category, then emits GTC post-only OrderIntents to seed the book with initial maker quotes, generating rebate income from early-adopter taker flow.

3. Why This Bot Matters

  • Quality score mis-evaluates market

    If the quality model gives a high score to a market that is poorly formed or resolves unexpectedly, the seed capital is exposed to an unintended directional position.

  • Stale input data

    Acting on stale signals for MarketCreationScout produces trades based on outdated market conditions, generating adverse fills.

  • KillSwitch not respected

    Emitting OrderIntents while KillSwitch is active bypasses risk controls.

No worked examples on this bot yet. Worked examples are optional but strongly recommended — they turn an abstract failure mode into something a developer can verify in a fixture.

4. Required Polymarket Inputs

InputSourceRequired?Use
CLOB book (mid, depth, spread)ws_marketYesRead current market price and available depth for order sizing.
Market status (open/closed/resolved)clob_publicYesSkip closed or resolved markets.

5. Required Internal Inputs

InputSourceRequired?Use
KillSwitch active flagKillSwitchYesAbort all intent emission if KillSwitch active.
MarketCreationScout analytics signalinternal (analytics engine)YesProvides the core MarketCreationScout signal that drives trade decisions.
Builder code bytes32internal configYesInjected into builder field on every signed V2 OrderIntent.

6. Parameter Guide

ParameterDefaultWarningHardWhat it controls
min_quality_score0.70.550.4Minimum market quality score (0–1) from the internal market evaluator required before seeding maker liquidity.
seed_size_usd200400600pUSD size for the initial seed maker quote per side.
max_age_minutes3060120Maximum market age in minutes before the bot considers a market too established for scout seeding.
auto_handoff_tomaker-wideNoneNoneSlug of the maker strategy bot to automatically hand off the seeded market to after the seed quote is placed.

7. Detailed Parameter Instructions

min_quality_score

What it means

Minimum market quality score (0–1) from the internal market evaluator required before seeding maker liquidity.

Default

{ "min_quality_score": 0.7 }

Why this default matters

0.70 ensures only well-formed, liquid-potential markets receive seed capital.

Threshold logic

ConditionAction
>= 0.70Allow seed quote
0.55–0.70WARN MCS_LOW_QUALITY; halve seed size
< 0.40SKIP MCS_QUALITY_BELOW_FLOOR

Developer check

if quality_score < params.hard: return skip('MCS_QUALITY_BELOW_FLOOR')

User-facing English

The market quality score was too low for seeding.

seed_size_usd

What it means

pUSD size for the initial seed maker quote per side.

Default

{ "seed_size_usd": 200 }

Why this default matters

200 pUSD seeds visible liquidity without over-committing on an unproven new market.

Threshold logic

ConditionAction
<= 200 pUSDNormal seed
> 600 pUSDReject config

Developer check

if params.seed_size_usd > params.hard: raise ConfigError('PARAMETER_CHANGE_REQUIRES_APPROVAL')

User-facing English

Seed size capped at the configured maximum.

max_age_minutes

What it means

Maximum market age in minutes before the bot considers a market too established for scout seeding.

Default

{ "max_age_minutes": 30 }

Why this default matters

30 minutes targets the early-discovery window before arbitrageurs and other makers tighten the spread.

Threshold logic

ConditionAction
<= 30 minSeed candidate
60–120 minWARN MCS_MARKET_MATURING; halve seed
> 120 minSKIP MCS_MARKET_TOO_OLD

Developer check

if market_age_min > params.hard: return skip('MCS_MARKET_TOO_OLD')

User-facing English

The market has been open too long for a scout seed.

auto_handoff_to

What it means

Slug of the maker strategy bot to automatically hand off the seeded market to after the seed quote is placed.

Default

{ "auto_handoff_to": "maker-wide" }

Why this default matters

Ensures seeded liquidity transitions to a persistent maker strategy rather than expiring.

Threshold logic

ConditionAction
handoff bot activeEmit handoff signal on first fill
handoff bot unavailableWARN MCS_HANDOFF_UNAVAILABLE

Developer check

if not handoff_bot_available: log warning; proceed without handoff

User-facing English

The market was seeded and handed off to the configured maker strategy.

8. Default Configuration

{
  "bot_id": "strat.marketcreationscout",
  "version": "0.1.0",
  "mode": "shadow_only",
  "defaults": {
    "min_quality_score": 0.7,
    "seed_size_usd": 200,
    "max_age_minutes": 30,
    "auto_handoff_to": "maker-wide"
  },
  "locked": {
    "min_quality_score": {
      "min": 0.4
    },
    "seed_size_usd": {
      "min": 600
    },
    "max_age_minutes": {
      "min": 120
    }
  }
}

9. Implementation Flow

  1. Check KillSwitch; if active, emit no OrderIntents.
  2. FETCH MarketCreationScout analytics signal from internal engine.
  3. IF signal below hard floor: SKIP, emit sampled DecisionReport MCS_NO_EDGE.
  4. FETCH clob_public market status; skip if closed or resolved.
  5. FETCH ws_market book; compute current mid and available depth.
  6. IF signal < warning threshold: WARN MCS_MARGINAL; reduce size 50%.
  7. Compute order size = min(max_size_param, available_depth).
  8. EMIT IOC OrderIntent with builder code.
  9. EMIT DecisionReport with intent_emitted=true, reason=MCS_TRADE.

10. Reference Implementation

Pseudocode is language-agnostic. FETCH = read input. EMIT = produce output. IF/THEN/ELSE = decision. Translate directly to TypeScript, Python, Go, or Rust.

FUNCTION onSignalUpdate(market_id, signal):
  ks = FETCH internal.killswitch.status
  IF ks.active: RETURN

  // Hard floor gate
  IF signal.score < params.min_quality_score_hard:
    IF random() < 0.01:
      EMIT DecisionReport(intent_emitted=false, reason='MCS_NO_EDGE')
    RETURN

  mkt = FETCH clob_public.GET('/markets/' + market_id)
  IF mkt.closed OR mkt.resolved: RETURN

  // Warning threshold check
  sizeMultiplier = 0.5 IF signal.score < params.min_quality_score_warn ELSE 1.0
  IF sizeMultiplier < 1.0: WARN('MCS_MARGINAL')

  // Book snapshot
  book = FETCH ws_market.book(market_id)
  mid = (book.best_bid + book.best_ask) / 2
  depth = FETCH clob_public.depth(market_id)

  // Size computation
  orderSize = toPusdUnits(min(params.seed_size_usd * sizeMultiplier, depth.available))

  EMIT OrderIntent(market=market_id, outcome='YES', side='buy', price=mid,
                   size_pUSD=orderSize, tif='IOC', builder=internalBuilderCode)
  EMIT DecisionReport(intent_emitted=true, signal_score=signal.score,
                      reason='MCS_TRADE')

SDK calls used

  • ws_market.subscribe('book', [market_id])
  • fetchClobPublic('/markets/' + market_id)
  • internal.analyticsEngine.signal(market_id)
  • buildOrderTypedData(orderParams, {name:'CTFExchange', version:'2', chainId:137})
  • internal.builder_code

Complexity: O(1) per signal update per market

11. Wire Examples

Input — what arrives on the wire

MarketCreationScout analytics signalinternal (analytics engine)

{
  "market_id": "0xmarketcr000000000000000000000000000000000000000000000000000000000001",
  "signal_score": "0.75",
  "received_at_ms": 1746790800000
}

Output — what the bot emits

OrderIntent — MarketCreationScout IOC buy YES

{
  "intent_id": "oi_01HMCS0000001A",
  "market_id": "0xmarketcr000000000000000000000000000000000000000000000000000000000001",
  "outcome": "YES",
  "side": "buy",
  "price": "0.540",
  "size_pUSD": "200.00",
  "tif": "IOC",
  "builder": {
    "code": "0x706f6c7974726164657273000000000000000000000000000000000000000000",
    "fee_bps": 25
  },
  "decision": {
    "signal_score": 0.75,
    "reasons": [
      "MCS_TRADE"
    ]
  }
}

12. Decision Logic

APPROVE

All gates passed, KillSwitch inactive, market open. Emit IOC OrderIntent.

RESHAPE_REQUIRED

Not applicable — reshaping handled by downstream Risk guardrail.

REJECT

Signal below hard floor; stale data; market closed; KillSwitch active.

WARNING_ONLY

Signal in warning zone triggers 50% size reduction.

13. Standard Decision Output

This bot returns a OrderIntent object. See OrderIntent schema.

{
  "intent_id": "oi_01HMCS0000001A",
  "trace_id": "tr_01HMCS000TR001",
  "market_id": "0xmarketcr000000000000000000000000000000000000000000000000000000000001",
  "outcome": "YES",
  "side": "buy",
  "price": "0.540",
  "size_pUSD": "200.00",
  "tif": "IOC",
  "post_only": false,
  "builder": {
    "code": "0x706f6c7974726164657273000000000000000000000000000000000000000000",
    "fee_bps": 25
  },
  "negrisk_aware": false,
  "decision": {
    "signal_score": 0.75,
    "reasons": [
      "MCS_TRADE"
    ]
  },
  "comment": "fees are operator-set at match time in V2 \u2014 feeRateBps is NOT on the signed order"
}

14. Reason Codes

CodeSeverityMeaningActionUser-facing message
MCS_TRADEINFOAll gates passed. IOC OrderIntent emitted for MarketCreationScout.Emit IOC OrderIntent.A MarketCreationScout trade was placed.
MCS_MARGINALWARNEdge is within the warning threshold; size reduced 50%.Emit at 50% size; log warning.A small edge was found; a reduced-size MarketCreationScout trade was placed.
MCS_NO_EDGEINFOEdge below hard floor. Skipping.Skip; emit sampled DecisionReport.The edge was too small to justify a trade.
MCS_QUALITY_BELOW_FLOORINFOQuality score below 0.40 hard floor.Skip; no seed quote.Market quality too low for seeding.
MCS_MARKET_TOO_OLDINFOMarket age exceeds max_age_minutes hard limit.Skip; no seed quote.Market is too established for a scout seed.
MCS_HARD_REJECTHARD_REJECTA critical gate condition blocked the trade (stale data, kill switch, or hard parameter breach).Skip; no OrderIntent.A safety condition blocked the trade.
KILL_SWITCH_ACTIVEHARD_REJECTGlobal kill switch is active.Skip all markets; no OrderIntents emitted.Trading is currently paused.

15. Metrics & Logs

Metrics emitted

MetricTypeUnitLabelsMeaning
polytraders_strat_marketcreationscout_decisions_totalcountercountverdict, reason_codeTotal evaluation cycles by verdict and reason code.
polytraders_strat_marketcreationscout_signal_scorehistogramscoreDistribution of analytics signal scores at evaluation.
polytraders_strat_marketcreationscout_intents_emitted_totalcountercountoutcomeTotal IOC OrderIntents emitted.
polytraders_strat_marketcreationscout_eval_latency_mshistogrammillisecondsLatency from signal receipt to OrderIntent emit.

Alerts

AlertConditionSeverityRunbook
MarketCreationScoutStaleFeedrate(polytraders_strat_marketcreationscout_decisions_total{reason_code='STALE_MARKET_DATA'}[5m]) > 0.1warn#runbook-marketcreationscout-stale
MarketCreationScoutKillSwitchrate(polytraders_strat_marketcreationscout_decisions_total{reason_code='KILL_SWITCH_ACTIVE'}[1m]) > 0page#runbook-killswitch
MarketCreationScoutNoEdgerate(polytraders_strat_marketcreationscout_decisions_total{verdict='skip',reason_code='MCS_NO_EDGE'}[10m]) / rate(polytraders_strat_marketcreationscout_decisions_total[10m]) > 0.95warn#runbook-marketcreationscout-edge

16. Developer Reporting

{
  "bot_id": "strat.marketcreationscout",
  "market_id": "0xmarketcr000000000000000000000000000000000000000000000000000000000001",
  "signal_score": 0.75,
  "intent_emitted": true,
  "reason": "MCS_TRADE",
  "emitted_at_ms": 1746790800000
}

17. Plain-English Reporting

SituationUser-facing explanation
MarketCreationScout trade placedThe MarketCreationScout strategy detected a suitable opportunity and placed a trade.
Edge too small — no tradeThe signal was below the minimum threshold. No trade was placed.
Safety gate active — no tradeA safety condition (stale data, kill switch, or parameter limit) blocked the trade.

18. Failure-Mode Block

main_failure_modeIf the quality model gives a high score to a market that is poorly formed or resolves unexpectedly, the seed capital is exposed to an unintended directional position.
false_positive_riskSignal mis-fires when market conditions change rapidly, producing trades that quickly move against the MarketCreationScout thesis.
false_negative_riskHard floor set too conservatively misses genuine opportunities.
safe_fallbackIf ws_market feed stale or analytics signal unavailable, skip without emitting any OrderIntent.
required_dependenciesws_market, clob_public, internal MarketCreationScout analytics engine, KillSwitch, internal builder code

19. Failure-Injection Recipes

ScenarioHow to injectExpected behaviourRecovery
SIGNAL_UNAVAILABLECut internal analytics engine connectionAutomatic when engine reconnects.
HARD_FLOOR_BREACHInject signal below hard floorAutomatic on next valid signal.
KILL_SWITCH_ONSet killswitch.active=trueAutomatic on manual KillSwitch reset.

20. State & Persistence

Cold-start recovery

On cold start, signals rebuilt from next analytics engine poll.

21. Concurrency & Idempotency

AspectSpecification
Execution modelactor-per-market
Max in-flight25
Idempotency keyintent_id
Per-call timeout (ms)300
Backpressure strategydrop oldest signal per market_id when queue > 2
Locking / mutual exclusionper-market_id mutex for signal state

22. Dependencies

Depends on (must run first)

BotWhyContract
risk.kill_switchChecked first; blocks all intent emission when active.

Emits to (downstream consumers)

External services

ServiceEndpointSLA assumedOn failure
Polymarket CLOB WebSocket (ws_market)best-effort
Internal MarketCreationScout analytics engineinternal SLA

23. Security Surfaces

Abuse vectors considered

  • Signal injection to produce false MarketCreationScout trades
  • Order sizing parameter manipulation to exceed position limits

Mitigations

  • MarketCreationScout analytics signals sourced from authenticated internal engine only
  • Hard limits on position size enforced before OrderIntent emission
  • Builder code injected from secure internal config

24. Polymarket V2 Compatibility

AspectValue
CLOB versionv2
Collateral assetpUSD
EIP-712 Exchange domain version2
Aware of builderCode fieldyes
Aware of negative-risk marketsno
Multi-chain readyno
SDK usedpy-clob-client-v2
Settlement contractCTFExchangeV2
NotesBot not yet implemented; designed against V2 schema (pUSD, builder codes, V2 EIP-712 domain). feeRateBps not present on any signed OrderIntent.

API surfaces declared

clob_publicclob_authws_marketgammainternal

Networks supported

polygon

25. Versioning & Migration

FieldValue
spec2.0.0
implementation0.1.0
schema2
releasedNone
planned_releaseQ3-2026

Migration history

DateFromToReasonAction taken
2026-04-28n/av2-specSpec drafted post-CLOB-V2 cutover; bot not yet implementedDesigned against V2 schema (pUSD, builder codes, V2 EIP-712 domain)

26. Acceptance Tests

Unit Tests

TestSetupExpected result
Emit IOC when signal=0.75 and all gates passstandard configIOC OrderIntent; reason=MCS_TRADE
Skip when signal below hard floorsignal=below_hardNo OrderIntent; sampled reason=MCS_NO_EDGE
Skip when KillSwitch activekillswitch.active=trueNo OrderIntents emitted

Integration Tests

TestExpected result
Full cycle: signal → computation → IOC OrderIntent on Polygon testnetOrder has builder.code, no feeRateBps, EIP-712 domain v2

Property Tests

PropertyRequired behaviour
Bot never emits OrderIntent when KillSwitch is activeAlways true
feeRateBps never present on any signed OrderIntentAlways true

27. Operational Runbook

MarketCreationScout incidents are typically stale analytics feeds or kill-switch activations. Hard-floor skips are normal.

On-call actions

AlertFirst stepDiagnosisMitigationEscalate to
MarketCreationScoutStaleFeed
MarketCreationScoutKillSwitch
MarketCreationScoutNoEdge

Manual overrides

Healthcheck

GET /internal/health/marketcreationscout -> 200 if Analytics engine active; signal age < 60s; KillSwitch inactive.. Red: Analytics engine down or KillSwitch active..

28. Promotion Gates

A bot does not advance to the next readiness state until every gate below is green. Gates are observable from production data — no subjective sign-off.

Promote to Shadow

GateHow measuredThreshold
Unit tests pass including hard-floor skip and kill-switch blockCI test run100% pass

Promote to Limited live

GateHow measuredThreshold
p99 eval latency < 300ms over 24h shadow runpolytraders_strat_marketcreationscout_eval_latency_ms histogramp99 < 300ms

Promote to General live

GateHow measuredThreshold
E2E: signal → computation → IOC OrderIntent on Polygon testnet with builder.code and no feeRateBpsE2E testPass

29. Developer Checklist

Ready-to-ship score: 27/27 sections complete · 100%

RequirementStatus
Purpose defined✓ done
Required inputs listed✓ done
Parameters defined✓ done
Defaults defined✓ done
Warning thresholds defined✓ done
Hard thresholds defined✓ done
Safe fallback defined✓ done
Structured output defined✓ done
Developer log defined✓ done
Plain-English explanation✓ done
Unit tests defined✓ done
Integration tests defined✓ done
Property tests defined✓ done
Failure-mode block complete✓ done
Reference implementation pseudocode✓ done
Wire examples (input + output)✓ done
Reason codes listed✓ done
Metrics & logs defined✓ done
State & persistence defined✓ done
Concurrency & idempotency defined✓ done
Dependencies declared✓ done
Security surfaces declared✓ done
Polymarket V2 compatibility declared✓ done
Version & migration history declared✓ done
Operational runbook defined✓ done
Promotion gates defined✓ done
Failure-injection recipes defined✓ done