Oracle
Pennysia introduces the Cube-Root TWAP (cbrtTWAP), an innovative variant of time-weighted average price (TWAP) oracle mechanism that strikes an optimal balance between arithmetic and geometric means.
The Challenge
Traditional oracle approaches face trade-offs:
- Arithmetic mean: Captures short-term price fluctuations with high precision but vulnerable to sudden spikes
- Geometric mean: Smooths out noise logarithmically yet doesn't reflect real-time movements accurately
As highlighted in research by Delphi Digital, choosing between these approaches involves significant trade-offs.
Our Solution
By combining both approaches and applying a cube-root transformation, cbrtTWAP produces adaptive, manipulation-resistant price points that are:
- Responsive enough to capture immediate market changes
- Stable enough to follow broader market trends
- Resistant to manipulation attempts
Mathematical Implementation
Step 1: Cube Root Transformation
We apply the cube root transformation to each price observation:
Where
Step 2: Time-Weighted Average of Cube Root Prices
Calculate the time-weighted average of the transformed prices:
This gives us the average cube root price over the interval
Step 3: Final cbrtTWAP Result
Apply the inverse transformation (cubing) to get the final oracle price:
This final result combines the responsiveness of arithmetic means with the stability of geometric means.