Git Product home page Git Product logo

opynoptions's Introduction

OPYN Vault integration

Gamma Contracts Deployment

Add following lines in the migrations/2_deploy_contracts.js in GammaProtocal repo, and deploy the contracts in GammaProtocal repo either locally or on a testnet.

The mock USDC is used as the strike asset and mock WETH is used as underlying asset. This step can be skipped if deploying on a testnet as respective USDC/WETH contracts can be used.

await deployer.deploy(MockERC20USDC, 'USDC', 'USDC', 8, {from: deployerAddress})
const usdc = await MockERC20USDC.deployed()

await deployer.deploy(MockERC20WETH, 'WETH', 'WETH', 8, {from: deployerAddress})
const weth = await MockERC20WETH.deployed()
await weth.mint(deployerAddress, '10000000000')

await whitelist.whitelistCollateral(weth.address)
await whitelist.whitelistCollateral(usdc.address)
whitelist.whitelistProduct(weth.address, usdc.address, usdc.address, true)
whitelist.whitelistProduct(weth.address, usdc.address, weth.address, false)

OpynVault Contract Deployment

Deploy the Opyn Vault smart contract with the following command. Please make sure that constructor arguments are correct for OpynVault contract.

npx hardhat run scripts/deploy.ts --network localhost

Console

Following commands can be used to interact with the console, please make sure that contract addresses are correct. If deployed locally, the contract addresses generated from previous step can be used, else if on testnet respective addresses can be used.

npx hardhat --network localhost console

const weth = await ethers.getContractAt('MockERC20', '0x6eD79Aa1c71FD7BdBC515EfdA3Bd4e26394435cC')
await weth.approve('0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A', '2000000000')
const vault = await ethers.getContractAt('OpynVault', '0x2D8BE6BF0baA74e0A907016679CaE9190e80dD0A')
await vault.deposit('200000000')
await vault.genOToken()
await vault.createShort()

opynoptions's People

Contributors

babayega avatar

Watchers

 avatar

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.