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

Cw 940 reduce impossible api calls to trocador #2050

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Serhii-Borodenko
Copy link
Contributor

@Serhii-Borodenko Serhii-Borodenko commented Feb 24, 2025

Issue Number (if Applicable): Fixes #

Description

Please include a summary of the changes and which issue is fixed / feature is added.

Pull Request - Checklist

  • Initial Manual Tests Passed
  • Double check modified code and verify it with the feature/task requirements
  • Format code
  • Look for code duplication
  • Clear naming for variables and methods

?? initialAmountByAssets(isFixedRateMode ? receiveCurrency : depositCurrency);

final validProvidersForAmount = _tradeAvailableProviders.where((provider) {
final limits = _providerLimits[provider];
Copy link
Contributor

Choose a reason for hiding this comment

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

_providerLimits would still be empty on the first call of calculateBestRate, thus it will not fetch any best rate until the user enters an amount
let's better handle this, I believe calling calculateBestRate inside of loadLimits, should work.
but Note, that we should remove it from other places were they are called together, so we avoid repeated calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants