Skip to content

Fix hardcoded FX rate in fiat withdrawal service #47

Description

@dotunv

Description

The fiat withdrawal service uses a hardcoded exchange rate instead of the live FX service:

File: internal/fiat/service.go (line 100)

rate := decimal.NewFromInt(1500) // 1 USDC = 1500 NGN

Impact

  • Withdrawals use an outdated/inaccurate exchange rate
  • Users may receive incorrect fiat amounts
  • The FX service exists but is not used in this flow

Proposed Fix

Replace the hardcoded rate with a call to the FX service:

quote, err := fxService.GetQuote(ctx, "USDC", "NGN", amount)
rate := quote.Rate

Acceptance Criteria

  • Fiat withdrawals use live FX rates
  • Hardcoded rate is removed
  • Error handling for FX service failures
  • Tests verify correct rate usage

Labels

bug backend

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26backendBackend / API workbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions