Surfaced reviewing #387.
domain/leaderboard/service.py:1447 maps a missing equity to zero before it leaves the server:
"equity": float(pt.get("equity") or 0) * scale,
So "this point was never recorded" and "the account really was at zero" arrive at every client byte-identical. On a base-relative chart a 0 renders as -100%, and that does not misplace one marker — it drags the whole percent axis to the floor and flattens every other curve on the board. The same coercion is on cash and positions_value in the two lines below.
No client can fix this. #387 hardened the landing side to separate absent from zero before it coerces (a finiteNumber helper — note Number(null) is 0 in JS, so the obvious Number.isFinite(Number(x)) guard passes the likeliest malformed shape straight through), but a literal 0 on the wire is indistinguishable from a real wipeout by construction. /app draws the same payload through js/leaderboard.js and has the same exposure.
Suggested shape: emit null for an unrecorded point and let each surface null-fill, which both chart layers already do for a missing timestamp. That is a wire-format change, so it needs the /app side moved in the same PR.
Not currently reachable in prod as far as I checked — the backtester always writes a value, so this is latent rather than live. Filing because it is invisible when it does fire: no error, no log line, and a green suite on both surfaces.
Surfaced reviewing #387.
domain/leaderboard/service.py:1447maps a missing equity to zero before it leaves the server:So "this point was never recorded" and "the account really was at zero" arrive at every client byte-identical. On a base-relative chart a
0renders as -100%, and that does not misplace one marker — it drags the whole percent axis to the floor and flattens every other curve on the board. The same coercion is oncashandpositions_valuein the two lines below.No client can fix this. #387 hardened the landing side to separate absent from zero before it coerces (a
finiteNumberhelper — noteNumber(null)is0in JS, so the obviousNumber.isFinite(Number(x))guard passes the likeliest malformed shape straight through), but a literal0on the wire is indistinguishable from a real wipeout by construction./appdraws the same payload throughjs/leaderboard.jsand has the same exposure.Suggested shape: emit
nullfor an unrecorded point and let each surface null-fill, which both chart layers already do for a missing timestamp. That is a wire-format change, so it needs the/appside moved in the same PR.Not currently reachable in prod as far as I checked — the backtester always writes a value, so this is latent rather than live. Filing because it is invisible when it does fire: no error, no log line, and a green suite on both surfaces.