DEV Community

ABROWNFOX001
ABROWNFOX001

Posted on

Live Risk, Halt Conditions, and Reading the Public Tape

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

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

Telegram: https://t.me/abrownfox001

A 5-minute directional engine does not usually die from one bad BTC call. It dies from staying on while the assumptions are false.

The live risk model

There are only four ways this book loses material money:

  1. Wrong target — scoring snapshot/CEX while the venue settles TWAP
  2. Stale confidence — trading a disconnected or delayed oracle
  3. Bad fills — paying 57–62¢ for a 50¢ idea, or scratching into air
  4. No cull — holding every ticket to $0 / $1

Everything else is decoration.

So the risk system is not a giant VaR dashboard. It is a set of hard gates that can force one of three states:

  • NORMAL
  • NO_NEW_ENTRIES
  • HALT

HALT means no buys, no “one last clip,” no exceptions for a pretty P(up).

Halt conditions

These are the conditions I treat as non-negotiable.

Feed / clock

  • TWAP age above the freshness cap
  • RTDS reconnect without a new stamped update
  • open_ref missing or captured late from a proxy
  • local clock vs slot boundary disagreement
  • out-of-order TWAP timestamps after resume

Execution

  • repeated 503s / Retry-After loops
  • rate-limit warnings while a scratch is still needed
  • unacked order plus a retry impulse
  • fill inventory that does not match local intent
  • ask already outside 45–55¢ and the engine still wants to “get in”

Book / strategy drift

  • too many concurrent BTC 5m tickets relative to cap
  • scratch slippage starting to exceed the “≈ 0 spread” regime
  • a cluster of late-slot chase entries
  • sudden shift toward 90¢+ tickets
  • any path that starts using CLOB mid as settlement truth

If two of these fire in the same slot, do not debug while live. Flatten what can be flattened cleanly, then stop.

Scratch policy under stress

In normal conditions, scratch is simple:

  • belief decayed
  • bid still near entry
  • flatten
  • mark slot flat

Under stress, that rule needs a second question:

Is a dirty scratch better than holding an untrusted ticket to resolution?

Use this matrix:

Signal Feed Book near entry Action
Decayed Fresh Yes Scratch
Decayed Fresh No Scratch only if $0 risk dominates the air pocket
Trusted Fresh Yes Hold / no add
Trusted Stale Yes NO_NEW_ENTRIES; do not add; do not panic-scratch
Any Dead No HALT
Untrusted Any Any No adds; flatten only if position was already low-conviction

The failure mode to avoid is panic flattening on a stale feed.

If you no longer know the official TWAP, you do not magically know that the position is wrong. You know that you are blind. Blindness is a halt, not a marketable sell into a 4¢ hole.

Position and slot caps

This engine is a specialist. That makes correlation obvious: every ticket is short-horizon BTC.

Caps I want visible in config, not in someone’s head:

  • max clip
  • max size per slot
  • max simultaneous live slots
  • max daily realized loss before HALT
  • max consecutive scratched slots before reducing size
  • max consecutive unresolved errors before HALT

A “small clip” strategy still blows up if it takes the small clip on every slot without a breaker.

Five-minute markets create the illusion of isolation. They are not isolated. They are the same BTC process sliced every 300 seconds.

What the public tape should look like

Anyone can audit @abrownfox001 without the private weights.

Useful checks:

curl "https://gamma-api.polymarket.com/public-profile?address=0x12b712029efeee7efc4066e98e4e1b6beb8b1b0b"
curl "https://data-api.polymarket.com/trades?user=0x12b712029efeee7efc4066e98e4e1b6beb8b1b0b&limit=1000"
Enter fullscreen mode Exit fullscreen mode

I read the tape for shape, not for one-day P&L.

Healthy shape:

  • BTC 5m is the core
  • most entries still in 45–55¢
  • more buys than sells, but sells exist
  • sells later than buys
  • many same-market round trips near zero spread
  • clip sizes stay in a boring band
  • no sudden conversion into 99¢ farming

Unhealthy shape:

  • entries walking up to 60–70¢
  • almost no sells
  • all size dumped in the last 20 seconds
  • random non-BTC spray becoming the book
  • one slot absorbing a huge multiple of normal clip size
  • scratches leaking several cents as a habit

The public feed is the external test of Parts 1–4. If the tape changes, the code changed or the gates were bypassed.

How I use activity as an ops dashboard

The activity tab is not marketing. It is a delayed flight recorder.

After a session I want to answer:

  1. Did we only trade slots where TWAP was trusted?
  2. Did we pay fair value or did we chase?
  3. Did scratches remain near breakeven?
  4. Did any slot get more than one intent because of a retry?
  5. Did halt rules actually fire, or did we only write them down?

If question 5 is “we have halt rules, but the bot kept sending,” the risk layer is fake.

A risk rule that cannot stop src/clob.ts is a comment.

Logging that makes halt decisions possible

You cannot operate this system from P&L alone.

Every slot should persist:

slot_id
open_ref
twap_age_ms
p_up
trusted
action
price
clip
reason
inventory_after
rate_limit_remaining
Enter fullscreen mode Exit fullscreen mode

reason is the most important field.

BUY with reason edge is fine.

BUY with reason unknown is an incident.

SELL with reason stale_panic is also an incident.

The log is how you distinguish:

  • a bad BTC call
  • a feed outage
  • an execution double-send
  • a policy violation

Those four need different fixes. They look the same on a simple win/loss count.

What this series was for

The private layer is the calibrated short-horizon mapping from TWAP state to P(up).

The public layer, which is enough to build against, is:

  1. Settle on official TWAP, not a last tick
  2. Treat stale data as a halt, not as an old input
  3. Keep P(up) a probability of the settlement indicator
  4. Buy only near 50¢, in clips, with a slot cap
  5. Scratch lost belief; redeem only the filtered book
  6. Let the public tape confirm that the live process still matches the design

If those six stay true, the account remains a specialist directional engine.

If they drift, it becomes just another noisy 5-minute BTC bot with extra steps.

Not financial advice. Paper or micro-size first. Rules, feeds, and venue defaults can move again.

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 #TradingBot #RiskManagement #TWAP #BTC #AlgoTrading #PredictionMarkets #QuantTrading
Enter fullscreen mode Exit fullscreen mode

Top comments (0)