DEV Community

ABROWNFOX001
ABROWNFOX001

Posted on

The Private Signal Stack

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

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

Part 2 pinned the target: 60-second Chainlink TWAP versus slot-open reference.

Part 3 is how that path becomes a tradeable P(up) — and why the exact model stays closed.

Live profile: @abrownfox001

1. What the Signal Has to Output

Not a color.

Not “BTC looks strong.”

A calibrated probability:

P(up)_t  ∈  (0, 1)
Enter fullscreen mode Exit fullscreen mode

If P(up) = 0.57 does not mean “about 57% chance the official TWAP path beats open,” the rest of the engine is decoration.

The public repo exposes the hook in src/signal.ts.

The live weights do not ship.

2. The Structure That Is Public

[
P(up)t = f(\text{TWAP path vs } twap{open},\ \text{lead-lag},\ \text{flow},\ t_{left})
]

Four families of inputs:

Family Role Allowed to dominate?
Official TWAP path vs open Primary direction Yes
CEX mid lead-lag Timing context No
Flow / book Confirmation No
Time remaining in slot Calibration Must be explicit

CEX can move first. It cannot replace settlement.

That is the whole point of cexFeed.ts being labeled auxiliary.

3. Why Time-in-Slot Is a Feature

A 52% read at t=20s is not the same object as a 52% read at t=280s.

Early in the slot:

  • more path uncertainty remains
  • the official 60s average can still be pulled
  • a small CEX lead can matter

Late in the slot:

  • more of the TWAP path is already realized
  • spike-chasing gets more expensive
  • the same raw 52% should not trigger the same size

If t_left is missing from the model, you are treating a 5-minute market like a single timeless coin flip.

4. Calibration Beats Excitement

The live engine is built around a thresholded probability, not raw model twitch.

Typical gate:

if abs(P(up) - 0.5) < edge_threshold:
    wait
if ask not in 45–55¢:
    wait
else:
    accumulate small clip
Enter fullscreen mode Exit fullscreen mode

Two failures look the same on a PnL chart:

  1. Uncalibrated model that says 0.62 when true odds are 0.51
  2. Calibrated model that then pays 55¢ for a 50¢ thought

The signal stack has to survive both.

5. What Changed After TWAP60

When 5-minute markets moved from 30s TWAP to 60s TWAP:

  • the target series got smoother
  • short spike features lost power
  • lead-lag still exists, but it has to be discounted harder
  • labels trained on snapshot close or 30s TWAP became contaminated
  • any “last 8 seconds” feature set needed a rewrite

The prediction trigger is not “price moved.”

It is “the official average path now implies a tradeable probability.”

6. Reference Implementation vs Live Read

Layer Public Private
TWAP ingest twapFeed.ts freshness / production wiring
Feature family documented above exact transforms
P(up) interface signal.ts calibrated weights
Threshold schedule concept live values
Lead-lag feed cexFeed.ts how much it can move P(up)

This split is intentional.

Publishing the architecture lets someone rebuild the shell.

Publishing the live read would compete the only scarce part.

7. Failure Modes in the Signal Layer

  • Letting CEX mid dominate P(up)
  • Training on Binance close labels
  • Mixing 30s features with 60s settlement
  • Using raw model output with no threshold
  • Treating socket heartbeat as proof the TWAP is fresh
  • One static 52% gate from second 1 to second 299

If this layer is wrong, staggered entries and scratches just lose money more neatly.

8. How I Keep the Live Model Honest

Process, not slogans:

  1. Labels come from official TWAP / gamma resolution, not CEX last
  2. Open pin and live score use the same 60s series
  3. Shadow the model against resolved slots before changing thresholds
  4. Log twap_open, twap_now, P(up), t_left, and fill price on every decision
  5. Refuse the slot if the official series is stale

Without those logs, you cannot tell signal decay from execution decay.

9. What Part 4 Covers

Once P(up) exists, the mechanical problems start:

  • when to enter
  • how not to lift a thin book
  • how often to re-score
  • when to scratch
  • when to let a ticket reach $1

That is the slot lifecycle.

Links

Not financial advice. The public shell is not a replica of the live calibrated read.

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

Top comments (0)