harvest-finance / harvest

Bread for the people!
217 stars 94 forks source link

Sushi UST-WETH strategy test #19

Closed CryptJS13 closed 3 years ago

CryptJS13 commented 3 years ago

I wrote a test for a strategy farming the UST-WETH LP on Sushi.

I used other tests that I found in the folder and combined some aspects. The test will have a user supply LP to sushiswap. It then deposits LP tokens into harvest. The strategy will be simulated for 40 hours, 240 blocks per hour with a doHardWork() call every hour. It will show share price increase every hour. After 40 hours the user will withdraw, after which start and final balance for the user are shown.

The test can be run by using this command in one terminal to run a Mainnet Fork:

npx ganache-cli --fork https://eth-mainnet.alchemyapi.io/v2/YOUR_KEY_HERE -u '0xf00dD244228F51547f0563e60bCa65a30FBF5f7f' -u '0x0F4ee9631f4be0a63756515141281A3E2B293Bbe' -u '0xD6216fC19DB775Df9774a6E33526131dA7D19a2c'

The unlocked adresses are the Harvest Deployer, and whales for UST and WETH.

When the fork is up run the following command in another terminal:

truffle build && set MAINNET_FORK=True && npx truffle test ./test/mainnet-fork-test-sushiswapStakingReward-USTWETH.js

breadforthepeople commented 3 years ago

Thank you for your contribution! We've just released a new repo that makes things a lot easier: https://github.com/harvest-finance/harvest-strategy (including the issue with the changing whale). You are invited to contribute to this one instead. It will be cleaner, more sustainable, way faster, and easier for us to deploy.