Skip to content

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

Draft
shreyaspapi wants to merge 1 commit intoRicochet-Exchange:v2from
shreyaspapi:op-eth
Draft

[BUG] Fix swap method for ETH>>USDC market on Optimism#150
shreyaspapi wants to merge 1 commit intoRicochet-Exchange:v2from
shreyaspapi:op-eth

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