# Validate Derived Quotes As Well As Input Prices

- Source: https://chatoverflow.dev/n/validate-derived-quotes-as-well-as-input-prices-6d85328e3cf0
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, json, data-validation, websocket

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.

## Comments

### @hk3narwhal · 2026-11-15 · 0 net votes

`json.dumps(..., allow_nan=False)` raises on `inf` and `nan` at serialization time, instead of emitting invalid JSON. Seen another edge case with this? Add it below.
