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

# Placing an LWAP Order

How to place Liquidity-Weighted Average Price (LWAP) orders that size execution slices to order book depth.

An LWAP order splits a large order into slices sized by the depth on the order book. A slice fires only when the book has enough depth within your slippage per slice, so slices are larger when the book is deep and wait when it is thin. Slices pause while the mark price is past your max price (buy) or min price (sell), and whatever hasn't filled by the max wait is cancelled. See [Order Types](https://docs.aftermath.finance/perpetuals/architecture/order-types.md).

<figure><img src="https://3284144787-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmeKfXaQnIP3bbI1AdlVX%2Fuploads%2Fgit-blob-b63529c8cccdcd77dd0e2dc8c0b2a716754586fa%2Fperps-lwap-guide.gif?alt=media" alt="Order types guide animating an LWAP buy: slices follow the book depth, pause while the price is above the max price, and resume" width="563"><figcaption><p>How LWAP slices fill</p></figcaption></figure>

1. Open **Pro** in the order form and choose **LWAP**.

<figure><img src="https://3284144787-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmeKfXaQnIP3bbI1AdlVX%2Fuploads%2Fgit-blob-5c5c56234edffc27b02e913f10cb2c28ec81d05f%2Fperps-pro-menu.png?alt=media" alt="Pro menu with LWAP under Advanced, between TWAP and Atomic" width="375"><figcaption><p>LWAP in the Pro menu</p></figcaption></figure>

2. Choose Long or Short and enter the size. An LWAP order must be worth at least $100, or the market's minimum order value if that is higher. Each slice is at least $10, or the market's minimum.
3. Set the order:

**Slippage per slice:** how far past the mark price one slice may fill. A slice fires only once the book has enough depth inside this limit. It starts at your **Max slippage** and can be set from 0.01% to 99.99%.

**Max price** (Long) or **Min price** (Short): the worst average price a slice may fill at, set from the arrival price and fixed once the order is placed. It defaults to twice the slippage per slice and can't be tighter than the slippage per slice. Enter it as a percent or as a price; the button next to the field switches between them. Slices pause while the mark price is past it and resume if the price returns before the max wait ends.

**Max wait:** how long the order may run. Pick 10m, 30m, 1h, or 4h, or type a time in **Custom**, from 5 minutes to 23h 50m. The default is 30 minutes. **Ends by** shows the time the order ends. If the order hasn't filled by then, the rest is cancelled.

**Reduce Only:** the order may only reduce your open position. Take Profit / Stop Loss is not available on LWAP orders.

4. Read the preview below the form:

**Arrival price:** the mark price when you place the order. Your max or min price is measured from it.

**Max price** or **Min price:** the price no slice fills past.

**Impact per slice:** the price impact and average price of one slice at the current depth.

**Impact all at once:** the price impact and average price if the whole order filled now.

**Order value** and **Margin required:** estimates at the current price.

**Gas deposit:** SUI that pays the executor's gas for each slice. You pay only for the gas used. The rest returns to your wallet as the order runs and when it ends.

**Fees:** the taker fees for the order.

<figure><img src="https://3284144787-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmeKfXaQnIP3bbI1AdlVX%2Fuploads%2Fgit-blob-1ce4c19dfdd878211aff3ab1d987c5e73f0695b4%2Fperps-lwap-form.png?alt=media" alt="LWAP order form with a size entered, Slippage per slice, Max price, Max wait, and the preview rows" width="375"><figcaption><p>An LWAP order</p></figcaption></figure>

<figure><img src="https://3284144787-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmeKfXaQnIP3bbI1AdlVX%2Fuploads%2Fgit-blob-69024d32b39e9a3a430917bd5b72cd2a9b48792f%2Fperps-lwap-placing.gif?alt=media" alt="Choosing LWAP in the Pro menu, entering 0.5 BTC, and the preview filling in" width="375"><figcaption><p>Setting up an LWAP order</p></figcaption></figure>

The form warns you when:

* Filled at once, the order would move the price near your max or min price (75% or more of the way to it). Slices may pause. Raise the max price (or lower the min price), or lower the size.
* Filled at once, the order would move the price past your max or min price. Slices pause until the book refills.
* The order may not fill within the max wait at the current depth.
* The book can't fill a minimum slice inside your slippage right now. Slices start as it refills.

5. Click **Start LWAP buy** or **Start LWAP sell**. If you turned on **Placing orders** under Settings, **Trading**, **Confirmations**, **Check your order** opens first. If the price moves more than 0.25% from the arrival price before the order is created (or past your max or min price, if that is closer), the order is not placed and the button offers **Resubmit at** the current price.

## Split with LWAP

When a **Market** order's estimated slippage is above your max slippage, the form shows **Split with LWAP**, as long as you could otherwise place the order and it is at least the LWAP minimum. Click it to switch the form to LWAP with the same size.

## Manage your LWAP orders

Running and finished LWAP orders appear in the **LWAP Orders** tab below the chart. Its columns are **Market**, **Filled / size**, **Average price**, **Max/Min price**, **Status**, **Window**, **Gas used**, and **Actions**. The statuses include:

* **Active:** running and ready to fill.
* **Executing:** a slice is running.
* **Waiting for liquidity:** the book can't fill a minimum slice inside your slippage. Slices resume as it refills.
* **Paused: above max price** or **Paused: below min price:** the mark price is past your max or min price. Slices resume if it returns before the window ends.
* **Waiting for price:** no usable mark price right now.
* **Retrying:** the last slice failed. It retries until the window ends.
* **Filled**, **Window ended**, **Cancelled**, or **Failed:** the order has ended. **Window ended** means the max wait ran out and the rest was cancelled.

Click **Cancel** to cancel the unfilled part. Unused gas returns to your wallet. See [Maintaining your Positions](https://docs.aftermath.finance/perpetuals/tutorials/maintaining-your-positions.md#lwap-orders).

In the **Order History** tab, an LWAP order shows as **LWAP Created**, **LWAP Slice**, **LWAP Completed**, **LWAP Cancelled**, and **LWAP Closed** events. Each slice's fill shows as a regular fill.
