You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
As a developer testing out the uniswap SDK, when an error is raised because the input amount I provided is too low, instead of returning that and surfacing it up to me. The SDK just swallows it and silently carries before another part of my code blows up.
Pair.getOutputAmount can throw the InsufficientInputAmount error when a swap would result in 0 output, the involvesToken invariant, as well as the InsufficientReservesError are already checked before that. In all cases it makes sense to consider this Pair as invalid and continue with the loop. If all pairs are invalid, the result of the recursive function will just be an empty Array.
royalaid
pushed a commit
to royalaid/qidao-sdk
that referenced
this issue
Feb 7, 2024
As a developer testing out the uniswap SDK, when an error is raised because the input amount I provided is too low, instead of returning that and surfacing it up to me. The SDK just swallows it and silently carries before another part of my code blows up.
Why do we do that?
https://github.com/Uniswap/uniswap-v2-sdk/blob/main/src/entities/trade.ts#L266
The text was updated successfully, but these errors were encountered: