** Please see additional info section for slides PDF **
** Please see test/index.ts
in the repository for an example scenario of the smart contract in action **
Inspiration
We recently witnessed a lot of less-experienced investors losing their life savings after aping into UST to get the fixed 20% APY yield on anchor. This project aims to provide a safety net and lessen the damage to less-savvy DeFi users in such black swan events.
What it does
When all your other yields dry up and dat fixed 20% APY be lookin too JUICY, minimise your depeg risk by using YEET. YEET is a smart vault that manages your risky stablecoin position by automatically liquidating the position into a safe-haven asset (such as USDC) in the event of a possible depegging scenario.
A YEET vault has two important parameters: liquidation threshold and stop-loss. When the mean price of your risky stablecoin across n rounds of the Chainlink price feed dips below the liquidation threshold, the position becomes liquidatable. In this state, anyone can take this entire vault of the risky stablecoin by exchanging safe-haven assets (e.g. USDC) at the rate of the stop-loss. The liquidatoooor keeps any profit resulting from the price delta between the liquidation threshold and the stop-loss.
Protect your stables from depeg risk, put them in a YEET vault today!
How we built it
A YEET vault implements the ERC-4626: Tokenised Vault Standard interface. This allows depositoooors to ape in their risky stablecoins (e.g. UST) and receive tokens representing their share in the vault (e.g. yeetUST). The depositooooooors can then eventually redeem shares for their stablecoins (+ any yield depending on the strategy), or their share of the safe-haven assets in case of vault liquidation.
The price feeds used in this hack is Chainlink's AggregatorV3 interface, which allows the vault to look back n rounds of price feed updates to calculate a mean price over an interval.
Challenges we ran into
We started with the idea of offering a dynamic reward that gives higher bounties for liquidators that are able to offer higher prices for the risky stablecoin that is being liquidated, but we quickly realised that this model does not work as it doesn't enforce/incentivise a desirable lower bound on the liquidation price.
So we evolved the model into its current form, where the reward now is the profit gained from the arbitrage originating from the delta of the liquidation threshold and the stop-loss. This enforces a lower bound (stop-loss) while still offering a reward for a liquidatooor's timely liquidation.
Accomplishments that we're proud of
We are proud to be using the new ERC-4626 Tokenised Vault Standard to better help people manage risk and avoid possibly losing their life savings overnight.
What's next for YEET
- First of all, a frontend UI!
- Right now, YEET vaults only support hodl positions. Future work would enable strategies (like Yearn) to hold autocompounding farming positions (such as deposit UST on Anchor protocol, auto-harvesting ANC yield, selling ANC to UST, then compounding that UST into the position).
- Another improvement would be to generalise the oracle integration to enable usage of other price feeds such as Uniswap V3 TWAPs in addition to Chainlink aggregators.
- Finally, if a lot of the risky stablecoin in the entire ecosystem is locked up in this contract, it might not be possible to liquidate the entire vault at the specified stop-loss price. So an improvement could be to modify the protocol to safely allow appropriate lower liquidation prices according to market dynamics such as total system liquidity.
Built With
- ethereum
- solidity
Log in or sign up for Devpost to join the conversation.