Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Optimized the harvest function by trying to:
I added minimums for some of the harvests and the want deposit, since in the example transaction the amount removed from 3curve costs less than the gas! Initially these vars should be 0 but can be updated by governance using the setMinPoolHarvest() function. Note about the minimums, they are actually right below the minimum; harvests run if the amount to harvest is greater than it. These vars are:
Gas Usage (using tests/test_custom.py and running tx.gas_usage):
Original - 5,547,060
Optimized0 - 5,503,783
Optimized* - 81,216
0 Setting all minimums to 0 so all harvests and deposits proceed. This shows a minimum savings of ~45,000 wei