Skip to content

Commit

Permalink
Chore/level beyond to alpha (#352)
Browse files Browse the repository at this point in the history
* Fix/buyback otc (#285)

* wip

* labels

* Feature - Performance Table with Price per Share (#282)

* Show growthSinceFirstEpoch as Cumulative Yield

* Fill PricePerShares Performance Chart

* Comment

* Copy

Co-authored-by: Dan

* Get first 1000 pricePerShares

Instead of 30

* chart labels

* Group PricePerShare Epochs by Day

* Minor adjustments to Performance plot

* Minor adjustments to Performance plot

* Set Performance Plot line to natural

* Revert group by day

Scaling XAxis by time with a tick gap is enough

Co-authored-by: Dan

* Add Prettier (#283)

* Add Prettier

* Add es-lint-config-prettier

+ extend in .eslintrc.json

* .prettierignore

* npx prettier --write ./front-end/src

* .prettierrc.json

* npx prettier --write ./front-end/src

* remove error if withdrawalAmount is 0 (#288)

* remove error if withdrawalAmount is 0

* add test case

* copy rinkeby deploy folder and rename to goerli (#287)

* copy rinkeby deploy folder and rename to goerli

* Bump @nomiclabs/hardhat-etherscan from 2.x to 3.x

* Setup arbitrumGoerli in hardhat.config.ts

* Refactor Arbitrum Rinkeby file copy for Goerli

+ lint file

* Add arbitrumGoerli addresses in contracts.json

* Add Arbitrum Goerli addresses TO Markdown

* delete redundant copied rinkeby files

* update ethers and remove deprecated testnets

* update full protocol deploy script for goerli

* update uniswap pool fee to 500

* edit deploy scripts for goerli and remove rinkeby network

* redeploy contracts and update addresses

* edit setup protocol script

* update packages to fix failing tests'

* resolve package conflicts

* remove goerli ethers infura provider

* remove arbitrum ethers infura provider

* update hardhat config

Co-authored-by: Yassine <[email protected]>

* Remove 11utc copy (#291)

Remove 11am UTCs

* fixed walletconnect (#295)

* fixed walletconnect

* Use react-app-rewired to include buffer

- Remove require from App.tsc

* Move react-app-rewired to dev dependencies

Co-authored-by: Yassine <[email protected]>

* Use correct chainId for Arbitrum (#296)

Use correct chain hex id for Arbitrum

* Fix Yield y-axis domain  (#298)

* fix: parseFloat growthSinceFirstEpoch

* docs: Comment about parseFloat of BigDecimal string

* Fix issue with Yield timestamp order (#299)

fix(charts): Use Array to build PPS graph data

Using the map return doesn't guarantee order

* Refresh style of Table (#304)

* style(trades): Refresh style of Table

* style(trades): Minor adjustments

align amount right
restyle trade tab column
use normal font for first
column

* build(packages): Add react-fullscreen

* feat(components): Fullscreen trades

* feat(hooks): useElementOnScreen.tsx

Hook that allows to check if an element is on screen or not.

* feat(app): Merge policies for paged query

For writeOptions, buybackOption and rebalanceDelta simply add incoming
to the end of array

* feat(components): 10 days paging for trades

Retrieve last 10 days of trades on scroll, 10 by 10

* fix(components): fetch more if trades on screen

In case last trade is still intersecting with viewport this triggers
fetch more anyway as we move the ref to the last trade on render

* build(package): react-content-loader

* feat(components): Loaders for table

* style(components): bg color of loaders

* fix(components): bg of last td while fullscreen

* Use correct epoch for Cumulative Yield (#306)

fix(graph): Order pricePerShares by timestamp

* Minor Alpha front-end fixes (#308)

* fix(components): Fix svg card tabs to fit

otherwise the tab stays smaller than the text in it

* refactor(components): Hide progress bar if no collateral

better ui

* style(components): Move home banner closer to top

better ui

* refactor(components): Show query error in trades table if any

+ add bg-bone to fullscreen component

* fix(graph): Skip query if !account in dashboard options

otherwise it retrieves all of Graphs option as empty string is passed

Closes #309

* fix(components): Allow any user to see orders

already working for strangle but not single put or call order

Closes #311

* Move front-end to Goerli (#292)

* Move to Goerli (from Rinkeby)

* Remove Rinkeby contracts

* Update Explorer to Goerli for Testnet

* Add deployed Opyn Gamma Goerli Subgraph

* refactor: alpha sort constants

* Only run hardhat on changes to SC code. (#329)

* Performance chart public launch (#321)

* Add eslint rule to remove unnecessary imports on React.

* Clean up unused component.

* Set baseUrl to allow cleaner imports.

* Package additions for handling dates and animations.

* Vault performance chart adjustments and readme.

* Clean up after moving file location.

* More readable text length.

* Use react-helmet to "noindex, nofollow" every deployment except prod. Use REACT_APP_NETWORK over REACT_APP_ENV to determine network to use.

* React 18 (#337)

* Upgrade to React 18.2.0 and fix typing issues.

* Fix react imports and typing issues.

* Bump npm from 8.9.0 to 8.11.0

Bumps [npm](https://github.com/npm/cli) from 8.9.0 to 8.11.0.
- [Release notes](https://github.com/npm/cli/releases)
- [Changelog](https://github.com/npm/cli/blob/v8.11.0/CHANGELOG.md)
- [Commits](npm/cli@v8.9.0...v8.11.0)

---
updated-dependencies:
- dependency-name: npm
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Yarn workspaces (#338)

* Clean up package.json files for better consistency.

* Move to Yarn and Yarn workspaces.

* Build without bash script.

* Fix syntax errors.

* Remove non-existent files.

* Workspaces with nohoist for typechain packages.

* Update docs.

* Lock updates.

* Remove console.logs and fix bad test.

* Package upgrades and cleaning (#347)

* Clean and upgrade contacts packages. Hoist shared packages to top level package file.

* chore: remove bad test

* Move non-package details to their own config files.

* Remove unused code for @nivo package.

* Remove unused code for react-scroll package.

* API changes for framer-motion.

* Remove unused code for humanize-duration package.

* Remove singular use of Axios for native fetch.

* Better typing.

* Better typings.

* Switch to dayjs.

* chore: downgrade ethers to 5.4.0

Co-authored-by: kjr217 <[email protected]>

* chore: get branch level with alpha

* chore: remove mention of rinkeby

* chore: fix config bug

* chore: update arbitrum with alchemy provider

* chore: change arbitrum rpc creation location

* Update hardhat.yml

* chore: fix arbi rpc

* chore: upgrade to dayjs from moments

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Dan <[email protected]>
Co-authored-by: Yassine <[email protected]>
Co-authored-by: Josh <[email protected]>
Co-authored-by: Tim Dunphy <[email protected]>
Co-authored-by: Tim <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
7 people authored Jan 18, 2023
1 parent b5d3d4a commit dbeee7e
Show file tree
Hide file tree
Showing 156 changed files with 21,267 additions and 84,787 deletions.
65 changes: 29 additions & 36 deletions .github/workflows/hardhat.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Hardhat full test suite CI
name: Hardhat

on:
push:
branches:
- "**" # matches every branch

push:
paths:
- "packages/contracts/**"
- "package.json"
- ".github/workflows/hardhat.yml"

defaults:
run:
working-directory: ./packages/contracts


jobs:
test:
runs-on: ubuntu-latest
env:
ALCHEMY: ${{ secrets.ALCHEMY }}
TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }}


steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: 16

- name: Node module cache
uses: actions/cache@v2
id: node-cache
with:
path: "**/node_modules"
key: npm-v2-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-v2-
- name: Install dependencies
run: npm install
if: steps.node-cache.outputs.cache-hit != 'true'

- run: npm run compile
- run: npx hardhat test ./test/*.ts
test:
runs-on: ubuntu-latest
env:
ALCHEMY: ${{ secrets.ALCHEMY }}
TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
ARBITRUM: ${{ secrets.ARBITRUM }}
ARBITRUM_GOERLI: ${{ secrets.ARBITRUM_GOERLI }}

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: "yarn"

- name: Install modules
run: yarn

- name: Compile
run: yarn workspace contracts compile

- name: Test
run: yarn workspace contracts test ./test/*.ts
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Thumbs.db
# Ignore built ts files
dist/**/*

# ignore yarn.lock
yarn.lock
# ignore package-lock
package-lock.json

build/

Expand Down
123 changes: 48 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="https://github.com/github_username/repo_name">
Expand All @@ -13,115 +12,88 @@
</p>
</p>

<!-- GETTING STARTED -->

## Getting Started

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

### Prerequisites

- npm
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:

```sh
npm install npm@latest -g
npm install --global yarn
```

### Installation

1. Clone the repo

```sh
git clone
```
```sh
git clone
```

2. Install NPM packages
2. Install packages

```sh
npm install
```

or

```sh
yarn
```
```sh
yarn
```

3. Add environment variables

Create free API keys for alchemy and infura

a. Create /packages/contracts/.env with:

```sh
ALCHEMY_KEY=<your-alchemy-key>
```

b. Create /packages/front-end/.env with:

```sh
REACT_APP_INFURA_KEY=<your-infura-key>
```

4. Start a hardhat node as mainnet fork
You will need to create free API keys for Alchemy and Infura. You can then:

```sh
cd packages/contracts
npm run mainnet-fork
```
- Create `/packages/contracts/.env`
- Add `ALCHEMY=<your-alchemy-key>`
- Create `/packages/front-end/.env`
- Add `REACT_APP_INFURA_KEY=<your-infura-key>`

From a new terminal window
4. Compile contracts

5. Compile contracts
```sh
yarn workspace contracts compile
```

```sh
cd packages/contracts
npm run compile
```
5. Deploy contracts and update ABIs + address

6. Deploy contracts and update ABIs + address
```sh
yarn workspace contracts deploy:localhost
```

```sh
cd packages/contracts
npm run deploy:localhost
```

7. Start the React app
6. Start the front end

```sh
cd packages/front-end
npm run start
```
```sh
yarn workspace front-end start
```

<!-- USAGE EXAMPLES -->
## Usage examples

## Testing Contracts
### Testing Contracts

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

Compile all files
1. Compile all files

```sh
npm run compile
```
```sh
yarn workspace contracts compile
```

Run all tests
2. Run all tests

```sh
npx hardhat test
```
```sh
yarn workspace contracts test
```

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

```sh
npx hardhat test test/LiquidityPool.ts
```
```sh
yarn workspace contracts test test/LiquidityPool.ts
```

Run test coverage
Run test coverage

```sh
npm run test-coverage
```
```sh
yarn workspace contracts test-coverage
```

Run foundry fuzzing

Expand All @@ -130,12 +102,13 @@ Run foundry fuzzing

## Contract Architecture

![Rysk Architecture](./images/RyskArchitecture.png) ![Diagram C](./images/DiagramC.png)
![Rysk Architecture](./images/RyskArchitecture.png)
![Diagram C](./images/DiagramC.png)
![Diagram F](./images/DiagramF.png)

## Contract layout

```
```bash
contracts
├── hedging
│ ├── GMXHedgingReactor.sol
Expand Down
5 changes: 0 additions & 5 deletions buildFrontEnd.sh

This file was deleted.

Loading

0 comments on commit dbeee7e

Please sign in to comment.