A Dealer-Gamma Pipeline That Moved on Zero Trades
Market structure · data pipelines ·
A dealer-gamma pipeline that recomputes option-chain levels every fifteen minutes — and the append-only write that caught it moving levels on a closed market.
Problem
The pipeline recomputes call wall, put wall, and gamma flip off the live option chain and writes a thinkScript study the chart reloads. The first version did exactly one write: compute, overwrite, reload.
It looked correct for weeks. An overwritten file has no history to argue with. The study fires an alert when price crosses the gamma flip — so if the flip is silently re-estimating while price stands still, the alert is firing on its own arithmetic, and none of it is reconstructable after the fact.
Constraints
- The levels feed an alert, so a silent re-estimate is indistinguishable from a real crossing.
- The original design destroyed the only evidence that could have shown the problem.
- Any fix had to run inside the existing fifteen-minute cadence without adding a dependency.
My role
I built the pipeline and the study it writes, and I found the defect. The fix was not a code change so much as an instrumentation decision: the system was already wrong, and the only reason it became visible is that I stopped letting it overwrite its own evidence.
What shipped
- A dealer-gamma pipeline running 33 times a day across seven underlyings at a fifteen-minute cadence.
- A generated thinkScript study the chart reloads in place.
- A per-symbol append-only CSV written alongside the study — the change that made the defect visible.
Outcome
- Gamma flip walked 718.3 → 722.2 with spot pinned at 717.12 — Eight consecutive writes on a closed market: put wall 710 → 700, net GEX 598 → 626 → 611, and not a single share traded. The chain re-fit and the levels moved on their own. Watch the clip and read the transcript
- 33 runs per day across 7 underlyings — The cadence that made the drift frequent enough to catch once there was an append-only record to catch it in. Watch the clip and read the transcript
The fix was one more write
Not a rewrite — an addition. A per-symbol append-only CSV next to the study. The computation did not change at all. What changed is that the system could no longer destroy the record of what it had done, and eight rows later the defect was obvious.
Why this generalises
Any process that overwrites its own output is a process whose failures are unreconstructable by construction. That is worth more than the specific finding: the bug had been running for weeks in a system I looked at daily.
Stack
Python · thinkScript · Option-chain data · CSV