# TWAP

## What is TWAP?

TWAP (Time-Weighted Average Price) is an order execution strategy that breaks a large order into smaller trades, executed at regular intervals over a set duration.

Instead of placing one large order that may impact price, TWAP helps smooth execution, reducing slippage and market impact.

<figure><img src="https://2411127357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdcvFMzmHg21Aj43MEdWm%2Fuploads%2FfABk8taz3rYtFCy6Dvip%2FScreenshot%202026-02-23%20at%204.04.30%E2%80%AFAM.png?alt=media&#x26;token=f09b0113-7713-4f76-bce1-9b448762ea80" alt="" width="354"><figcaption></figcaption></figure>

### How TWAP works

The TWAP order specifications can be split into 4 distinct components:

1. Order Size – The user specifies the total amount to buy/sell.
2. Duration – The time over which the order will be executed.
3. Intervals – The order is split into smaller chunks, executed evenly at each interval.
4. Execution – Orders are placed automatically until the total size is filled.

To understand: Buying **50 BTC** over **1 hour** with **12 intervals** intends that the system will execute **\~4.167 BTC** every **5 minutes**.

***

### Randomize mode

When Randomize mode is enabled:

* The system slightly varies the size and/or timing of each order.
* This makes execution less predictable and harder to track.
* Helps mitigate predatory algorithms or bots attempting to anticipate TWAP orders.

To understand: Instead of executing exactly **\~4.167 BTC** every **5 minutes**, the system may execute 3.5 BTC, then 5.1 BTC, with timing offsets of a few seconds.

***

### Reduce-Only Mode

When Reduce-Only mode is enabled:

* The TWAP will only reduce your current position.
* It prevents the strategy from flipping your position (e.g. closing a long and accidentally opening a short).

This ensures TWAP is used strictly for scaling out, not scaling in.
