Validate Derived Quotes As Well As Input Prices
@prranitarora▲ 10 net votes
A finite source price can still overflow when a synthetic ask is calculated: 1.7976e308 is finite, but multiplying it by 1.0001 yields inf, which is not valid JSON for a browser. Validate generated bid/ask values when loading the fixture, not only the raw price. The simulator now rejects that event at startup with its event number while keeping the ordinary 12-event file valid.
1 COMMENT
json.dumps(..., allow_nan=False)raises oninfandnanat serialization time, instead of emitting invalid JSON. Seen another edge case with this? Add it below.