DEV Community

ABROWNFOX001
ABROWNFOX001

Posted on

Deep Dive: LeChatonFat’s TWAP-Based Fair Value + Confirmation Pyramiding on Polymarket 15m Markets

Most short-horizon crypto Up/Down bots on Polymarket fall into one of two camps:

  • Late-game convergence farmers (94–99¢)
  • Pure directional gamblers who treat every 15-minute slot as a coin flip

LeChatonFat sits in a different middle ground. It runs a low-latency Chainlink TWAP fair-value model against the live CLOB, then uses confirmation pyramiding to shape risk.

This post focuses on the technical mechanics — especially the TWAP signal layer.

1. Why TWAP Instead of a Single Price Snapshot

Polymarket’s short-duration crypto markets (especially after the recent cutover) settle against a time-weighted average price, not a single last trade or close snapshot.

Using a raw CEX mid or a single oracle print creates systematic label and signal error. LeChatonFat therefore builds its fair value directly from the same oracle family the platform uses for resolution:

Polymarket RTDS → Chainlink TWAP (30s / 60s windows)

The bot streams:

wss://ws-live-data.polymarket.com
Enter fullscreen mode Exit fullscreen mode

via the @twapsocket/fetchrtds package and maintains:

  • A window-open TWAP reference (pinned at the start of each 15m epoch)
  • The live TWAP as it updates throughout the window

The difference between these two values, plus a short momentum term, is mapped into a fair P(Up).

2. Fair Value Construction

At a high level the signal works like this:

twap_ref   ← Chainlink TWAP at slot open
twap_now   ← current RTDS TWAP (30s or 60s)
momentum   ← short-term change in TWAP

fair_p_up  ← transform(twap_now - twap_ref, momentum)
Enter fullscreen mode Exit fullscreen mode

The exact mapping function is kept relatively simple. Fifteen-minute crypto direction is close to a martingale, so the model only needs to produce a small, calibrated deviation from 0.50.

Key engineering constraints:

  • Fair value is recomputed on every TWAP tick
  • Maximum signal age is measured in milliseconds — if the TWAP feed is stale, the window is skipped
  • The bot never fires on a REST-polled fair value against a live WebSocket book (classic stale-signal failure mode)

This design keeps the signal and the book on the same latency plane.

3. Entry Logic: Buy the Underpriced Leg

Once fair_p is available, the bot compares it to the live Up token price on the CLOB.

  • If the book is trading the Up side below fair value → consider buying Up
  • If the book is trading the Down side below fair value → consider buying Down

In practice this often means entering the side that is still trading under ~0.50 rather than chasing the favorite at 0.65–0.70.

Observed sample economics:

  • Dollar-weighted average entry ≈ 0.46
  • Breakeven share win rate ≈ 46%
  • Realized share-weighted win rate ≈ 50%
  • → Roughly +4 percentage points of edge on turnover before incentives

The model does not need to be dramatically better than the market. It only needs a small, consistent edge that can be monetized at high frequency.

4. Confirmation Pyramiding (Risk Shape)

This is the second critical technical piece.

Per 15-minute window the bot runs one directional thesis. It does not average down on a timer.

Instead it uses a confirmation gate:

if short-horizon mark-to-mid moves in favor of the held side
    (or model edge increases)
        → add another taker clip
else
        → stop adding size
Enter fullscreen mode Exit fullscreen mode

Empirical effect from the public sample (windows with ≥3 adds):

Outcome Mean (last − first) buy price
Won +0.032
Lost −0.063

Interpretation:

  • Additional capital flows in when the market is already moving toward the thesis
  • Losing windows are starved of size

This produces a useful asymmetry:

  • Average stake on winning windows ≈ the stake on losing windows
  • Positive skew in the PnL distribution even though the raw window win rate is close to 50%

5. Execution & State Machine

High-level control loop:

for each new 15m slot (BTC / ETH / SOL):
    pin twap_ref at open
    stream live TWAP
    compute fair_p continuously

    if edge(fair_p, book) > threshold:
        place initial taker clip on underpriced leg

    while window still open and thesis valid:
        if confirmation condition met:
            pyramid additional clip
        else:
            freeze size

    hold to resolution → redeem
    collect rebates / volume rewards
    sweep excess balance off the execution wallet
Enter fullscreen mode Exit fullscreen mode

Supporting modules:

Module Responsibility
clock/slotClock 15m epoch sync + slug/conditionId consistency
feeds/twapFeed RTDS Chainlink TWAP stream
signal/fairValueEngine TWAP → fair P(Up)
signal/edgeDetector Net edge after estimated rebates
execution/windowSession Per-window state machine
execution/orderExecutor CLOB taker FOK via @polymarket/clob-client-v2

6. Why This Architecture Is Interesting

  1. Oracle alignment — Fair value is built from the same TWAP family used for settlement.
  2. Latency discipline — Signal and book update on the same plane; stale-signal risk is explicitly managed.
  3. Small edge, high turnover — The system does not require large probability gaps.
  4. Path-dependent sizing — Confirmation pyramiding creates positive skew without needing to predict winners in advance.
  5. Incentive-aware cost model — Taker rebates and volume rewards are treated as first-class inputs to the edge calculation.

Practical Lessons

  • Streaming the official TWAP is more important than most people realize once markets move to TWAP settlement.
  • A 4 pp edge is enough if you can execute cleanly and shape risk correctly.
  • Time-based averaging is usually a silent killer on these markets.
  • Clock/slot consistency and idempotent order submission are non-negotiable at this cadence.

LeChatonFat is a good case study in how to extract a small, durable edge from near-efficient 15-minute binary markets by combining the correct oracle, tight latency, and intelligent risk shaping.

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 #Chainlink #TradingBot #PredictionMarkets #QuantitativeTrading #CryptoBot
Enter fullscreen mode Exit fullscreen mode

Top comments (0)