> For the complete documentation index, see [llms.txt](https://predictparity.gitbook.io/predictparity-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://predictparity.gitbook.io/predictparity-docs/advanced-orders/twap.md).

# TWAP

<div><figure><img src="https://2420890551-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXf3Ba1guLoIOPydWEKZF%2Fuploads%2FjHV0M4t4vJhBciIHJDXp%2Fimage.png?alt=media&amp;token=71fc5f59-b0d4-44d7-a1dc-9d897380f65c" alt="" width="348"><figcaption></figcaption></figure> <figure><img src="https://2420890551-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXf3Ba1guLoIOPydWEKZF%2Fuploads%2Fu4W6Ut7l00qYrVjxkN1k%2FScreenshot%202026-07-16%20at%209.27.56%E2%80%AFAM.png?alt=media&amp;token=5d73f608-9b0d-464e-83b7-30e0a9682bfc" alt="" width="352"><figcaption></figcaption></figure></div>

**TWAP** (Time-Weighted Average Price) breaks one large order into a series of **smaller, evenly spaced slices** placed over a time window you choose. Instead of moving the market with a single large trade, you average into (or out of) a position gradually.

Use it to enter or exit a big position with less price impact, and to smooth your average price over a defined period.

### How it works

{% stepper %}
{% step %}

#### Define the order

Choose buy or sell, the total size, and the window - a start time, an end time, and how often to place a slice (the interval).
{% endstep %}

{% step %}

#### Parity builds the schedule

At creation, the total is split evenly across the slices that fit in your window, and the schedule is **locked in**. This fixed plan is exactly what will run - the sizes and timing can't drift mid-way.
{% endstep %}

{% step %}

#### Slices place on schedule

Parity places each slice in turn at its scheduled time until the whole window is worked through. If one slice fails (for example, no liquidity at that moment), the rest of the schedule still continues.
{% endstep %}
{% endstepper %}

### Order options

* **Market or limit slices.** Market slices fill immediately at the going price each interval. Limit slices rest at a price you set and only fill if the market reaches them.
* **Sizing.** Slices are normally sized in shares. For a **market buy**, you can instead specify a total **dollar amount** to spend, split across the slices.

### Optional: start on a price trigger

A TWAP can wait to begin until the price reaches a level you set. Until then it stays idle; once the price crosses, the whole slice schedule starts from that moment.

* A **buy** watches the best ask; a **sell** watches the best bid.
* You choose the direction - start when the price rises to your level, or when it falls to it.

Without a start trigger, a TWAP is purely time-based and begins at your start time.

### Good to know

* **The schedule is fixed once created.** Sizes and timing are frozen at setup so an in-flight order can never rewrite itself. To change the plan, cancel and create a new one.
* **You can cancel between slices.** A cancel is picked up at the next slice boundary; any slice already being placed finishes first.
* **“Complete” means all slices were placed - not necessarily all filled.** Resting limit slices may still be unfilled when the schedule finishes, and fills are reconciled as they arrive.
* **Sell slices aren't size-capped to your position.** A sell TWAP keeps submitting its planned slice sizes even if your position runs out mid-schedule - those extra slices simply fail or fill short. Size your total to the position you actually hold.
* **Resolution cancels it.** If the market resolves partway through, the remaining slices are cancelled automatically.

{% hint style="warning" %}
Because the schedule is locked at creation, a TWAP won't adapt to sudden moves — it works the plan you set. Pick a window and interval that match how quickly you want to be in or out.
{% endhint %}
