> For the complete documentation index, see [llms.txt](https://docs.asterdexcorp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.asterdexcorp.com/trading/perpetuals/order-types/twap.md). Agents can also search and read this documentation through its [MCP server](https://docs.asterdexcorp.com/~gitbook/mcp).

# TWAP

### **What are TWAP (Time-Weighted Average Price) orders?**

TWAP (Time-Weighted Average Price) is an algorithmic trade execution strategy that aims to achieve an average execution price close to the time-weighted average price of the user-specified period. A TWAP strategy is often used to minimize a large order’s impact on the market by dispersing the large order into smaller quantities and executing them at regular intervals over time.

TWAP is favored to provide a better execution price in the following scenarios:

* Order size larger than the available liquidity on the order book.
* Anticipation of a high price volatility period with no clear up or downward trend.

### **How to Set Up a TWAP Strategy**

* Go to Aster Perps, open **\[Order Type]**, and select **\[TWAP]**.
* Select your symbol and configure your trade details:
  * **Direction:** Buy or Sell
  * **Trade Size:** The total quantity you want to buy or sell. The strategy will aim to fill up to this target size.
  * **Total Time:** How long the strategy should run. Minimum is 1 minute, maximum is 7 days.
* Click **\[Buy/Long]** or **\[Sell/Short]** to place your order.
* Review your order details and click **\[Confirm]**.

**Note:** If you're new to TWAP, review the guidelines before creating your first strategy.

### **Margin Requirements**

Your Perpetual Account must have sufficient margin for the duration of the strategy. If any sub-order fails a margin check, the entire TWAP strategy will be terminated.

Margin checks work as follows:

* Reduce-only orders are not subject to margin checks.
* **Order Cost** = (Total Order Size × Asset Last Price) ÷ Leverage
* The order proceeds if: **Order Cost < Available for Order**

*Available for Order is the available margin for opening a position.*

### **Viewing and Managing TWAP Orders**

Running strategies are visible in the **Strategy Overview** panel under the **\[Running]** tab. From here you can monitor:

* Average filled price
* Strategy duration and status
* Total order size
* **Filled %** — the current executed amount as a percentage of your target size

To manually stop a running strategy, click **\[Stop]** in the **\[Action]** column.

Transaction details are only shown once all sub-orders are fully filled. For partially completed orders, you can view transaction quantity, average transaction price, and trading fee.

#### Notes

* TWAP supports Multi-Assets Mode.
* A maximum of 30 TWAP strategies can run simultaneously per account.
* TWAP orders do not guarantee execution. Orders are filled on a best-effort basis, subject to market liquidity and volatility. Slippage may occur depending on market conditions.

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.asterdexcorp.com/trading/perpetuals/order-types/twap.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
