Meta Vaults
Simple idea: build on top of the base covered call, put selling, options buying ribbon vaults to create innovative vaults, and potentially get a cut of the fees!
Example Vaults:
- Short strangle strategy, which simultaneously deposits your funds into the eth covered call vault and put selling vault
- Long strangle strategy, which is a short strangle but buys the options instead of sells. This can be useful if you are just long directional vol or if you are an LP on an AMM (defacto short vol) and want to hedge against large movements
- Pseudo knock-in / knock-out options vault, which deposits into the corresponding delta vault
- Use yields from delta neutral basis trading on lemma.finance to buy call options on delta vault, directly bid on gnosis, or buy ATM call options on Hegic!
- Auto-purchase options from yield farming (lending or LM), using delta vaults to gain market exposure.
- Buy ZCB on 88mph and use the rest of the funds to deposit into the delta vaults (flavor of Principal protected notess where instead of ATM call option you buy OTM call option). Alternatively you can use Hegic for ATM call options!
A more comprehensive list can be found in this nice thread by vadym.
Boilerplate
The V2 directory contains all the boilerplate code to get started on building your very own meta vault.
Example Meta Vault
We built a naive basic short strangle meta vault implementation. Please build on top of it, particularly the rollVault() method which is the heart of the code. This is where you deposit into other vaults, take out a loan, or buy an option.
Test suite. Most tests are skipped since they rely on the vault locking funds in other smart contracts for yield (such as covered call vault, put selling vault, compound, etc.) which you will implement!
Note: please change the ribbon covered call and put selling v2 addresses for the test suite if needed :)
Quick Start
We use Hardhat for compiling and testing
- Install Node 12.3.0 with
nvm
nvm install 12.3.0
nvm use 12.3.0
- Install all the NodeJS dependencies with yarn.
yarn install
- You can start compiling the Solidity code with Hardhat.
npx hardhat compile
- You will need access to an archive node to run tests, since the tests use forked mainnet state. Create a .env file with a
TEST_URI
. Ask @chuddy for access to archive node.
TEST_URI=<add node url here>
- Run the unit tests with the command:
npx hardhat test
Deployment
Ribbon uses hardhat-deploy to manage contract deployments to the blockchain.
To deploy all the contracts to Kovan, do
yarn deploy --network kovan
The deployment info is stored on disk and committed into Git. Next, we have to export out the deployed addresses in a parseable format for the frontend to use (JSON).
yarn export-deployments
Finally, we can verify the contracts on Etherscan:
npx hardhat etherscan-verify --network kovan