Skip to content

Latest commit

 

History

History
171 lines (127 loc) · 3.69 KB

README.md

File metadata and controls

171 lines (127 loc) · 3.69 KB

Rysk Logo

Dynamic hedging

Options delta neutrality as a crypto native uncorrelated asset class and the best option trading experience

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

At Rysk, we use Yarn for package management with Yarn workspaces. To get started with Yarn if you haven't installed it yet, you can run:

npm install --global yarn

We use jq for formatting JSON files from the command line. To install it, you might have to run:

For linux:

$ sudo apt-get install jq

For macOS:

$ brew install jq

Installation

  1. Clone the repo

    git clone
  2. Install packages

    yarn
  3. Add environment variables

    You will need to create free API keys for Alchemy and Infura. You can then:

    • Create /packages/contracts/.env
    • Add ALCHEMY=<your-alchemy-key>
    • Create /packages/front-end/.env
    • Add REACT_APP_INFURA_KEY=<your-infura-key>
  4. Compile contracts

    yarn workspace contracts compile
  5. Deploy contracts and update ABIs + address

    yarn workspace contracts deploy:localhost
  6. Start the front end

    yarn workspace front-end start

    It will become accessible on http://localhost:3000

Usage examples

Testing Contracts

Complete steps 1 to 3 from the installation section and then:

  1. Compile all files

    yarn workspace contracts compile
  2. Run all tests

    yarn workspace contracts test

    To run a specific test suite, e.g. LiquidityPool.ts

    yarn workspace contracts test test/LiquidityPool.ts

    Run test coverage

    yarn workspace contracts test-coverage

Run foundry fuzzing

  1. Follow instructions on template
  2. In the pipenv environment run forge test --ffi --vvv

Contract Architecture

Rysk Architecture Diagram C Diagram F

Contract layout

contracts
├── hedging
│   ├── GMXHedgingReactor.sol
│   ├── PerpHedgingReactor.sol
│   └── UniswapV3HedgingReactor.sol
├── interfaces
│   ├── AddressBookInterface.sol
│   ├── IAuthority.sol
│   ├── AggregatorV3Interface.sol
│   ├── GammaInterface.sol
│   ├── IERC20.sol
│   ├── IOptionRegistry.sol
│   ├── ILiquidityPool.sol
│   ├── IHedgingReactor.sol
│   ├── IMarginCalculator.sol
│   └── IOracle.sol
├── libraries
│   ├── BlackScholes.sol
│   ├── CustomErrors.sol
│   ├── NormalDist.sol
│   ├── OptionsCompute.sol
│   ├── OpynInteractions.sol
│   ├── AccessControl.sol
│   ├── RyskActions.sol
│   ├── CombinedActions.sol
│   ├── EnumerableSet.sol
│   ├── SABR.sol
│   ├── SafeTransferLib.sol
│   └── Types.sol
├── tokens
│   └── ERC20.sol
├── Accounting.sol
├── AlphaOptionHandler.sol
├── Authority.sol
├── BeyondPricer.sol
├── LiquidityPool.sol
├── OptionRegistry.sol
├── OptionExchange.sol
├── OptionCatalogue.sol
├── Protocol.sol
├── PortfolioValuesFeed.sol
├── VolatilityFeed.sol
└── PriceFeed.sol