DEV Community

ABROWNFOX001
ABROWNFOX001

Posted on

Enter Fair, Scratch Weak, Redeem Strong

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

YouTube walkthrough: https://www.youtube.com/watch?v=XzhugRL6BV4

Part 2 produced a TWAP60-aligned P(up).

This post is the execution layer. A correct probability is useless if you overpay, overhold, or never cut a decaying ticket.

Live profile: @abrownfox001

1. The State Machine

Every active btc-updown-5m-* market runs one lifecycle:

SlotOpen
  → Wait for edge
  → Accumulate in 45–55¢
  → Re-score every 10–30s
       ├─ conviction decayed → Scratch ~breakeven
       └─ conviction intact  → Hold
            → Redeem winner at $1
Enter fullscreen mode Exit fullscreen mode

This is directional micro-forecasting + risk culling.

Not market making. Not 99¢ farming.

The public shell for this loop lives in src/engine.ts and src/clob.ts.

2. Entry Rules

The engine buys only when both conditions are true:

  1. |P(up) − 0.5| clears the edge threshold
  2. The ask sits in the fair 45–55¢ band

Observed pattern from the README / public sample:

Item Value
Typical clip ~$50–175
Per-slot cap roughly $200–500
Average held entry ~0.503
Median buy time ~47 seconds after open
Fills in 45–55¢ ~90.6%

Why not t=0?

Early books are often thin. Paying 53–55¢ for a ~50¢ fair value deletes the edge before the thesis starts.

Why stagger?

Entries are spread through the first half of the slot so the bot sources liquidity near 50¢ instead of lifting the whole offer.

3. The Re-Score Loop

After entry, the position is not “set and forget.”

Every 10–30 seconds the engine recomputes:

  • latest 60s TWAP vs open reference
  • updated P(up)
  • time remaining
  • whether the original thesis is still alive

That loop is the difference between an engine and a hope-and-hold script.

Under TWAP60 the path is smoother than a last-tick series. Re-scoring still matters. The thresholds just need to be retuned for the slower official average.

4. Scratch Exits Are the Second Edge

Most directional bots are only entry engines.

This system treats scratching as a first-class component.

Public footprint:

  • Buy/sell mix about 72.9% / 27.1%
  • ~930 markets with buy and sell at almost the same price
  • Average scratch path: buy ~0.504 → sell ~0.503

Those sells are not profit-taking. They are conviction culls.

if signal decayed:
    taker sell back to flat
    recycle capital into the next live read
else:
    keep holding
Enter fullscreen mode Exit fullscreen mode

Why this matters:

  • A raw 55–58% signal still bleeds if every weak loser is held to $0
  • Filtering can lift the resolved book toward ~60.7%
  • Capital turnover stays high on a 5-minute clock

After the 30s → 60s move, old scratch thresholds can become too twitchy. Re-estimate them on post-cutover data.

5. Timing Inside the Slot

Observed BTC 5m activity by seconds after open:

Bucket Share
0–5s 6.3%
5–30s 16.6%
30–150s 35.7%
150–270s 26.1%
270–300s 15.3%

Interpretation:

  • Buys skew earlier — accumulate near fair value
  • Sells skew later (median ~226s) — cut decaying tickets as the slot matures

That is exactly what a re-score + scratch design should look like in public fills.

6. Hold-to-Resolution Path

Only tickets that keep clearing conviction stay open.

If the slot resolves in favor of the held side:

  • redeem at $1
  • that is where the main PnL is realized

The system does not depend on fancy mid-slot scalp math. PnL comes from:

  • fair entries
  • fewer full losers
  • winners that reach redemption

7. Execution Constraints That Actually Matter

At ~50¢, fees are not the main enemy. These are:

  1. Fill quality — do not pay 3¢ extra just to be first
  2. Latency — a slow loop buys the move after it is priced in
  3. Book depth — “breakeven scratch” requires liquidity near 50¢
  4. Idempotent orders — no double-sends when the socket blips
  5. Per-slot caps — one hot slot should not consume the whole book

The public TypeScript shell implements discovery, CLOB routing, and the state machine. The live calibrated trigger remains private.

8. Code Map for This Layer

Module Role in the lifecycle
markets.ts Find the active BTC 5m slot
engine.ts enter → hold → scratch → redeem
clob.ts CLOB v2 orders
signal.ts updated P(up) for each re-score
config.ts size, thresholds, dry-run switches

Windows path: Abrownfox001.exe

Developer path: npm start (dry-run by default)

9. Common Implementation Mistakes

  • Entering immediately at slot open
  • Using one giant clip instead of staggered size
  • Holding every fill to resolution
  • Scratching too fast on a smoother 60s TWAP path
  • Scratching too slow after the thesis is already dead
  • Treating sell-side volume as “the strategy failed” instead of “the filter worked”

10. What Part 4 Covers

Architecture is not the same as results.

Part 4 covers:

  • public sample numbers and what they do / do not prove
  • risks after the TWAP60 cutover
  • why the signal stays closed
  • how to verify the live wallet independently

Links

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

Top comments (0)