Skip to content
All library documents

TWAMM: Smooth On-Chain Execution of Long-Term Orders

Article Paradigm research

Summary

The document introduces the time-weighted average market maker (TWAMM), an Ethereum mechanism for executing large orders over time. It divides a long-term order into continuously accruing virtual trades that interact with an embedded constant-product AMM. This is presented as an on-chain analogue to a traditional time-weighted average price order: spreading execution can reduce the price impact of individual trades, while the design amortizes transaction costs across the virtual orders.

The explanation first reviews adverse selection and the constant-product reserve relationship, then contrasts manual order splitting with broker-executed TWAPs. Arbitrageurs are expected to keep the embedded AMM aligned with broader market prices. The paper argues that processing between blocks can reduce exposure to sandwich attacks, but acknowledges that public orders can leak information and attract front-runners. It also notes potential multi-block MEV concerns and that users can cancel orders. These are design arguments and examples, not empirical performance results; actual execution depends on liquidity, arbitrage, gas costs, and adversarial conditions.

Key ideas

  • A TWAMM executes a long-term order through continuously accruing virtual trades against an embedded constant-product AMM.
  • Spreading execution over time can reduce the price impact of a single large trade.
  • The design amortizes transaction costs across virtual orders instead of requiring a separate on-chain transaction for each one.
  • Arbitrageurs are expected to align the embedded AMM’s prices with external markets.
  • Public long-term orders may leak information and expose traders to front-running or multi-block MEV.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.