-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(adapter): Add Curve trade adapter [SIM-173] #238
feat(adapter): Add Curve trade adapter [SIM-173] #238
Conversation
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.
Thanks so much for this @FlattestWhite. Really nice :)
I think one thing that would be helpful to improve my understanding of this is to see it running in a forked integration test that models the icETH rebalance flow more closely.
contracts/protocol/integration/exchange/CurveStEthExchangeAdapter.sol
Outdated
Show resolved
Hide resolved
contracts/protocol/integration/exchange/CurveStEthExchangeAdapter.sol
Outdated
Show resolved
Hide resolved
contracts/protocol/integration/exchange/CurveStEthExchangeAdapter.sol
Outdated
Show resolved
Hide resolved
contracts/protocol/integration/exchange/CurveStEthExchangeAdapter.sol
Outdated
Show resolved
Hide resolved
await setup.issuanceModule.connect(manager.wallet).initialize(setToken.address, mockPreIssuanceHook.address); | ||
|
||
issueQuantity = ether(1); | ||
await setup.issuanceModule.connect(owner.wallet).issue(setToken.address, issueQuantity, owner.address); |
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.
Fails at this step with "Invalid post transfer balance". Works perfectly fine with WETH, but with steth, it fails. @cgewecke any advice here?
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.
@FlattestWhite Will take a look...
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.
@FlattestWhite I've updated the integration tests in this commit: f085d6c
You'll need to run git pull
to update your local copy with new commits. (Also I had to rebase against master because another adapter went in on Friday and there were merge conflicts.)
There's still something we need an explanation for. (Maybe you could ask Noah about this...)
If you look at the new tests (which are based the existing ALM tests for lever and delever) ... two delever tests are skipped because an unexpected surplus of wETH is left in the Set after repaying the borrow.
Why? Is this something to do with Lido Curve?
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.
@bweick You asked in slack that we "make sure there's no issues with token balances being held or locked on the adapter". I don't see any logic that might result in that and have added tests for #lever and #delever which verify that the adapter does not have any persistent balances of ETH, wETH, or stETH here and here
Just lmk if there are any other checks you think would be helpful here...
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.
@cgewecke I looked into why there is a surplus of wETH left in the set after repaying the borrow.
The reason is:
- The exchange rate fluctuating on curve pool as liquidity is added/removed and tokens are borrowed and repayed. This means there's a tiny difference exchange rate in each trade (1.001) or so. Wrapping and unwrapping weth also consumes some eth. This means in the tests we're actually overreedeming the amount of astETH required to repay the debt leading to a surplus of WETH left in the set token.
By reducing the amount we're redeeming by a little bit, we get much much closer to the expected zero.
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.
@FlattestWhite Ah thanks so much! Ok that makes sense.
2ec66c2
to
73cc58b
Compare
@@ -3963,7 +3963,7 @@ cli-cursor@^3.1.0: | |||
dependencies: | |||
restore-cursor "^3.1.0" | |||
|
|||
cli-table3@^0.6.1: | |||
cli-table3@^0.6.0, cli-table3@^0.6.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.
Sorry I guess we should leave these yarn.lock changes in ... somehow the version on master is wrong and doesn't result in the correct file when installing locally. They need to be re-synced (via this PR).
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.
After looking at the integration tests again I don't think the unexpected results have anything to do with the trade adapter's correctness per se. Ultimately whoever uses this in combination with the ALM will need to test their flow extensively and understand exactly how lever
and delever
play out in practice when trading on Curve.
The main thing is that it's a) usable and b) does leave any trading proceeds trapped in the adapter.
Am going to approve this and proceed with deployment.
🎉 This PR is included in version 0.8.0-hhat.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [0.8.0](v0.7.0...v0.8.0) (2022-04-06) ### Features * **adapter:** Add Curve trade adapter [SIM-173] ([#238](#238)) ([f697783](f697783))
// Expectation is failing (also impacts skipped exchange balance tests below) | ||
// wETH PositionUnit still has 49_086_919_796_567_154 (instead of zero); | ||
expect(newSecondPosition.unit).to.eq(expectedSecondPositionUnit); | ||
expect(newSecondPosition.module).to.eq(aaveLeverageModule.address); |
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.
Shouldn't this be ADDRESS_ZERO after everything's been repaid?
# 1.0.0 (2022-10-04) ### Bug Fixes * **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94)) * add proper tests, require statements for sellTokenForToken ([5c84995](5c84995)) * address review feedback ([5c6fcfc](5c6fcfc)) * **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2)) * **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84)) * **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4)) * **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37)) * **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1)) * **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38)) * **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147)) * **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243) * **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963)) * remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d)) * sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3)) * **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b)) * **tests:** Add Hardhat deployment subgraph test scripts ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14)) * **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04)) ### Features * **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783)) * **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab)) * add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e)) * **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392)) * **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a)) * implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e)) * initial stab at Uniswap V3 adaptor ([c25665b](c25665b)) * **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322)) * **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46)) * **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1)) * **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c)) * **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca)) * verify path for multiple hops ([06ca9b6](06ca9b6)) * verify uniswap path for single hops WIP ([7905d73](7905d73))
# 1.0.0 (2022-10-04) ### Bug Fixes * **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94)) * add proper tests, require statements for sellTokenForToken ([5c84995](5c84995)) * address review feedback ([5c6fcfc](5c6fcfc)) * **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2)) * **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84)) * **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4)) * **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37)) * **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1)) * **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38)) * **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147)) * **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243) * **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963)) * remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d)) * sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3)) * **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b)) * **tests:** Add Hardhat deployment subgraph test scripts ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14)) * **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04)) ### Features * **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783)) * **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab)) * add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e)) * **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392)) * **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a)) * implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e)) * initial stab at Uniswap V3 adaptor ([c25665b](c25665b)) * **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322)) * **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46)) * **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1)) * **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c)) * **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca)) * verify path for multiple hops ([06ca9b6](06ca9b6)) * verify uniswap path for single hops WIP ([7905d73](7905d73))
# 1.0.0 (2022-10-05) ### Bug Fixes * **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94)) * add proper tests, require statements for sellTokenForToken ([5c84995](5c84995)) * address review feedback ([5c6fcfc](5c6fcfc)) * **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2)) * **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84)) * **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4)) * **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37)) * **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1)) * **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38)) * **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147)) * **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243) * **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963)) * remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d)) * sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3)) * **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b)) * **tests:** Add Hardhat deployment subgraph test scripts ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14)) * **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04)) ### Features * **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783)) * **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab)) * add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e)) * **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392)) * **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a)) * implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e)) * initial stab at Uniswap V3 adaptor ([c25665b](c25665b)) * **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322)) * **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46)) * **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1)) * **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c)) * **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca)) * verify path for multiple hops ([06ca9b6](06ca9b6)) * verify uniswap path for single hops WIP ([7905d73](7905d73))
# 1.0.0 (2022-10-05) ### Bug Fixes * **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94)) * add proper tests, require statements for sellTokenForToken ([5c84995](5c84995)) * address review feedback ([5c6fcfc](5c6fcfc)) * **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2)) * **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84)) * **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4)) * **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37)) * **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1)) * **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38)) * **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147)) * **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243) * **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963)) * remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d)) * sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3)) * **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b)) * **tests:** Add Hardhat deployment subgraph test scripts ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14)) * **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04)) ### Features * **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783)) * **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab)) * add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e)) * **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392)) * **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a)) * implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e)) * initial stab at Uniswap V3 adaptor ([c25665b](c25665b)) * **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322)) * **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46)) * **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1)) * **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c)) * **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca)) * verify path for multiple hops ([06ca9b6](06ca9b6)) * verify uniswap path for single hops WIP ([7905d73](7905d73))
# 1.0.0 (2022-10-05) ### Bug Fixes * **adapter:** Support Curve stableswap pools ([SetProtocol#253](https://github.com/IndexCoop/index-protocol/issues/253)) ([777ed94](777ed94)) * add proper tests, require statements for sellTokenForToken ([5c84995](5c84995)) * address review feedback ([5c6fcfc](5c6fcfc)) * **build:** Upgrade eslint-plugin-jsdoc to latest ([SetProtocol#228](https://github.com/IndexCoop/index-protocol/issues/228)) ([f5758d2](f5758d2)) * **interfaces:** add IAirdropModule, IClaimModule, and IWrapModuleV2 ([SetProtocol#252](https://github.com/IndexCoop/index-protocol/issues/252)) ([6999e84](6999e84)) * **interfaces:** Add protocol interfaces for set-v2-strategies [SIM-124] ([SetProtocol#226](https://github.com/IndexCoop/index-protocol/issues/226)) ([0bd5ca4](0bd5ca4)) * **IPerpV2BasisTradingModule:** Improve javadocs [SetProtocol#246](https://github.com/IndexCoop/index-protocol/issues/246) ([3129b37](3129b37)) * **NotionalTradeModule:** audit adjustments ([de39ee1](de39ee1)) * **PerpV2BasisTradingModule:** bytecode size limit bug ([SetProtocol#200](https://github.com/IndexCoop/index-protocol/issues/200)) ([ddfab38](ddfab38)) * **PerpV2BasisTradingModule:** Expose getter to fetch updated settled funding ([SetProtocol#244](https://github.com/IndexCoop/index-protocol/issues/244)) ([f215147](f215147)) * **PerpV2BasisTradingModule:** External audit fixes for low-risk findings and Internal audit fixes ([SetProtocol#232](https://github.com/IndexCoop/index-protocol/issues/232)) ([d7d37da](d7d37da)), closes [SetProtocol#243](https://github.com/IndexCoop/index-protocol/issues/243) * **PerpV2LeverageModuleV2:** Round up during withdraw ([SetProtocol#249](https://github.com/IndexCoop/index-protocol/issues/249)) ([7780963](7780963)) * remove incorrect require check for sellEthForTokenToUniswapV3 ([7f8048d](7f8048d)) * sellEthForTokenToUniswapV3 impl and address review comments ([73ea7b3](73ea7b3)) * **SlippageIssuanceModule:** Fix issuance & redemption flows to not update position units ([SetProtocol#254](https://github.com/IndexCoop/index-protocol/issues/254)) ([9be3d1b](9be3d1b)) * **tests:** Add Hardhat deployment subgraph test scripts ([SetProtocol#242](https://github.com/IndexCoop/index-protocol/issues/242)) ([0aa0d14](0aa0d14)) * **utils:** Port StringArrayUtils from set-v2-strategies [SIM-124] ([SetProtocol#227](https://github.com/IndexCoop/index-protocol/issues/227)) ([dbf6c04](dbf6c04)) ### Features * **adapter:** Add Curve trade adapter [SIM-173] ([SetProtocol#238](https://github.com/IndexCoop/index-protocol/issues/238)) ([f697783](f697783)) * **adapter:** Add RGT to Tribe migration adapter [SIM-52] ([SetProtocol#188](https://github.com/IndexCoop/index-protocol/issues/188)) ([ca5c2ab](ca5c2ab)) * add direct RFQT fill suport to ZeroExApiAdapter [SIM-230] ([SetProtocol#241](https://github.com/IndexCoop/index-protocol/issues/241)) ([f4b976e](f4b976e)) * **BytesArrayUtils:** Add BytesArrayUtils library ([SetProtocol#248](https://github.com/IndexCoop/index-protocol/issues/248)) ([7b35392](7b35392)) * **deprecation:** Consolidate or remove deprecated contracts [SIM-124] ([SetProtocol#225](https://github.com/IndexCoop/index-protocol/issues/225)) ([579852a](579852a)) * implement sellTokenForEthToUniswapV3 and sellEthForTokenToUniswapV3 ([2296f6e](2296f6e)) * initial stab at Uniswap V3 adaptor ([c25665b](c25665b)) * **Intefaces:** Add basis trading module interfaces ([SetProtocol#237](https://github.com/IndexCoop/index-protocol/issues/237)) ([c7af322](c7af322)) * **module:** Notional Trade Module ([SetProtocol#251](https://github.com/IndexCoop/index-protocol/issues/251)) ([49bdf46](49bdf46)) * **publishing:** Auto publish repository to npm in CI [SIM-123] ([SetProtocol#203](https://github.com/IndexCoop/index-protocol/issues/203)) ([8ddbbf1](8ddbbf1)) * **reorg:** Re-org modules into v1 and v2 directories ([SetProtocol#230](https://github.com/IndexCoop/index-protocol/issues/230)) ([d43df0c](d43df0c)) * **UniswapV3ExchangeAdapterV2:** Add UniswapV3ExchangeAdapterV2 exchange adapter ([SetProtocol#240](https://github.com/IndexCoop/index-protocol/issues/240)) ([b4d95ca](b4d95ca)) * verify path for multiple hops ([06ca9b6](06ca9b6)) * verify uniswap path for single hops WIP ([7905d73](7905d73))
Review Resources
TODO
Remove yarn.lock changesicETH which is made up of stETH and WETH will be executing its rebalances using AaveLeverageModule and CurveStEthStableswap pool. It will deposit stETH as collateral in Aave minting astETH and borrow WETH using deposited stETH as collateral. The WETH will then be swapped to stETH using the Curve stETH pool.