-
Notifications
You must be signed in to change notification settings - Fork 84
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
Curve AMO #2370
Curve AMO #2370
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2370 +/- ##
==========================================
- Coverage 52.53% 49.81% -2.73%
==========================================
Files 91 92 +1
Lines 4414 4567 +153
Branches 1162 1202 +40
==========================================
- Hits 2319 2275 -44
- Misses 2092 2289 +197
Partials 3 3 ☔ View full report in Codecov by Sentry. |
Author code reviewRequirementsWhat is the PR trying to do? Is this the right thing? Are there bugs in the requirements? Easy ChecksAuthentication
Ethereum
Cryptographic code
Gas problems
Black magic
Overflow
Proxy
Events
Medium ChecksRounding and casts
Dependencies
External calls
Tests
Deploy
Strategy SpecificRemove this section if the code being reviewed is not a strategy. Strategy checks
Downstream
ThinkingLogicAre there bugs in the logic?
Deployment ConsiderationsAre there things that must be done on deploy, or in the wider ecosystem for this code to work. Are they done?
Internal State
Does this code do that?
AttackWhat could the impacts of code failure in this code be.
What conditions could cause this code to fail if they were not true.
Does this code successfully block all attacks.
FlavorCould this code be simpler? Deployment of this contract need to be a copy from https://github.com/OriginProtocol/origin-dollar/blob/master/contracts/contracts/strategies/ConvexEthMetaStrategy.sol, with as little change as possible. Could this code be less vulnerable to other code behaving weirdly? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The strategy contract shares a lot of similarities with the ConvexEthMetaStrategy
contract. I think we should refactor the common pieces of code into a separate class
@@ -1,1143 +1 @@ | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This abi is required here: https://github.com/OriginProtocol/origin-dollar/blob/master/brownie/world_base.py#L25
# -------------- | ||
|
||
|
||
def _getHarness(name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really cool @DanielVF how you managed to incorporate the graph drawing bit into brownie scripts not requiring the Jupyter notebooks, and transferring data between the 2 environments.
@@ -350,6 +350,14 @@ addresses.base.oethbBribesContract = | |||
|
|||
addresses.base.OZRelayerAddress = "0xc0D6fa24D135c006dE5B8b2955935466A03D920a"; | |||
|
|||
// Base Curve | |||
addresses.base.CRV = "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415"; | |||
addresses.base.OETHb_WETH = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a nice way of grouping the config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this one as well, using it in the future
* feat: set custom maxSlippage. * fix: adjust deployment number. * feat: use safeCast. * fix: adjust commit. * fix: handle when diff before is 0. * fix: use internal function for setMaxSlippage. * fix: simplify initialization. * fix: add test for setMaxSlippage. * feat: add initial fork test for maxSlippage. * fix: reduce MaxSlippage.
|
||
// Ordered list of pool assets | ||
uint128 public constant oethCoinIndex = 1; | ||
uint128 public constant ethCoinIndex = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequirementsPR is creating an AMO strategy on Base using the OToken & WETH assets. Easy ChecksAuthentication
Ethereum
Cryptographic codeno own crypto Gas problemsno loops Black magic
Overflow
Proxy
Events
Medium ChecksRounding and casts
Dependencies
External calls
Tests
Deploy
Strategy SpecificStrategy checks
Downstream
ThinkingLogicAre there bugs in the logic?
Deployment Considerationsnothing special needs to happen on deploy Internal StateThe code makes sure that the AMO position (and pool's self token ratio) in the pool after depositing always has at least 1:1 (OETH : WETH) ratio and in the worst case 2:1 (OETH : WETH) ratio. Does this code do that? AttackIf there were errors in slippage / expected token configurations we could be loosing user funds. For example a faulty FlavorCode is written quite nicely. We've tried to refactor bits of it, but it turned out to be worse. There might be room for improvement, to put some of the more math intensive bits of code into a library. |
Description
Create a new AMO for Base, on Curve.
Almost same AMO as current Convex AMO (on mainnet), with following exceptions:
_solvencyAssert()
from AerodromeAMO logic.Code Change Checklist
To be completed before internal review begins:
Internal review: