Skip to main content
The TWAP Executor (time-weighted average price) splits one large buy or sell into equal orders placed at a fixed interval, so the trade is spread over time instead of hitting the market at once.
Condor can’t create a TWAP executor. None of its tools creates one, so agents and the Condor chat can’t use it. Create it through the Hummingbot API with POST /executors/, as shown below.

Overview

How it works

  1. When it starts, the executor plans total_duration // order_interval + 1 orders: one right away, then one every order_interval seconds.
  2. Each order is the remaining amount divided by the orders left, so the orders are roughly equal.
  3. When every planned order exists and all of them have filled, the executor ends with close type COMPLETED.
For example, total_duration: 3600 and order_interval: 60 plan 61 orders, not 60.

Configuration

MAKER mode is marked beta in Hummingbot: the executor logs a warning when it starts in that mode.

Via the API

A $5,000 market-order buy of ETH over one hour, one order a minute (61 orders of about $82):
The same in MAKER mode, resting each order 0.05% below the mid price and refreshing it after 30 seconds:

Close types

Stopping early

Stop the executor with POST /executors/{executor_id}/stop. The executor cancels its open orders and keeps what already filled; it doesn’t sell back a buy or buy back a sell. A stopped TWAP executor ends with close type COMPLETED, whichever keep_position you pass: its shutdown step overwrites the close type the stop set. Its fills are not added to the Position Hold, so track the amount it traded yourself.

What it reports

The executor’s custom_info includes filled_amount_base, filled_amount_quote and current_position_average_price (the volume-weighted average fill price). Its net_pnl_quote compares that average with the current mid price, minus fees.

Learn more