Skip to content

fix: use Olkypay as default bank for fiat bank transfers#3863

Closed
TaprootFreak wants to merge 4 commits into
developfrom
fix/bank-fee-default-olky
Closed

fix: use Olkypay as default bank for fiat bank transfers#3863
TaprootFreak wants to merge 4 commits into
developfrom
fix/bank-fee-default-olky

Conversation

@TaprootFreak

@TaprootFreak TaprootFreak commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • getDefaultBankByPaymentMethod(BANK) returned Yapeal (2% bank fee) instead of Olkypay (0.5%), causing the frontend to display inflated bank fees in EUR buy quotes
  • Changed default from IbanBankName.YAPEAL to IbanBankName.OLKY to match the actual receiving bank (LU116060002000005040 = Olkypay)
  • With Yapeal default, a 300 EUR buy showed 7€ bank fee; actual Olkypay execution only charges 2.50€

Test plan

  • yarn lint clean
  • yarn format:check clean
  • yarn build clean
  • yarn test -- --testPathPattern=transaction-helper — 6/6 pass

This reverts commit bd6296f. The change was unnecessary:
sell flow uses paymentMethodIn=CRYPTO, so Bank fees are never collected
(fee.service.ts:391-394). bankOut does not affect sell fee calculation.

@davidleomay davidleomay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This one-line fix is correct, but the underlying issue is that getDefaultBankByPaymentMethod uses a hardcoded constant while the actual receiving bank is determined dynamically by BankService.getBank(selector) at execution time. These can diverge — the next time a new EUR bank is added, the hardcoded default will be wrong again.

BankService.getBank takes { currency, paymentMethod } and matches a receive bank from the DB — exactly the information already available at each call site (from for currency, paymentMethodIn for method). Consider:

  • Injecting BankService into TransactionHelper (no circular dependency — bank module doesn't import TransactionHelper)
  • Using (await bankService.getBank({ currency, paymentMethod })).name for BANK/INSTANT cases instead of hardcoding
  • Keeping CARD hardcoded (Checkout is a card processor, not a bank entity)

That way the fee quote always uses the same bank the system routes to at execution time.

static getDefaultBankByPaymentMethod(paymentMethod: PaymentMethod): CardBankName | IbanBankName {
switch (paymentMethod) {
case FiatPaymentMethod.BANK:
return IbanBankName.YAPEAL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This fix corrects the bank name, but getDefaultBankByPaymentMethod still uses a hardcoded constant while BankService.getBank(selector) dynamically matches the actual receiving bank from the DB. When the next EUR bank is added, this default will be stale again.

Could instead call bankService.getBank({ currency, paymentMethod }) for BANK and INSTANT cases — all the needed info (from/currency, paymentMethodIn) is already available at each call site. The CARD case would stay hardcoded since Checkout is a card processor, not a bank entity.

Replace hardcoded getDefaultBankByPaymentMethod(BANK) with dynamic
BankService.getBank() lookup that matches the actual receive bank at
execution time. This ensures fee quotes always use the same bank the
system routes payments to, regardless of which bank is configured as
the receive bank for a given currency.

Call sites updated in buy/sell controllers and getTxDetails.

@davidleomay davidleomay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#3864 handles vIBAN resolution (active vIBANs → their bank) which this PR doesn't cover. Once #3864 lands with the EUR/vIBAN-eligible fixes, this PR's approach is subsumed — both fall through to bankService.getBank for the non-vIBAN case. Recommend closing in favor of #3864.

@TaprootFreak

Copy link
Copy Markdown
Collaborator Author

Superseded by #3864 which additionally handles vIBAN resolution.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants