Advanced TWAP
Advanced TWAP splits a size into slices on a schedule you set, as often as every 5 seconds, rests each slice on the book in the style you pick, and takes at market only when it falls behind. It runs in your browser.
On this page: How it works
Advanced TWAP runs in your browser, in Mirrorlane, and the exchange sees only the ordinary orders it places. It keeps going while any Mirrorlane tab is open on this device, and picks up again when you reopen Mirrorlane here. For a TWAP that runs on the exchange with Mirrorlane closed, use TWAP.
How it works
Section titled “How it works”The run is cut into slices: the running time divided by Slice every, plus one. Each slice is an equal share of the size. With Randomize on, slice sizes vary by up to 30% and the gaps between them by up to 40%, balanced so they still add up to your size over the same time. Slices smaller than the market’s minimum order are gathered until there is enough for one.
Selling 2 ETH over 30 minutes with a slice every 10 seconds makes 1,800 ÷ 10 + 1 = 181 slices of about 0.011 ETH.
At each slice the run keeps one limit order resting and adds the slice to it. The style sets its price:
- Passive rests at the best price on your side: the best bid for a buy, the best ask for a sell.
- Neutral rests at the mid.
- Aggressive, the default, rests one tick inside the best price on the other side.
It never falls more than a set share of the size behind schedule: 10% for Passive, 5% for Neutral, 1% for Aggressive. Past that, the excess goes at once as a market order, no further than 3% past the style’s price and never past your price limits. At the end of the running time, whatever is left goes at market within the same limits.
A slice with no live price, or with Past index set no index price, counts as not placed, as does any part of a market order that doesn’t fill; the run goes on. Orders it rests expire 1 hour after they are placed.
Settings
Section titled “Settings”| Setting | What it does |
|---|---|
| Size | The total to buy or sell. It must be at least the market’s minimum order. |
| Duration | 15 min, 30 min, 1 hour or 4 hours, or type Minutes. 1 hour by default. At least 5 minutes, or 1 minute with Randomize. |
| Slice every | 5 to 3,600 seconds, and no longer than the running time. 5 seconds by default. |
| Execution style | Passive, Neutral or Aggressive. Aggressive by default. |
| Max price or Min price | Optional. A buy never pays above Max price; a sell never takes below Min price. |
| Past index | Optional, 0% to 5%. No slice goes further than this past the index price. |
| Randomize | Off by default. |
| Reduce only | Off by default. Orders only make your position smaller; the run ends when nothing is left to reduce. |
Before you start
Section titled “Before you start”- Remember me, in Settings, Security, must be on, so strategies pick up after a reload. With a key already in use, refresh this device’s key after turning it on. See Your trading key.
- Advanced order types, in Settings, Trading, shows Advanced TWAP in the Advanced menu. It is on by default.
- Up to 10 strategies run at once on one account, Chase Limit and Iceberg included.
- Plus or Premium. On a Standard account, trading here is paused. See Account types.
Each slice is an ordinary limit or market order and pays that order’s fee. The Fees row prices the whole size at the taker rate before you start. See The fee.
When it stops
Section titled “When it stops”- You close the last Mirrorlane tab. Its resting order stays on the book until it fills or expires, within the hour. Reopen Mirrorlane here and the run resumes on its original schedule: what came due more than 5 minutes earlier, or one slice gap if that is longer, counts as not placed, and the rest goes into the next order.
- The connection to the exchange drops. Every running strategy stops (Aborted: Disconnected) and cancels its order. It doesn’t restart on its own.
- You sign out, or revoke this device’s key. Strategies stop and cancel their orders first.
- An order’s outcome is unknown. If the exchange doesn’t answer, the run places nothing while it looks for that order, up to two minutes (Waiting for an order to confirm). Found, it carries on. Never found, it stops, and the order is watched until it would have expired: cancelled if it rests, its fills counted. Nothing is sent twice.
What can go wrong
Section titled “What can go wrong”- The price runs past your limit, or the book is thin. Nothing fills past Max price or Min price, and a market order takes only what the book offers within 3%, so part of the size can end not placed.
- An order is refused. That slice counts as not placed and the run goes on, with the reason under its status.
- You cancel its order by hand. The next slice places a new one. To end the run, stop it.
- Several strategies run at once. They share one request budget, and the terminal paces orders to stay inside the exchange’s limits, so a slice can wait or count as not placed.
- It finds two working orders after reopening. It cancels both and stops.
- An older tab holds the strategies. After a release, close older Mirrorlane tabs and refresh, or a new run won’t start.
Follow or stop it
Section titled “Follow or stop it”The Strategies tab, beside Open orders, shows each run: how much has filled and how much was not placed, the average price, the share filled as a maker, its status and the seconds to the next slice. Stop ends it: what has filled stays filled, its order is cancelled and no more slices go. Stop all ends every run. A notice says when a run completes or stops.
Updated