Skip to content

Conversation

lumtis
Copy link
Member

@lumtis lumtis commented Jul 22, 2025

Should address speedrun-hq/speedrun#130

If the pool are not extensively arbitraged or for some other reason the output tokens can be higher than the input.

We initially had a check to revert if the output was bigger but this led the intent from not being settle.

Removing this check will prevent the intent routing from failing. We trust the swap module to return a correct value for the output.

Currently the surplus is assumed to be small enough to not be handled. We can optimize this in the future.

@lumtis lumtis requested a review from s2imonovic July 22, 2025 12:51
@lumtis lumtis linked an issue Jul 22, 2025 that may be closed by this pull request
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@s2imonovic s2imonovic left a comment

Choose a reason for hiding this comment

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

Looks good

@lumtis lumtis merged commit 56be616 into main Jul 22, 2025
2 checks passed
@lumtis lumtis deleted the fix/algebra-swap-surplus branch July 22, 2025 13:19
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.

USDT transfer Avalanche -> Polygon
2 participants