← All case studies
07 · LESSONS · SHELVED 2024 · 5 min read

The backtest said yes. The spread said no.

An automated bot for daily binary markets. The backtest printed a clean +18.4%. The paper-trade layer, once it modeled real-world spreads honestly, printed −3.1%. The bot was shelved before a single dollar of live capital cleared settlement. This is a case study in catching a flaw exactly where it was supposed to be caught.

+18.4%backtest P&L
−3.1%paper P&L with realistic spread
21.5%avg spread cost / position
$0live capital lost
01 · CONTEXT

01 · CONTEXT

The venue runs daily up/down binary markets. The thesis was small, consistent edge: trade the ones where a news and sentiment read disagreed with the current order-book implied probability, size conservatively, let the law of large numbers compound the advantage.

The bot was built end to end. A CLOB client over REST and WebSocket. HMAC-signed auth. A full settlement loop that reconciled fills, resolutions, and payouts against the local ledger. A sentiment classifier in the FinBERT family scored a headline feed and produced a per-market signal. Above all of that, a paper-trade gating layer — the component that, in the end, did the single most valuable thing this project ever produced.

02 · WHY

02 · WHY BUILD IT

Daily binary markets are the rare retail-accessible product where a disciplined signal and tight execution can, on paper, beat a noisy crowd. The bar to entry is low. The infrastructure is public. The settlement is unambiguous.

If the edge held, the economics were attractive: small position sizes, many trades, asymmetric cost of being wrong. The entire project was scoped around one question — does the edge survive real execution costs — and the architecture was built to answer it honestly before any capital was committed.

03 · HOW

03 · HOW IT WAS TESTED

The backtest used historical resolution data and assumed fills at mid-price. Over the simulation window it returned +18.4%. That number was never going to be the real number, and it was never treated as one. It was the permission slip to build the paper-trade layer.

The paper-trade layer ran the same strategy against a live order-book feed, but simulated fills at the prices a taker would actually get — not the mid, not the last print, the real bid or ask at the moment the bot would have sent the order. First pass, still using mid-price, paper P&L came in at +14.7%. Second pass, honest spreads, paper P&L inverted to −3.1%. Average spread cost: 21.5% of position size.

P&L COMPARISON · BACKTEST → PAPER BACKTEST P&L ............ +18.4%PAPER P&L (mid-price) ... +14.7%PAPER P&L (real spread) .. −3.1%AVG SPREAD COST ......... 21.5% of positionDECISION ................ shelved before live capital
04 · SYSTEM

04 · THE SYSTEM THAT CAUGHT IT

The paper-trade layer was not an afterthought. It was built before any live-trading code existed, and live-trading code was gated behind it. A position could not be opened with real capital until the paper layer logged a statistically meaningful positive return against honest execution assumptions.

The WebSocket feed mirrored the real book. The fill simulator walked the book the same way a real taker order would. Fees, minimum tick, and partial fills were modeled. The ledger, the settlement loop, and the reconciliation logic were exercised against paper fills for weeks before any of it would have been trusted with money.

When the honest-spread run came in negative, the gate did its job. No override, no one more backtest, no convincing the numbers to behave. The bot was shelved the same week.

A thesis is what you believe about the world. A market is what the world charges you to act on it. — the operator, postmortem notes
05 · WHAT I LEARNED

Liquidity is the strategy.

A backtest run at mid-price is a statement about the signal. It is not a statement about the business. The business is the signal minus the spread, minus the fees, minus every cent the book takes from a taker who needs to act now. On a daily binary market with a 21.5% average spread cost, no retail signal of this class is going to survive. The edge was real. The execution cost was larger than the edge. Those are not two problems — they are one problem, and the spread wins.

The deliverable of this project is not a running bot. It is a paper-trade gating discipline that now gets applied to every strategy idea before a line of live-trading code is written. Zero live capital lost. One durable rule: model the spread first, and if the spread eats the edge, the strategy is finished — not iterated, finished.

06 · STACK
PythonCLOB APIWebSocketsPostgresSentiment classifiercron

Python bot on a CLOB venue, WebSocket book feed, Postgres ledger, sentiment-scored signal, cron-driven execution — gated behind an honest paper-trade layer that decided the outcome.

NEXT CASE STUDY

Bedtime Stories — a sibling-aware story app for two sisters

Read next →

If this maps to a system you need built or fixed — tell me about it.

WhatsApp → Telegram → Email →