DEV Community

ABROWNFOX001
ABROWNFOX001

Posted on

CLOB Execution, Clip Sizing, and Intra-Slot Timing

Polymarket: https://polymarket.com/@abrownfox001?tab=activity

GitHub: https://github.com/abrownfox0/abrownfox001-twap60-prediction-trigger-system

Telegram: https://t.me/abrownfox001

src/clob.ts + src/engine.ts have one job: convert a trusted P(up) into a fill near 45–55¢, then get out cheaply if belief dies.

The execution objective

This is not market making.

The objective per slot is:

  1. Buy the chosen side near fair value
  2. Use small clips, not one heroic marketable smash
  3. Stop adding when the book leaves the fair zone
  4. Scratch at almost the same price if the signal decays
  5. Redeem only the tickets that were still trusted at the end

A correct signal at 59¢ is often a worse trade than no signal at 50¢.

Why CLOB v2 is the only legal venue path

The reference engine talks to CLOB v2.

That matters because:

  • V1 paths are dead
  • signing, order types, and cancel semantics are v2-native
  • rate-limit headers and 503 retry behavior live on the current stack
  • collateral is pUSD, not an old assumption from earlier clients

If you are still wrapping an obsolete clob-client, you are debugging a museum.

Minimum execution surface:

  • best bid / best ask
  • top-of-book size
  • place order
  • cancel or replace
  • fill stream
  • rate-limit headers

Books from REST polling are a fallback. Live work should sit on the market websocket.

Fill quality before speed

On a 5-minute 50¢ book, being 200ms faster does not help if you lift 4¢ of thin size.

The engine therefore asks four questions before any order:

1. Is the signal trusted?
2. Is the ask (or bid, for scratches) inside 45–55¢?
3. Is there enough visible size for this clip?
4. Do we still have rate-limit budget?
Enter fullscreen mode Exit fullscreen mode

If any answer is no, the action is wait.

wait is cheaper than a partial fill at 57¢ that you will later pretend was “about 50¢.”

Clip sizing

Observed live clips on this account cluster around $50–175, with per-slot caps in a $200–500 neighborhood.

That is policy, not a law of nature. The useful rules behind it are:

Rule Why
Small first clip Proves fill quality before adding
Hard per-slot cap Stops one 5m idea from becoming the whole book
No size-up after the book leaves 45–55¢ Prevents chasing
No size-up when TWAP is only “kind of fresh” Part 2 gate
No size-up in the last seconds Late entries are usually worse prices and worse scratch options

A simple production function:

base = f(edge, bankroll, cap)
clip = min(base, visible_size * 0.25, remaining_slot_cap)
if clip < min_clip: skip
Enter fullscreen mode Exit fullscreen mode

Taking the whole visible ask is how you become the next person’s worse price.

Order type

For this style I want taker clips, not a resting grid.

Reasons:

  • the fair zone is a condition, not a quote I am obligated to keep
  • a 5m slot is too short to manage a full maker inventory
  • scratch exits need immediate flatten, not “hope my bid gets hit”
  • maker logic invites a different bot and a different risk book

That does not mean marketable-at-any-price.

The order is still price-capped:

  • buy only if ask <= max_entry
  • scratch sell only if bid >= min_exit
  • if the cap is not there, skip

A fill outside the cap is an execution bug, not “the market moved.”

Intra-slot timing

Public samples on this wallet show a consistent clock:

  • buys earlier (median ~47s after open)
  • sells later (median ~226s)
  • some activity near the close, but the core book is not a last-second snipe

That maps to three windows:

0–30s: discovery and starter only

The book is often thin. TWAP has barely moved. open_ref must already be frozen.

Allowed: tiny starter if edge and liquidity are both clean.

Default: wait.

30–150s: main accumulation

This is where most fair 50¢ size exists.

The engine may add clips if:

  • signal still trusted
  • price still in band
  • slot cap not hit

This is also where bad bots overtrade. One accepted thesis does not need five identical taker hits two seconds apart.

150–270s: re-score and cull

Sells belong here.

If P(up) decayed, flatten.

If it held, stop adding and just carry.

270–300s: no new thesis

Too late to start. Too expensive to be wrong. Redeem path only, unless a scratch is still clearly available near entry.

The close bell is for settlement, not for discovering religion.

Rate limits are part of execution

Volume-tiered CLOB limits are not background trivia.

A specialist 5m bot can burn its budget on:

  • repeated cancels
  • tiny requotes
  • polling
  • retry storms after 503s

Then the one scratch it actually needed gets delayed.

Practical budget:

  • prefer websocket events over REST hammering
  • cap cancels per slot
  • backoff on Retry-After
  • never retry an order in a loop without checking whether the first one filled
  • treat Poly-RateLimit-Warning as a reason to stop adding, not as a log line

If the account cannot scratch because it spent the token bucket on junk, the strategy is already broken.

Idempotency

5-minute engines double-fill when they are sloppy.

Every intent needs a key:

intent_id = slot_id + side + clip_index
Enter fullscreen mode Exit fullscreen mode

Rules:

  • one in-flight order per intent_id
  • after a disconnect, query fills before sending the same clip again
  • never “just send it again” because the ack was late
  • record local state from the user channel, not from hope

The most expensive bug in this stack is not a wrong P(up).

It is two clips when you meant one, then no clean scratch path.

Scratch execution

Scratch is a sell of the same market near the entry price.

It should look boring in the tape:

  • avg buy 0.504
  • avg sell 0.503
  • spread ≈ 0

If scratches start leaking 2–4¢, the cull is no longer free and the resolved win-rate story changes.

Scratch checklist:

  • same token id as the entry
  • size <= current position
  • bid still near entry
  • do not scratch into a 3¢ air pocket unless the signal is fully dead and holding to $0 is worse
  • after fill, mark the slot as flat so the engine cannot redeem a position that no longer exists

Scratch is not profit-taking. If you start “scratching” at +8¢, you rebuilt a different strategy.

What a good slot looks like in logs

A clean slot log should read like this:

t=00 slot discovered, open_ref frozen
t=08 twap fresh, P(up) trusted but book thin -> wait
t=41 ask 0.51, clip $72 filled
t=96 still trusted, no add (cap / no extra edge)
t=188 P(up) compressed -> scratch $72 @ 0.506
slot flat
Enter fullscreen mode Exit fullscreen mode

Or:

t=52 clip $90 @ 0.495
t=140 add $60 @ 0.50
t=300 still trusted -> redeem
Enter fullscreen mode Exit fullscreen mode

If your logs cannot explain why a clip existed, the execution layer is improvising.

Handoff to Part 5

Execution can be perfect and the account can still die from ops:

  • stale feed while still sending clips
  • no halt on repeated 503s
  • slot clock drift
  • stacking too many correlated 5m tickets
  • reading the public activity feed wrong and “fixing” a working cull

Part 5 is live risk: halt conditions, scratch/hold policy under stress, and how I read @abrownfox001 activity as an external audit tape.

Not financial advice. Paper or micro-size first.

If you have more questions, please feel free to contact me at any time: https://t.me/abrownfox001

My Polymarket Activity: https://polymarket.com/@abrownfox001?tab=activity

#Polymarket #CLOB #TradingBot #Execution #TWAP #BTC #AlgoTrading #PredictionMarkets
Enter fullscreen mode Exit fullscreen mode

Top comments (0)