LZLZL/Prediction markets/Engineering
FREEDO IT G · EngineeringRisk control

False halts
and the fabricated zero

2026-08-21 · when "unknown" becomes a number, risk control fires the wrong way

Risk control exists to stop you when the money runs out. But if it treats "cannot read" as "is zero", it will also stop you when the money is fine — and you will believe it worked. Two real misfires, and the one rule behind both: "unknown" must not be wrong in either direction.

1Misfire one: the money was in transit

A real-money line had a rule: stop ordering when wallet cash falls below a floor. About five and a half hours after launch it read $145.41, below the $150 floor, wrote a halt flag and stopped.

Amount
Wallet cash (what risk control saw)$145.41
Already won, mid-redemption$94.8
True net worthabout $240 — half again over the floor

The cause: the floor used a pure cash basis, inherited from a four-hour line where redemption lag does not matter. On five-minute windows the lag (measured at six to eleven minutes) is permanently overhead, so wallet cash systematically understates itself.

⚠ A risk basis cannot be ported across tenors

The same code that is correct on a slow cadence gets punched through by settlement lag on a fast one.

Generalised: any judgement that depends on "the money has arrived" needs one question — "how long does arrival take, and how often do I check?" Check faster than money arrives and you will misjudge, guaranteed.

2Misfire two: unknown rendered as $0

The same error in a display layer. A monitoring panel took a metric with "use it if present, otherwise zero" — so when the read failed, the page displayed a tidy $0.

Page showsCould meanWhat you do
$0it genuinely is zerocorrect response
read failed / endpoint down / field renamedyou act on fabricated data

This one is insidious because $0 looks like a legitimate number. Show "—" or "read failed" and anyone knows to investigate. Show $0 and they treat it as a fact.

3★ The rule: unknown must not be wrong either way

unknown ≠ 0  unknown ≠ fine opposite consequences, both expensive
Treat unknown asConsequenceExample
zerofalse halt: money present, stopped anywayin-flight funds not counted
fineblind running: floor breached, nothing stopsfeed dies, risk control reads a stale value and keeps allowing

The correct treatment is to make unknown a third state, handled separately:

SituationDo
Risk control cannot read the balancepause without writing a permanent flag — wait a cycle, take no irreversible action
Display cannot read a valuerender "—" or "read failed", never 0
Funds in transitmodel them explicitly, not "they will land shortly"
Data going staleadd a staleness alarm: no update for N minutes triggers a warning

The first row deserves expansion: halting comes in reversible and irreversible forms. Pausing a cycle because a read failed is reversible; writing a halt flag that needs manual clearing is not. When information is insufficient, take only reversible actions.

4Related: no staleness alarm means no monitoring

I found this hole in one of my own dashboards: the page had a slot for a staleness warning, styled and positioned — and no code ever wrote to it. Which is to say the page had no staleness alarm at all.

Consequence: if the data source dies quietly, the page keeps displaying the last good numbers and everything looks fine. A monitor that always reads "normal" is more dangerous than no monitor, because it makes you stop asking.

5A self-check

AskFailing answer
What is this variable when the read fails?"defaults to 0"
Does the risk basis include funds in transit?"they should arrive soon"
How long without an update before it alarms?"not set"
Where was this risk rule copied from?"another line" — at what cadence?
Is the halt reversible?do not know = probably not

6Did I fix it

No. That floor basis stayed on the "to decide" list until the line closed. Which means the final fifteen-odd hours of risk control ran on a basis that understates itself.

That is written here not for self-criticism but because it is what a kill file is for: a defect found, recorded, and not fixed — that fact belongs on the page too.

7One line to keep

Risk control's most dangerous failure is not "it did not fire" — it is "it fired for the wrong reason", because then you believe it protected you. And nearly every failure of that kind traces to one sentence: treating "I do not know" as a number.

EvidenceCheck it yourself

False halt measured: a cash reading of $145.41 tripped a $150 floor while $94.8 of won positions were mid-redemption; true net worth about $240.
Redemption lag measured at six to eleven minutes, which on a five-minute cadence permanently understates wallet cash.
Unknown rendered as zero monitoring code written as "use if present, else 0" displays a failed read as $0.
Missing staleness alarm one dashboard contained the DOM and styling for a staleness warning with no code writing to it.
Not fixed the floor basis was never changed before the line closed.
Checked 2026-08. Full context in the autopsy.

NextWhere to go

E · UP/DOWN
Full context for that false halt
G · ENGINEERING
Another "cannot find it" read as "does not exist"
G · ENGINEERING
Eight API traps
G · ENGINEERING
589 shares evaporated
This is an educational and research record. It is not investment advice, promises no returns, and offers no personalised trading recommendations. Rules and API behaviour are per the official documentation; this page states when it was checked and both can change without notice. Prediction markets are restricted or unavailable in some jurisdictions — confirm your own before taking part.