TWAP Calculation
Markets resolve using a 15-minute Time-Weighted Average Price ending at market expiry. Where:- is the price at data point
- is the duration that the price was active
- Window: 15 minutes ending at expiry
| Value | |
|---|---|
| Market | ”Will BTC close above $150,000 on Dec 31, 2025?” |
| Expiry | Dec 31, 2025 23:59:59 UTC |
| TWAP Window | 23:45:00 – 23:59:59 UTC |
Why TWAP?
Single-timestamp prices are manipulable. A 15-minute average requires sustained price movement, making flash loan attacks or brief manipulation ineffective.Multi-Feed Protection
If : → Pause resolution → Alert admins → Manual review Cross-validation prevents single oracle failures.Price Clamping
Maximum 1% price movement per minute during TWAP window. Outliers beyond 3 standard deviations are rejected.Liveness Checks
TWAP window requires a minimum number of oracle updates (approximately 2 per minute = 30 updates for 15-minute window). If insufficient updates:- Check if oracle is down
- If yes: extend window
- If no: mark market invalid
