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

[BUG] Fix swap method for ETH>>USDC market on Optimism #150

Draft
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

shreyaspapi
Copy link
Collaborator

Description

The swap method for the ETH>>USDC market is currently not working on Optimism. This PR adds a try-catch block to the swap method to check if the downgrade method is available, which should fix the issue.

@mikeghen mikeghen marked this pull request as draft April 29, 2023 13:39
Copy link
Contributor

@mikeghen mikeghen left a comment

Choose a reason for hiding this comment

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

@shreyaspapi, I can simulate this in tenderly. If you can take a further look at the tests to get it working with optimism, that would be a huge help. Eventually Id like to be able to run tests against all the networks for all the markets, a comprehensive integration test, you see what I mean?

ISETHCustom(address(inputToken)).downgradeToETH(
inputToken.balanceOf(address(this))
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, this is how I had it in mind, downgrade is the common case so try that first, if that method doesn't exist use downgradeToETH

@shreyaspapi shreyaspapi changed the title [Don't merge][BUG] Fix swap method for ETH>>USDC market on Optimism [BUG] Fix swap method for ETH>>USDC market on Optimism Apr 29, 2023
@mikeghen
Copy link
Contributor

@shreyaspapi, I think I have a good solution, maybe swap the left over tokens to RIC and the IDA distribute the RIC? Something to consider. I also think implementing checker method rather than a timed gelato task would be an improvement, won't get rid of the change issue, but will reduce it.

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