SmartRouter
SmartRouter translates an approved strategy intent into a concrete executable order by selecting the appropriate order type (FOK, GTC, or GTD), price,
What it does
SmartRouter translates an approved strategy intent into a concrete executable order by selecting the appropriate order type (FOK, GTC, or GTD), price, and timing. It may split a large order into iceberg child orders to reduce market impact. SmartRouter cannot change the direction of the trade, the target market, or the strategy intent — it is not permitted to flip the side (buy/sell), alter the outcome leg, or override any constraint set by the Risk guardrail pipeline. The only transformations it may make are to price, size scheduling, order type, and submission timing.
Pipeline placement
Applies to: Every approved OrderIntent that has passed the full Risk guardrail pipeline
Why it matters
| If this fails | Consequence |
|---|---|
| Wrong order type applied | A Fill-or-Kill order on a thin book will be rejected by the exchange and the strategy misses the opportunity entirely; a GTC order on a fast-moving market may fill at an outdated price. Worked example Setup: Strategy emits an OrderIntent for 6,000 pUSD on YES at ≤ 0.55 with TIF=GTC. Top of book is 0.54 with 2,200 pUSD depth, second level is 0.56 with 9,000 pUSD. Without bot: A naive router sends the full 6,000 as a market order. It clears the 0.54 ask, walks to 0.56, fills the remaining 3,800 there, and ends up at a 0.553 average — a 30 bps slippage the strategy never modelled. With bot: SmartRouter sees the depth profile, splits into 2,200 at 0.54 IOC + 3,800 as a passive 0.55 GTC, and only crosses the second level if the 0.55 leg ages out. The fill respects the price cap and the strategy's expected edge survives execution. |
| Large order submitted without iceberg splitting | A single large visible order signals intent to other market participants and may be front-run or cause the book to refresh at a worse price before the order fills. |
| Order submitted after signal TTL expires | Executing a GTC or GTD order on a signal that has aged past its validity window means acting on market intelligence that may no longer be accurate. |
| Tick size not respected | An order with a price that does not align to the market's tick size will be rejected by the CLOB, resulting in a failed submission. |
Inputs
Polymarket inputs
| Input | Source | Required | Use |
|---|---|---|---|
| CLOB order book — top 50 levels | CLOB | required | Assess current book depth to decide between FOK and GTC, and to determine whether iceberg splitting is warranted. |
| Market tick size and neg-risk flag | Gamma API | required | Round order price to the correct tick size; apply neg-risk routing rules when the neg-risk flag is set. |
| Recent fill rate and estimated queue position | Data API | optional | Estimate time-to-fill for GTC orders and decide whether to use a more aggressive price to improve queue position. |
Internal inputs
| Input | Source | Required | Use |
|---|---|---|---|
| Approved OrderIntent with all Risk constraints applied | PortfolioGuard | required | Receive the final approved size, maximum price, and any constraint flags (passive_only, close_only) from the guardrail pipeline. |
| KillSwitch active flag | KillSwitch | required | Abort order construction and emit no ExecutionPlan if KillSwitch is active. |
Authority
What this bot is permitted to do
State
Readiness
General live
Status
live
Class
Execution Utility
Default mode
general_live
Developer owner
Polytraders core — Execution pod
Capital impact
Direct
Reason codes emitted
| Code | Severity | Meaning | Action |
|---|---|---|---|
| STALE_MARKET_DATA | HARD_REJECT | Market metadata (tick size) is unavailable, or GTD signal has aged past gtd_signal_ttl_s. | Discard order; emit no ExecutionPlan. |
| SPREAD_TOO_WIDE | WARN | Tick-size rounding shifted price by more than one tick. | Attach warning annotation to ExecutionPlan; do not block. |
| KILL_SWITCH_ACTIVE | HARD_REJECT | Global kill switch is active; no orders may proceed. | Discard order; emit no ExecutionPlan. |
| PARAMETER_CHANGE_REQUIRES_APPROVAL | HARD_REJECT | iceberg_child_count or gtd_signal_ttl_s exceeds the locked hard maximum. | Reject config change; do not apply. |
| NEGRISK_CONVERT_AVAILABLE | EXPLAIN | NegRisk convert-arb route is available for this market; notifies Strategy layer. | Emit NegRiskConvertRoute instead of a CLOB order when negrisk_convert_requested=true. |
| SMART_ROUTER_FOK_DOWNGRADE | RESHAPE | Book depth was insufficient to guarantee a complete FOK fill; order was changed to GTC. | Set order_type=GTC in the ExecutionPlan. |
| SMART_ROUTER_ICEBERG_SPLIT | RESHAPE | Order size exceeded iceberg_threshold_usd; split into child orders. | Set iceberg=true and populate children array. |
| FEE_RATE_CAPPED | WARN | Computed taker fee would exceed 100 bps or maker fee would exceed 50 bps. Fees are operator-set at match time; this warn is for logging only. | Log the fee estimate; do not block the order. |
Related bots in Execution
Used by
Reverse index — strategies that currently reference exec.smartrouter. If you change this bot's authority or reason codes, these strategies must re-pass shadow.
| Strategy | State | Activity |
|---|---|---|
| NBA H2H — moneyline market-make | demo-wired | last triggered 3m ago |
Showing 1 of 1 · demo-wired ≠ production-live
⚙ Configuration — exec.smartrouter
Why this matters
Execution bots does NOT propose new positions; only routes and shapes approved intents. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →