Architect Documentation
  • User Guide
  • SDK Documentation
  • Algos Book
  • Overview
  • TWAP
  • Smart order router (SOR)
  • Percent of volume (POV)
  • Market maker (MM)
  • Spreader (MM*)
  • Spreader
Powered by GitBook
On this page

TWAP

PreviousOverviewNextSmart order router (SOR)

Last updated 1 year ago

The Time-Weighted Average Price (TWAP) algo attempts to spread out an order evenly throughout a period of time. Using a TWAP execution is one way to achieve an average price that matches the market and can help minimize slippage and reduce costs.

We can choose the parameters based on the trading goals.

Parameter
Description

Buy/Sell

Direction of the order

Market

Symbol & price currency of the market, and the exchange

Quantity

Total quantity that will execute, measured in token units or contracts

Time Interval

Amount of time to wait between orders

Take Through Fraction

At what price to send the order, relative to the opposite side market. For example on a buy order, a take through fraction of 0 would send bids at a price equal to the best offer at the time, and a take through fraction of 0.0005 would send bids 0.05% (5 basis points) above the current offer. Increasing this parameter above 0 reduces the chance of missing out on trades in a fast moving market, but has a higher risk of price slippage.

Reject Lockout

If an order is rejected, wait this amount of time before trying again

Time

End time of the algo, in your local timezone

The algo is not guaranteed to fill its full size by the end time, and will cancel any remainder size. Notably, it will not attempt to "catch-up" if orders are unfilled (e.g. due to rejects).

In this TWAP example, the algo will buy 10 Bitcoin (BTC) for USD on Coinbase between now and 04/01/2024 14:37 PM (that is, 1 hour from now). To execute, the algo will send orders every 15 seconds at a price that is 10bp above the BTC/USD offer on Coinbase. The algo estimates a total cost of ~$656k USD, and each individual child order will be ~0.042 BTC in size.