At Yearn we consider ourselves somewhat of experts in the field of token dumping. It goes along with the job of being a yield aggregator sure, but we like to think we bring an extra pizazz to the table when it comes to the art dumping.
One of the reasons for this is likely because of how long we've been doing it. Yearn's been dumping tokens longer than most people have been in this industry.
Longer than Saylors been Yolo longing Bitcoin.
Longer than we have been waiting for re-staking platforms to release an actual product.
Longer than Vitalik's ........ ehhh, blog posts .
Over the years Yearn has gone through many iterations of the sacred token dump.
Most Yearn strategies started out with hard coded routes through specific DEX's like Uniswap or Curve. Some strategies even today use this method for tokens that trade primarily on one market such as Morpho.
EX: https://etherscan.io/tx/0xfc6eac37b058afd9adfc07e3194892d788b30116c5e614dff1794cb868da677f
However, there are some obvious limitations of this method.
As liquidity has become more spread out across different protocols, MEV has become more prevalent and off chain solvers have taken over more of the market, the hard coded routes have become less efficient. This combined with the manual work needed, means scaling and maintaining this for many different strategies, especially those that need to do complex routing is not feasible.
So, a while back a few of the old big brains at Yearn started using a new system called the "Trade Factory". This logic is how all of the V2 Curve compounders currently do their token dumping. The trade factory system allows for strategies to plug in to Yearns internal Cow Swap solver Sea Solver to handle token dumping.
Periodically reward tokens such as CRV are claimed by the strategy, at which point Sea Solver can then do the hard work of dumping those CRV for the underlying asset of the vault.
EX: https://etherscan.io/tx/0x2f7679422e196b6253e05a761ec947ddcb22139b95e6882a180735be0a78b195
Given most of those assets are LP tokens of different variety, across many different versions of Curve pools, manually setting routes for each strategy, of which we have nearly 100 of, would be exhausting.
While this was certainly an improvement over the manual routes, it still has its own set of issues. Mainly, that the swapping of the tokens is permissioned to our own solver.
And if there's one thing we hate at Yearn more than soy boys, its permissioned DeFi.
To help alleviate our chronic dumping pains, we were inspired by Ajna Finance to turn to dutch auctions.
Many of the other biggest DeFi players have been doing the same lately, including Euler through their Fee Flow and the now disregarded Uniswap Factory Owner.
Dumping with dutch auctions meant the possibility of getting all of the benefits of the Trade Factory setup, but removing the permissioned nature and allowing anyone to participate in Yearn's dumping extravaganzas.
However, given the still novel and non-standardized nature of on-chain dutch auctions we ran into issues with attracting bots that would be interested in participating in the auctions. Without many participants, dumping through auctions can lose significant money. And since we wanted to use these for both strategy reward tokens and autonomous dumping of Yearn's accrued fees, we needed a way to plug into a bigger solver network.
So, who has the biggest solver network, that we just so happen to have some internal experts in?
Enter Cow Swap.
Lucky for us the chads at Cow Swap are always a few steps ahead and already support signing orders using EIP-1271 which allows for smart contracts to place their own "Smart Orders".
This means with a little reworking or our original design and the addition of a custom isValidSignature check, that only returns true if the Cow Swap order submitted fills at or above the current auction price, we can allow any Cow solver to now take our dutch auctions.
Best part of all, is it requires 0 extra integration or even knowledge from the solvers of the existence of our system.
We have a simple off chain bot that monitors the current price of any active auction as well as the current quotes returned from Cow Swap. When they match, we post it to the permissionless Cow API, so it shows up like any other order would to solvers.
The baseline auction logic hasn't changed and still allows for anyone to participate without being apart of Cow Swap by taking the auctions directly as long as you can beat the Cows.
We just skipped that pesky bootstrapping phase of building a custom bot network that all have to manually integrate our specific instance.
Bam, we now have fully permissionless, distributed, generic token dumping that can be used for any token pair and is always plugged into DeFi's premier solver network as a baseline filler.
The primary initial use we have been using these auctions for has been the dumping of accumulated Yearn fees to one vault token.
In the past week we have dumped over $30k fees through these auctions with Cow swap solvers filling about 80% of this volume and 3rd party bots taking the rest directly from the auction contract.
You can see one of the auctions order history here: https://explorer.cow.fi/address/0xb89e40bBb7B6f00C35a0452a0B243ECD37e453a0
We plan to continue to roll this system out to more Yearn strategies, YFI buybacks and some novel vault types on mainnet as well as new chains in the coming months.
Want to use the dutch auctions for your own dumping needs? Deploy your own from our permissionless factory https://etherscan.io/address/0xa076c247AfA44f8F006CA7f21A4EF59f7e4dc605
Think you can beat the cows? See the full Auction code here to learn how to integrate directly.
And join the "YFI Auctions Secret Admirers" group to ask questions or just follow along https://t.me/+C_9jGhcXCm8zYTFk
And as always remember your ABD's