skip swaptrade if trade is larger than 2k

OmarHatem committed Sep 23, 2025 at 13:21 UTC bbb9246c5cc2436a8682a1e0a6bbe411d2b75d6c
1 file changed +11 -3
lib/view_model/exchange/exchange_view_model.dart
+11 -3
@@ -669,12 +669,20 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
669 if (limitsState is LimitsLoadedSuccessfully) {
670 if (double.tryParse(amount) == null) continue;
671
672 - if (limits.min != null && double.parse(amount) < limits.min!)
672 + if (limits.min != null && double.parse(amount) < limits.min!) {
673 continue;
674 - else if (limits.max != null && double.parse(amount) > limits.max!)
674 + } else if (limits.max != null && double.parse(amount) > limits.max!) {
675 continue;
676 - else {
676 + } else {
677 try {
678 + if (provider is SwapTradeExchangeProvider) {
679 + final destinationAmount = (fiatConversionStore.prices[request.toCurrency] ?? 0.00) * (double.tryParse(request.toAmount) ?? 0.00);
680 + final sendingAmount = (fiatConversionStore.prices[request.fromCurrency] ?? 0.00) * (double.tryParse(request.fromAmount) ?? 0.00);
681 +
682 + if (destinationAmount > 2000 || sendingAmount > 2000) {
683 + continue;
684 + }
685 + }
686 tradeState = TradeIsCreating();
687 final trade = await provider.createTrade(
688 request: request,