Git Product home page Git Product logo

metavaults's Introduction

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:

  1. Short strangle strategy, which simultaneously deposits your funds into the eth covered call vault and put selling vault
  2. 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
  3. Pseudo knock-in / knock-out options vault, which deposits into the corresponding delta vault
  4. 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!
  5. Auto-purchase options from yield farming (lending or LM), using delta vaults to gain market exposure.
  6. 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 :)

Deployment script

Quick Start

We use Hardhat for compiling and testing

  1. Install Node 12.3.0 with nvm
nvm install 12.3.0

nvm use 12.3.0
  1. Install all the NodeJS dependencies with yarn.
yarn install
  1. You can start compiling the Solidity code with Hardhat.
npx hardhat compile
  1. 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>
  1. 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

metavaults's People

Contributors

chudnov avatar

Stargazers

bageltoes avatar

Forkers

dashbaord202401

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.