I’ve been building a pricing engine for a short-lived derivative: a two-sided token pair that lives for ~90 minutes while a live football match is played, and has to settle at the end against a deterministic index. The quote is produced off-chain at 10 FPS and pushed to an AMM through a signed oracle. Think of it as a 90-minute option whose underlying is “how the match is going”.
The design requirement sounds trivial: in the last ~10% of the match, the visible price has to converge to the settlement value, so that what you see when you close is roughly what you get paid. North-star metric: divergence under 0.5 cents at full time.
Here’s how that one requirement produced three bugs, each one hidden by the previous one.
Bug 1: the test proved something the engine never ran
The spec described convergence as an accumulative pull:
decayFactor = (t - t_activation) / (T - t_activation) tau = (implied - P) * decayFactor * 0.5 P <- P + tau # every tick
Iterate that and you reach implied .…