harvest-api
This repository contains implementation and documentation of the API used by Harvest.finance.
Documentation
- See API Documentation for supported routes
- See Developer Documentation for developer info
- Miscellaneous
Minimal recommended setup
yarn
- Install and start MongoDB (for local cache). Instructions for Mac
export INFURA_KEY=<infuraKey>
export MATIC_INFURA_KEY=<infuraKey that has Polygon/Matic enabled>
. If omitted, will still work for BSC and Ethereum Mainnet (but tests will fail).npm start
. It takes a few minutes to start fresh. Then, can query:- Vaults:
http://localhost:3000/vaults?key=harvest-key
- Pools:
http://localhost:3000/pools?key=harvest-key
- General data (staked amount, monthly profits, etc.):
http://localhost:3000/token-stats?key=harvest-key
- API originally designed for CoinMarketCap:
http://localhost:3000/cmc?key=harvest-key
- Vaults:
Debugging a specific vault/pool
npm run print-vault -- WETH
will output vault and pool information. IDs should match a vault in tokens and/or a pool in pools
Running tests
npm t
. However, the test suite could use more assertions
Areas of improvements
- Adding more assertions for the tests and more coverage