Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Convex frxETH/WETH strategy - copy of BaseCurveStrategy & ConvexStrategy #1842

Closed
wants to merge 11 commits into from

Conversation

naddison36
Copy link
Collaborator

@naddison36 naddison36 commented Sep 27, 2023

There are two implementations of the new Convex frxETH/WETH strategy

  1. This one clones BaseCurveStrategy to BaseTwoAssetCurveStrategy and ConvexStrategy to ConvexTwoAssetStrategy
  2. The other uses a library to abstract whether the Curve pool has two or three coins. Convex frxETH/WETH strategy #1846

If you made a contract change, make sure to complete the checklist below before merging it in master.

Refer to our documentation for more details about contract security best practices.

Contract change checklist:

  • Code reviewed by 2 reviewers.
  • Copy & paste code review security checklist below this checklist.
  • Unit tests pass
  • Slither tests pass with no warning
  • Echidna tests pass if PR includes changes to OUSD contract (not automated, run manually on local)

@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-conv-pjsurn September 27, 2023 10:25 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-conv-qu3dar September 27, 2023 10:25 Inactive
@github-actions
Copy link

github-actions bot commented Sep 27, 2023

Warnings
⚠️ 👀 This PR needs at least 2 reviewers

Generated by 🚫 dangerJS against 51f9c41

@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-conv-qu3dar September 27, 2023 11:32 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-conv-pjsurn September 27, 2023 11:32 Inactive
@naddison36 naddison36 changed the base branch from master to nicka/strategy-initialize September 27, 2023 11:33
@naddison36 naddison36 force-pushed the nicka/convex-frxeth-weth-minimal branch from c523a20 to 6a0a4cb Compare September 27, 2023 11:49
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-conv-pjsurn September 27, 2023 11:49 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-conv-qu3dar September 27, 2023 11:49 Inactive
// Set the amount on the asset we want to deposit
_amounts[poolCoinIndex] = _amount;
ICurveMetaPool curvePool = ICurveMetaPool(platformAddress);
uint256 depositValue = _amount.divPrecisely(
Copy link
Member

Choose a reason for hiding this comment

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

BaseCurveStrategy scales the amount by the asset decimals. Should be done here as well I think: https://github.com/OriginProtocol/origin-dollar/pull/1842/files#diff-b64fd0bec03db7ed6bb2701ecb172041e4f1764412109f6def228fab87fed611R48

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

BaseCurveStrategy has to scale USDT and USDC up to 18 decimals to match DAI and the Curve pool LP token.
For the ETH-based Curve pools, all the assets are 18 decimals so they don't need scaling up.
I commented on the contract that the strategy can only be used if all the assets and LP token have the same decimals.
This might get added back if I can make BaseCurveStrategy handle Curve pools with either 2 or 3 assets.

Copy link
Member

Choose a reason for hiding this comment

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

thanks that makes sense

@notion-workspace
Copy link

@naddison36 naddison36 force-pushed the nicka/convex-frxeth-weth-minimal branch from 6a0a4cb to c646b8e Compare September 29, 2023 05:24
@rafaelugolini rafaelugolini temporarily deployed to preview-ousd-nicka-conv-pjsurn September 29, 2023 05:24 Inactive
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-conv-qu3dar September 29, 2023 05:24 Inactive
Base automatically changed from nicka/strategy-initialize to master September 29, 2023 10:19
@rafaelugolini rafaelugolini temporarily deployed to preview-oeth-nicka-conv-qu3dar October 3, 2023 01:34 Inactive
@naddison36 naddison36 changed the title Convex frxETH/WETH strategy WIP: Convex frxETH/WETH strategy - copy of BaseCurveStrategy & ConvexStrategy Oct 3, 2023
@naddison36 naddison36 mentioned this pull request Oct 3, 2023
5 tasks
@naddison36
Copy link
Collaborator Author

Closing this in preference to PR #1846

@naddison36 naddison36 closed this Oct 5, 2023
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.

None yet

3 participants