Time-Weighted Average Prices
Calculate time-weighted average prices using SurgeTwapTask
SurgeTwapTask
TWAP = Σ(price × duration) / Σ(duration)Basic Example
{
surgeTwapTask: {
symbol: "BTC/USD",
timeInterval: "ONE_HOUR"
}
}Parameters
Parameter
Type
Required
Default
Description
Time Intervals
Interval
Duration
Description
Constraints
Use Cases
Examples
30-Minute TWAP for SOL/USD
TWAP with Price Bounds
Multiple TWAP Sources
Error Handling
Error
Cause
Solution
How It Works
Last updated