---
title: No keepers, no MEV, No humans needed. Complete automation of Curve DAO’s fee collection
tags: cowswap
---
### No keepers, no MEV, No humans needed. Complete automation of Curve DAO’s fee collection
[Every time](https://resources.curve.fi/crv-token/claiming-trading-fees) a trade takes place on Curve Finance, 50% of the trading fee is collected by the users who have vote locked their CRV.
[Curve](https://resources.curve.fi/) is one of DeFi's leading **AMMs**. Hundreds of liquidity pools have been launched through Curve's factory and incentivized by Curve's DAO. Users rely on Curve's proprietary formulas to provide high liquidity, low slippage, low fee transactions among ERC-20 tokens.
<aside>
🛠️ Every week, fees are collected from the pools, converted to 3CRV and distributed.
</aside>
Lets dive deeper to understand how Curve DAO’s operations work flow looks like in this case.
- Curve has dozens of versions and types of pools
- Every pool is collecting 50% of its swap fee revenue as LP tokens ready to be redeemed by the DAO.
- The DAO employs keepers to redeem and swap the LP tokens into 3CRV that is allocated based on veCRV locked towards the pool
- Trade routes are hard-coded to the claim strategy
- Big claim amount might lead to front-running opportunity which dilutes the value that is being transferred to Curve DAO stakeholder.
- Fee receiver address is a contract (link to contract)
### Revamping the fee harvest work flow with CoW Protocol Smart orders
At the core of the solution, we use a so called “CoW Protocol Trading Account” built on top of [Safe](https://safe.global/), the industry’s standard contract-wallet.
Paired with [ExtensibleFallebackHandler](https://github.com/rndlabs/safe-contracts/tree/merged-efh-sigmuxer), the [Safe can be extended](https://hackmd.io/@mfw78/rJdHnTmM3) with [advanced trading capabilities](https://hackmd.io/@mfw78/ByFP7Iazn) which benefit from CoW Protocol’s best-execution.
CoW Protocol’s Batch Auction which hosts 15 competing solvers (execution engines / aggregators), is determining the best execution route in real time.
This means route is not specified by the user, only the limit price.
The limit price could be set dynamically based on a reference route / oracle.
How a single pool fee harvest workflow could look like
- Every pool requires one-time deployment of a Smart order into Curve’s Trading Account
- The order is valid until canceled
- The order includes instructions for a “pre-interaction” which claims funds from the pool to the Trading Account
- The order can include a “price checker” and a slippage tolerance in %, to determine the minimum acceptable price
- If no price checker is included, a market order will be placed. Market orders on CoW Swap are fully protected and are guaranteed to get best execution prices based on the solver competition.
- The order can include a destination address of choice
- The order includes a “threshold_sell_amount” above which it is willing to accept a proposed trade. This allows to avoid too frequent claiming
- Alternatively claims could be scheduled in custom time intervals instead
- This means that an order is placed on cow protocol’s orderbook by indexers, only when the smart order contract is signalling it is willing to trade.
- The complete execution flow will be included in CoW Protocol batch execution, including:
- Custom pre-interactions like claiming
- The trade with dynamic routing and best-execution price guarantee
- Custom post-interactions like sending to destinations and accounting