defirisk.co
rubric v1.7.0

TWAP window duration

A oracle & external dependencies factor in the v1.7.0 rubric. Measured per protocol on a s cadence.

Methodology how we score#

What this measures
This factor records the TWAP window duration in minutes for each oracle that uses a time-weighted average price. Windows shorter than 30 minutes are flagged as high risk. The value is extracted per oracle via source inspection and on-chain reads.

Why it matters
TWAP window length is the primary determinant of how expensive a price manipulation attack is to execute. A 1-minute TWAP requires the attacker to hold a position for only 60 seconds — achievable with a flash loan sequence across multiple blocks. A 30-minute TWAP requires sustained capital lock-up that makes the attack economically irrational for most targets. The T-01 evidence base links short or nonexistent TWAP windows to approximately 15 protocols in the hack database. The cost-of-attack scales roughly linearly with window length for low-liquidity pools; for high-liquidity pools, window length interacts with pool depth to determine the true manipulation threshold.

Green / Yellow / Red
Green is scored when all TWAP-based oracles use windows of 30 minutes or longer. Yellow is scored when at least one TWAP oracle uses a window between 10 and 29 minutes. Red is scored when any TWAP oracle uses a window under 10 minutes, or when no TWAP is used at all (scored alongside RD-F-053).

Common gray cases
Gray is applied when the TWAP implementation uses dynamic observation selection that cannot be reduced to a fixed window duration, or when the oracle is an aggregated feed whose internal averaging methodology is not publicly documented.

Notable historical examples
No cross-hacked incidents are currently linked in the database for this factor.

Measurement what to look for#

For each DEX-TWAP oracle, measure the TWAP window duration in minutes; flag any window < 30 minutes as high risk.

Data & output #

Data source
Source inspection of `OracleLibrary.consult()` period parameter or equivalent on Etherscan-verified source
Output format
Green / Yellow / Red
Evidence artifact
TWAP window in seconds per oracle + contract address
Confidence signal
green = all TWAP windows ≥30 min; yellow = any TWAP window 10–29 min; red = any TWAP window <10 min; gray = protocol does not use TWAP oracles (N/A) or source unverified

Scored protocols 0 carry this factor#

No protocols have been scored for this factor yet.

Linked hacks no historical incidents linked#

No historical incidents are linked to this factor.
rubric_version v1.7.0factor RD-F-054category 3carried 0critical no