yearn / seafood

Seafood
https://seafood.yearn.watch
13 stars 21 forks source link

Seafood

Seafood is a public vault monitoring dashboard that lets you simulate operations like harvests and allocation changes while tracking asset flows and APY changes.

mechafish-md

Dev environment setup

First get node installed. For an easy way to install a particular node version in your dev environment, or multiple node versions on the same system, try Node Version Manager (NVM). See https://github.com/nvm-sh/nvm#install--update-script for install instructions.

1 - With NVM installed, install node 16 (or higher) and yarn

nvm install 16 # or later
npm install -g yarn

2 - Clone this repo, install dependencies

git clone git@github.com:yearn/seafood.git
cd seafood
(yarn && cd api && yarn)

3 - Configure local environment variables

cp env.example .env

4 - Run the app

cd ~/git/seafood # or wherever you cloned it
yarn start

Open a browser at http://localhost:3000

Project structure

backend

/api - Resources for serving Seafood's backend api \ /api/routes/vision - Facades over Yearn's vision api \ /api/routes/abi - Smart contract abis \ /api/routes/getVaults - Vault and strategy related data. (obsoleting) \ /api/routes/github - Generate GitHub bearer tokens for Seafood users \ /api/routes/tenderly - Generate Tenderly simulation forks \ /api/routes/tradeables - List tradeable erc20s for a given trade handler

frontend

/public - Static files \ /scripts - Help scripts used in dev \ /src - Resources for building Seafood's frontend \ /src/abi - Some static abis that are needed by Seafood and some that..aren't 👀 \ /src/math - Logic for computing APY and APR on demand \ /src/components - Most of Seafood's React components go here \ /src/components/controls - Specifically, common UI controls live here \ /src/context - Seafood's React hooks live here. So why call it context? \ /src/ethereum - Various utilities for querying RPCs. (obsoleting) \ /src/utils - Various utilities that seemed happiest in a folder called utils 😁 \ /src/config.json - This was a more convenient way to configure previous versions of Seafood. It moves to envars eventually

Tests

Seafood uses Jest for testing. Some tests require rpc integration, so first set this envar:

TEST_RPC=<eg, your infura mainnet url>

Infura not required, but you'll need a premium rpc or your own node to test.

Run tests like this:

yarn test

Contributing

><(((*> - Onward!