Skip to main content

Overview

Protocols in decentralised finance (DeFi) often generate revenues by accruing fees across a range of markets in a variety of different asset types. The default behaviour of the protocol will typically be to hold all these asset types on the protocol’s balance sheet as protocol-owned liquidity (POL). However, this will often be a suboptimal use of accrued fees.

In many instances it might be beneficial for the protocol to convert accrued fees into a single currency (perhaps USDC or ETH or the project’s native token) for accumulation or future distribution. Yet mechanisms for converting accrued fees into a single asset are notoriously problematic and generally not common in DeFi. Specifically, they are often inefficient, vulnerable to value extraction by validators (MEV), or otherwise require interventions by governance or trusted parties.

Here, we outline Fee Flow: an efficient, decentralised, MEV-resistant mechanism for protocols to be able to auction their accrued fees for a single type of asset.

Dutch auction

Let us assume a protocol is accruing fees in a variety of different asset types across a wide variety of markets. Each market has a function that allows anyone to transfer accrued fees from the market to a FeeFlowController smart contract inside of FeeFlow at a time of their choosing. Being costly to do this, and in the absence of any other incentive to do so, this function is unlikely to be called on a market very often.

The FeeFlowController accumulates fees (often implicitly, see below) and periodically auctions them via a Dutch auction. The auction takes place in discrete epochs. Each epoch, the initPrice of the auction starts at a factor priceMultiplier times the settlement price of the auction in the prior epoch. It then falls linearly over time, tending to zero, over an epochPeriod. For example, the auction might start at a factor priceMultiplier=2 times the settlement price of the prior auction and last an epochPeriod=100 days.

At the beginning of an epoch, the FeeFlowController holds no fees and has a high price, so is unlikely to settle any time soon. However, as fees accrue on markets, and the auction price falls, there will usually come a time when the auction price is lower than the aggregate value of all accrued fees. The first person to pay the auction price at this point is allowed to claim all assets in the FeeFlowController.

Note that in practice the winning auction bidder will likely monitor the value of accrued fees across markets off chain and only transfer them to the FeeFlowController just-in-time; that is, in the same transaction or same block as the pay the winning bid for the auction. Thus the FeeFlowController will often not actually hold many, or indeed any, assets. It will instead usually only implicitly hold assets.

Inevitably, accrued fees in some of the markets will not be desired by bidders. They might not be worth the cost of gas to transfer them, or sell them, in the future. These will simply remain in their respective markets and may or may not be purchased in a later auction.