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

👷 Odos integration #56

Merged
merged 35 commits into from
Dec 5, 2024
Merged

👷 Odos integration #56

merged 35 commits into from
Dec 5, 2024

Conversation

moss-eth
Copy link
Collaborator

changed swap logic from Uniswap to Odos

@moss-eth moss-eth changed the base branch from main to octopus October 28, 2024 20:03
@moss-eth moss-eth marked this pull request as ready for review October 30, 2024 13:38
@Flocqst Flocqst self-requested a review November 2, 2024 02:42
Copy link
Collaborator

@Flocqst Flocqst left a comment

Choose a reason for hiding this comment

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

odosSwap return value design needs to be updated for unwind process - separate PR incoming with the fix

src/Zap.sol Outdated
@@ -510,7 +505,7 @@ contract Zap is Reentrancy, Errors, Flush(msg.sender) {
// whatever collateral amount is remaining is returned to the caller
unwound -= _collateral == USDC
? _flashloan
: _swapFor(_collateral, _path, _flashloan, _swapMaxAmountIn);
: odosSwap(_collateral, _swapAmountIn, _path);
Copy link
Collaborator

Choose a reason for hiding this comment

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

odosSwap returns USDC amount out, when in this case we need the collateral amount spent in the swap (in this case _swapAmountIn), otherwise this incorrectly subtracts from unwound balance the USDC amount instead of spent collateral amount

@Flocqst
Copy link
Collaborator

Flocqst commented Nov 2, 2024

#57

Flocqst and others added 9 commits November 4, 2024 05:54
* 👷 fix: odos unwind swap return

* fix

* ✨ fmt

---------

Co-authored-by: Moss <[email protected]>
* 👷 refund logic

* ✅ unwind test
* 📚 first round of fixes

* 👷 fix 2
* 👷 fix leftovers

* fmt

---------

Co-authored-by: Moss <[email protected]>
* 👷 zapOut when unwinding USDC

* fix make deploy_base

* 👷 adjust minAmountOut to match usdc 6 decimal precision when unwinding udsc
@moss-eth moss-eth merged commit c8292c5 into octopus Dec 5, 2024
2 checks passed
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