yield-optimised stable basket: trades against ETH, re-balances based on a custom prediction market
Where should DAO treasuries hold their ETH and $? No looping, no ponzinomics. Just pure yield optimisation. Curated vaults for purposes like this would be wise to use Bunni and Cork protocol...but they were hacked, so we needed to build our own alternatives.
Our Github represents a fork (of our codebase) that is more cross-chain oriented.
The version we focused on for this hackathon is the so branch on gitlab.com/quidmint/quid
It contains a Uniswap/UMA hook. At over 2k lines of code, the hook is like another protocol that sits inside of another protocol we've been rebuilding and debugging for the past week:
live on mainnet...top 10 stables, connected together by Uniswap & AAVE/Morpho: our basket needed a way to defensively adjust concentration risk in real time. Especially since crvUSD recently experienced a depeg, and even USDC is known to have survived such troubles: we need to be proactive about this.
The 3 alternatives were: do nothing and treat all stablecoins as equally risky (everyone is exposed to the weakest link), or use governance votes (slow, point-in-time, politically capturable). None of these options provides a forward-looking, continuous, skin-in-the-game risk signal. The prediction market hook that we built for this hackathon does!
First I'll mention the "virtual reserves" concept (using mockTokens) that allows QU!D to work with UniV4's PoolManager for LP provision and swaps without holding actual value in the PM. I initially encountered this in 2018 while working at Bancor.
The prediction model forming QU!D's hook was inspired by Belgian auctions: participants place bets with a confidence parameter, and are rewarded as a function of that parameter (not only based on how much capital went into the losing side of the event outcome).
YieldBasis and Panoptic also allow anyone to LP without selling half of their ETH for $ first, but we did this with UniV4 using bonds. Among other advantages, it's also conducive to the stability for USDE, et. al.
The range for all protocol-controlled liquidity constantly moves, following ETH's price, and swap fees are automatically compounded. We do this for both UniV4 (Vogue.sol) and UniV3 (Rover.sol), in different ways respectively.
Basket.sol is an ERC20 but it follows the 6909 standad: id field represents the maturity of your shares in the $ basket. When you mint (bond into the basket), choosing a delayed maturity gives you yield upfront (later maturity = more yield). This yield isn't algorithmic or governance-based; simply a TVL-weighted average over time of all 11 individual vaults' yields. This even includes Hashnote, an RWA vault for USDC.
Our Amp.sol contract plugs into Aux.sol, which manages deposits, withdrawals and redemptions for all the stables. To max out what we're doing with Aux, it even provides flash loans to Bebop's JAM Settlement contract.
Traditional LP strategies are defensive—they provide liquidity and suffer when the market moves too fast. Amp.sol is offensive—it actively exploits momentum. In basketball, a crossover involves driving in one direction, planting a pivot foot when the defender commits, then shifting weight to the opposite side. Amp performs the financial version of this with USDC and WETH using AAVEv3 and UniV3.
As a complementary process to UMA's resolution, we integrated Chainlink CRE. If CRE never runs — workflow fails, Gemini is down, event didn't emit, etc. — the DVM still votes. Voters just have to do their own research instead of reading pre-assembled evidence. If CRE runs but Gemini says "depeg detected" and the DVM votes false — the DVM wins.

