TWAP Calculation

Algorithm

TWAP calculation, or Time-Weighted Average Price calculation, is an execution algorithm used to minimize market impact when executing large orders. The algorithm divides a large order into smaller slices and executes them at regular intervals over a specified time period. The goal is to achieve an average execution price close to the time-weighted average price of the asset during that period.