perf(bg/PaymentSession): fewer quote requests using exchange rate#1056
Merged
Conversation
sidvishnoi
commented
May 15, 2025
Contributor
Extension builds preview
|
DarianM
approved these changes
May 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Part of #976
Changes proposed in this pull request
When sending cross currency payments (specially from higher to lower exchange rate, e.g. MXN to USD (0.19MXN = 0.01USD)), make use of exchange rate and use it as the starting point for probing.
When sending from MXN to USD, there's now a single (1) quote instead of 6.
This won't be needed when we get with interledger/rafiki#3411 available across wallets.
This also gives us a more accurate minSendAmount, as otherwise with current exponential probing, we may end up trying to send 1,2,4,8,16,32 units, instead of something in between (19 here).
The exchange rates are cached for 15min as we don't want to fetch them for each session.