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

Support sandwiches including multiple pools #199

Merged
merged 1 commit into from Dec 31, 2021
Merged

Conversation

lukevs
Copy link
Collaborator

@lukevs lukevs commented Dec 29, 2021

Fixes this: #198

For sandwiches, the backrun swap doesn't need to be funded by the sandwicher, it just should end up cycling back to their account

@lukevs lukevs requested a review from taarushv December 29, 2021 23:05
@bertmiller
Copy link
Collaborator

bertmiller commented Dec 30, 2021

if ( other_swap.token_in_address == front_swap.token_in_address and other_swap.token_out_address == front_swap.token_out_address and other_swap.from_address != sandwicher_address ): sandwiched_swaps.append(other_swap)
Does this work if it's a sandwich of a Token -> ETH trade and the sandwich needs to go from ETH-> token -> ETH?

In that case the token in of the first swap would be eth, even though the sandwiched trades would be token.

Separately the issue you're solving here lgtm.

@lukevs
Copy link
Collaborator Author

lukevs commented Dec 31, 2021

It'll still work because that ETH => Token => ETH cycle will break into two swaps, and we'll say the "front swap" is the Token => ETH piece

@lukevs
Copy link
Collaborator Author

lukevs commented Dec 31, 2021

@bertmiller said lgtm

@lukevs lukevs merged commit 1ff9e9a into main Dec 31, 2021
@lukevs lukevs deleted the fix-cycle-sandwiches branch December 31, 2021 20:22
mendesfabio pushed a commit to mendesfabio/mev-inspect-py that referenced this pull request Nov 21, 2022
Support sandwiches including multiple pools
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.

None yet

2 participants