TWAP orders on CoW Protocol, enabling automated DAO buy-backs at a steady pace
DAO treasuries often need to sell large amounts of tokens or issue buy-backs of their own native tokens. Doing so with a single swap can lead to large price impacts and opens the DAO up to risk of manipulation from arbitrageurs.
Usually, trading execution is granted to an EOA, or a trusted subgroup of people to execute the strategy on behalf of the DAO.
This project implements a long-running TWAP order, created with a single transaction, enabling trustless execution of TWAP strategies, without giving up custody of the tokens.
This project is built on top of CoW Protocol, leveraging ERC-1271 "smart orders" to deploy an order contract instance. The contract signature validation verifies that each order part is only available at the designated point in time.
Written in Solidity and JavaScript and built with Hardhat.