Skip to content

Arbitrum Curve Finance Two Pool Strat. All tests passing. Ready for review.#2

Closed
pata-eth wants to merge 3 commits intoarbitrum-tricryptofrom
arbitrum-2crv
Closed

Arbitrum Curve Finance Two Pool Strat. All tests passing. Ready for review.#2
pata-eth wants to merge 3 commits intoarbitrum-tricryptofrom
arbitrum-2crv

Conversation

@pata-eth
Copy link
Owner

@pata-eth pata-eth commented May 10, 2022

Created a PR against the arbitrum-tricrypto branch as that was the root branch for arbitrum-2crv. @poolpitako, this is ready for your review. At the strat meeting, folks mentioned that we'll need another dev to peer review the code. Ideally, that'd be dude. Note that this PR is only created to facilitate the code review and is not meant to be merged.

@pata-eth pata-eth requested a review from poolpitako May 10, 2022 17:00
Copy link
Owner Author

@pata-eth pata-eth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@poolpitako, please review the changes after the feedback received. There's also a change related to the migration of the gauge which was to blame for the strategy not making money. The problem with the new gauge is that it holds no CRV, so the strategy is still not making money in the tests. All tests are now passing. Thank you

name: StrategyCurveTwoPool

dotenv: .env

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env wasn't being loaded without this config

# contracts used by the strategy
registry: "0x3199437193625DCcD6F9C9e98BDf93582200Eb1f"
gauge: "0xbF7E49483881C76487b0989CD7d9A8239B20CA41"
gauge: "0xCE5F24B7A95e9cBa7df4B54E911B4A3Dc8CDAf6f"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts/utils.py Outdated
Want: {strategy.balanceOfWant()} ({want.symbol()})
Target Token: {target.balanceOf(strategy)} ({target.symbol()})
CRV: {crv.balanceOf(strategy)} ({crv.symbol()})
Claimable CRV: {gauge.claimable_reward.call(strategy, crv,{"from":
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added entry to track CRV claimable by strategy

scripts/utils.py Outdated
Claimable CRV: {gauge.claimable_reward.call(strategy, crv,{"from":
strategy})} ({crv.symbol()})
Gauge Token: {strategy.stakedBalance()} ({gaugeToken.symbol()})
Gauge CRV Balance: {crv.balanceOf(gaugeToken)} ({crv.symbol()})
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added entry to track CRV available in the gauge

)
else:
assert new_params["totalGain"] - prev_params["totalGain"] > donation
assert new_params["totalGain"] - prev_params["totalGain"] >= donation
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to '>=' to include the scenario in which the gauge has no CRV to distribute

gaugeCrvAmount = rewardToken.balanceOf(gauge)

if gaugeCrvAmount == 0:
warn("No CRV in the gauge that can be claimed by gauge token holders.")
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there's no CRV to distribute, we warn the user

warn("No CRV in the gauge that can be claimed by gauge token holders.")
else:
# If there's CRV in the gauge, then we must have a non-zero claim
stratClaimableCrv = gauge.claimable_reward.call(strategy, rewardToken)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there's CRV available in the gauge, the strategy must have a non-zero value to claim

# confirm we made money
assert new_assets > old_assets
# confirm we made money, or at least that we have about the same
assert new_assets >= old_assets
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to '>=' to include the scenario in which the gauge has no CRV to distribute

@pata-eth pata-eth self-assigned this May 17, 2022
@pata-eth pata-eth force-pushed the arbitrum-tricrypto branch from 03d9ecd to ee9c321 Compare May 20, 2022 01:49
@pata-eth
Copy link
Owner Author

@poolpitako, could you please review and approve this PR instead? ===> dudesahn#6
We can delete this one afterwards. Thank you

@pata-eth pata-eth force-pushed the arbitrum-tricrypto branch from ee9c321 to 5a67538 Compare May 22, 2022 17:54
@pata-eth
Copy link
Owner Author

review moved to the following PR: dudesahn#6

@pata-eth pata-eth closed this May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants