From ce0895eb72cb6e0ab71db764b748d2105127a333 Mon Sep 17 00:00:00 2001 From: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:07:17 +0100 Subject: [PATCH] fix: skip DFX trading limit for RealUnit transactions (#3213) * fix: skip DFX trading limit for RealUnit transactions Aktionariat manages its own limits for REALU, so the general DFX 1000 CHF/month cap should not apply. This prevents 400 errors when users with KYC 30 try to buy/sell REALU for more than 1000 CHF. * refactor: move REALU limit bypass into getLimits method Per review feedback, integrate the RealUnit check directly into getLimits() as a non-static method instead of overriding externally. --- .../payment/services/transaction-helper.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/subdomains/supporting/payment/services/transaction-helper.ts b/src/subdomains/supporting/payment/services/transaction-helper.ts index b673e656cf..cba83c2242 100644 --- a/src/subdomains/supporting/payment/services/transaction-helper.ts +++ b/src/subdomains/supporting/payment/services/transaction-helper.ts @@ -291,7 +291,7 @@ export class TransactionHelper implements OnModuleInit { // get specs (CHF) const specs = this.getMinSpecs(from, to); - const { kycLimit, defaultLimit } = await this.getLimits(paymentMethodIn, paymentMethodOut, user); + const { kycLimit, defaultLimit } = await this.getLimits(from, to, paymentMethodIn, paymentMethodOut, user); const error = this.getTxError( from, @@ -915,10 +915,16 @@ export class TransactionHelper implements OnModuleInit { } private async getLimits( + from: Active, + to: Active, paymentMethodIn: PaymentMethod, paymentMethodOut: PaymentMethod, user?: User, ): Promise<{ kycLimit: number; defaultLimit: number }> { + if (this.isRealUnitTransaction(from, to)) { + return { kycLimit: Number.MAX_VALUE, defaultLimit: Number.MAX_VALUE }; + } + const volume30d = user?.userData.kycLevel < KycLevel.LEVEL_50 ? await this.user30dVolumeCache.get(user.id.toString(), () => @@ -950,6 +956,7 @@ export class TransactionHelper implements OnModuleInit { const isBuy = isFiat(from) && isAsset(to); const isSell = isAsset(from) && isFiat(to); const isSwap = isAsset(from) && isAsset(to); + const isRealUnit = this.isRealUnitTransaction(from, to); if ( user?.wallet.amlRuleList.includes(AmlRule.SKIP_AML_CHECK) && @@ -1012,6 +1019,7 @@ export class TransactionHelper implements OnModuleInit { // verification checks if ( ((isSell && to.name !== 'CHF') || isSwap) && + !isRealUnit && user && !user.userData.hasBankTxVerification && txAmountChf > Config.tradingLimits.monthlyDefaultWoKyc @@ -1033,4 +1041,8 @@ export class TransactionHelper implements OnModuleInit { return currency; } + + private isRealUnitTransaction(from: Active, to: Active): boolean { + return (isAsset(from) && from.name === 'REALU') || (isAsset(to) && to.name === 'REALU'); + } }