HomeKnowledge BaseCoW Swap Launches TWAP Orders

CoW Swap Launches TWAP Orders

5 min read

TWAP orders allow traders to spread their trade over a specified period of time in order to smooth out fluctuations in market price and open a position for an average market price. A TWAP order consists of multiple smaller orders placed at regular intervals over a predefined time period.

In our tests, selling 1,000 ETH in four parts of 250 ETH each, allowed us to yield a price for the order that was 3.5% better than selling the 1,000 ETH all at once!

TWAP Order Interface

To get started with TWAP orders through the Safe app, you will first need to authorise a transaction signing request that contains a batch of transactions (we’re big fans of gas savings through batching ⛽🚫). This batch includes a “setFallbackHandler’’ function. TWAP orders are the first order type that runs on a new conditional order framework, super-charging your Safe.

In order for this framework to make complex trades on your behalf, an upgrade to Safe’s “fallback handler” is required. Don’t worry though, you will be automatically prompted to upgrade in order to use TWAP.

1-twap.webp

The TWAP interface has several sections:

  • Trading Assets: Select the assets you want to swap and the amounts of each.
  • Price Protection: Provides protection against major price movements. Your TWAP order won’t execute if the market price dips more than this percentage (calculated from the asset price at the time of order submission).
  • Number of parts: Enter the number of parts you would like your order split into.
  • Total Duration: The total amount of time your order will take to execute.
  • Part Duration: Automatically calculated from your total duration and number of parts, part duration shows how long CoW Swap will wait between each part of your order.
  • Sell & Buy per part: Shows an estimate of how much CoW Swap will sell and buy with each part of your trade.

Benefits of TWAP Orders

TWAP orders have been widely explored through research literature in traditional finance but haven’t yet seen the light of day in DeFi. They’re finally entering use on exchanges such as CoW Swap and they provide a range of benefits for traders.

Reduce your slippage: Breaking up a large order into smaller pieces allows you to set a smaller slippage tolerance for each piece than if you had executed the large order as one.

Reduce your price impact: As with slippage, breaking up a large order into small pieces allows you to spread your liquidity needs over time, reducing your price impact.

Always receive 100% of your order surplus: On CoW Swap, all order surplus is forwarded to you. If your order executes for a better price than your quoted price — thanks to Coincidence of Wants or any other price improvement that solvers are able to find — the extra price improvement will be forwarded to you.

Eliminate market fluctuations: By giving traders the time-weighted average price, TWAP orders smooth out market volatility, which makes trying to predict prices a thing of the past.

Customise your order parameters: TWAP orders allow you to fine-tune your order by specifying the number of parts you’d like it split up into, as well as the time period you want it to execute over. On CoW Swap, TWAP orders also have a “price protection” option which protects your order from executing at an unfavorable price due to market volatility.

Get Started with TWAP Orders on CoW Swap

TWAP orders are now available in the CoW Swap order interface under the “Advanced” tab.

Have a Safe? Awesome! You can try out TWAP here.

Don’t have a Safe? Not a problem! Create one here.

The CoW Swap team is working on adding support for more wallets in the future.

One more thing to note: TWAP orders are most useful for big trades! So, when trading on Mainnet, the minimum TWAP order size is $5k. This minimum ensures that your savings from reduced price impact are not lost on execution fees (AKA gas fees). If you want to trade smaller amounts, head over to Gnosis Chain, where the TWAP order minimum is only $5 (and the gas fees are much cheaper!)

As always, on CoW Swap:

  • All prices are aggregated from the best available on-chain and off-chain liquidity.
  • Traders are fully protected from MEV.
  • Orders are free to place and free to cancel.
  • Traders never pay for failed transactions.
  • Transactions are gasless as fees are paid in the sell token.

Celebrating ComposableCoW’s conditional order superpowers, we are releasing it with TWAP (time-weighted average price) order support for enabled-Safe users.

Give TWAP orders a try today and let us know what you think by reaching out on Twitter or Discord!

2-twap.webp

We wish you much surplus and happy TWAP order trading! Give TWAP orders a try today and let us know what you think by reaching out on Twitter or Discord!

Please note that TWAP orders currently require a Safe wallet with a fallback handler. More wallets will be supported in the future.