This Hardhat environment is configured to use Mainnet fork by default and provides templates and utilities for strategy development and testing.
- Run
npm installto install all the dependencies. - Sign up on Alchemy. We recommend using Alchemy over Infura to allow for a reproducible Mainnet fork testing environment as well as efficiency due to caching.
- Create a file
.env, using the template given in.env.template.
All tests are located under the test folder.
- Run
npx hardhat test [test file location](if for some reason the NodeJS heap runs out of memory, make sure to explicitly increase its size viaexport NODE_OPTIONS=--max_old_space_size=4096).
Under contracts/strategies, there are plenty of examples to choose from in the repository already, therefore, creating a strategy is no longer a complicated task. Copy-pasting existing strategies with minor modifications is acceptable.
Under contracts/base, there are existing base interfaces and contracts that can speed up development.
When ready, open a pull request with the following information:
-
Instructions on how to run the test and at which block number
-
A mainnet fork test output (like the one above in the README) clearly showing the increases of share price
-
Info about the protocol, including:
- Live farm page(s)
- GitHub link(s)
- Etherscan link(s)
- Start/end dates for rewards
- Any limitations (e.g., maximum pool size)
- Current pool sizes used for liquidation (to make sure they are not too shallow)
The first few items can be omitted for well-known protocols (such as
curve.fi). -
A description of potential value for Harvest: why should your strategy be live? High APYs, decent pool sizes, longevity of rewards, well-secured protocols, high-potential collaborations, etc.
A more extensive checklist for assessing protocols and farming opportunities can be found here
If your pull request is merged and given a green light for deployment, the Harvest team will take care of on-chain deployment.