Skip to content

Oracle

Cube-Root TWAP (cbrtTWAP) — An innovative variant of TWAP oracle that balances arithmetic and geometric means.

Design Trade-off

Traditional TWAP oracles force a trade-off:

ApproachProsCons
ArithmeticCaptures short-term price movesVulnerable to price spikes
GeometricSmooths out volatilitySlow to reflect real-time changes

As highlighted in research by Delphi Digital, choosing between these approaches involves significant trade-offs.

Introduce cbrtTWAP Oracle

Our AMM invents cbrtTWAP. It utilizes cube-root transformation to achieve:

  • Responsive — Captures immediate market changes better than Geometric TWAP
  • Resistant — Harder to manipulate than Arithmetic TWAP
  • Stable — Follows broader trends, not noise.

How It Works

Step 1: Transform Apply cube root to each price observation:

Pt3

Step 2: Average Calculate time-weighted average of transformed prices:

P3t0,t1=cumulativeCbrtPricet1cumulativeCbrtPricet0t1t0

Step 3: Finalize Cube the result to get the final oracle price:

cbrtTWAPt0,t1=(P3t0,t1)3

This final result combines the responsiveness of arithmetic means with the stability of geometric means.

Released under the MIT License.