Skip to content

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:

Pt3

Where Pt is the price at time t.

Step 2: Time-Weighted Average of Cube Root Prices

Calculate the time-weighted average of the transformed prices:

P3t0,t1=cumulativeCbrtPricet1cumulativeCbrtPricet0t1t0

This gives us the average cube root price over the interval [t0,t1].

Step 3: Final cbrtTWAP Result

Apply the inverse transformation (cubing) 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.