
Yield MM
Strategy vaults leveraging lending and MM
About
The problem it solves An average user cannot earn meaningful yields through market making, and AMMs still fail to efficiently fill large swaps. APYs are also not significant unless users already have large capital. To solve both of these problems, I built a strategy called Yield MM. Yield MM is built using Octant v2 contracts and Uniswap Hooks. It is an automated strategy that earns yield on Aave and earns additional returns by market-making on Uniswap using the Coincidence of Wants method. It provides liquidity only when needed for large swaps, which allows it to earn fees without pushing price against the trader and without hurting the market price. How it works: Yield MM is a market-making strategy built on: Octant v2 multistrategy vaults Uniswap hooks Users deposit into our vaults Those vaults then route capital into Aave. and the strategy uses that same capital to simultaneously act as a market maker on Uniswap whenver a large swap is detected and earning fees. After making the swap the assets are routed back to aave. making the swap efficient, as well as allowing any user to make money through market making.
How it's made
Challenges we ran into The major challenges I faced were: Handling all the logic for market making swaps using Uniswap v4 hooks, since it involved assets routing through multiple contracts. I broke the logic into smaller parts — first building a CoW hook on Uniswap v4 and the Octant vaults separately. After the isolated logic was working, I moved to making the contracts interoperable with each other (interaction between hook ↔ vault, then vault ↔ user, and then vault ↔ vault). I had to take a few steps backwards to redesign the overall architecture, and then wrote tests to make it all work correctly. Managing assets and state between vaults of different assets (had to iterate the contract structure a lot). This was partly connected to the first problem. My initial design had separate state for each asset vault, but later I redesigned it into a pair of vaults working together on top of a Uniswap pool. Example: if the strategy is built on WETH/USDC, then I made separate vaults for WETH and USDC, and wrote functions specifically for these vaults to communicate with each other. Figuring out rebalancing / giving assets back to the user if a vault had been used up for market making (needed another router contract). Initially I ignored this, assuming there would be enough reserves for instant withdrawal. But after my mentor questioned this, I realized I needed proper rebalancing logic. So I built a separate router contract that swaps the paired asset back and returns it to the user when needed for withdrawals.