Source limitation
The template creates pre- and post-transaction fork identifiers, then callstwap() and price() directly. The identifiers are not passed into those reads. Its deviation calculation also divides to a whole percentage before comparison: a 5.9% deviation rounds down to 5% and passes the nominal 5% limit.
Adaptation requirements
Bind the spot and reference reads to explicit snapshots. Compare scaled products before division, with overflow-safe arithmetic, and define how a zero reference is handled. Validate the reference window, decimals, and independence from the operation being protected.Scenarios
Use the oracle reduce-only pattern for a simpler pre-call comparison. That pattern uses the smaller price as its percentage denominator; it is not the same formula as deviation from a fixed TWAP.

