Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • A Ahad Mobile
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • holatech
  • Ahad Mobile
  • Merge requests
  • !101

feat(admin): round blockchain amounts for display

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Khanh Pham requested to merge feat/admin-amount-display into develop Oct 06, 2026
  • Overview 0
  • Commits 7
  • Pipelines 1
  • Changes 29

Summary

Display-only rounding for blockchain amounts in the admin console. Amounts arrive as decimal strings with up to 18 fraction digits (lending returns toFixed(18)), so tables scrolled sideways and stat cards overflowed.

  • New formatDisplayAmount (admin/src/lib/format/display-amount.ts) and <Amount> (admin/src/components/amount.tsx), string-only, never Number().
  • ROUND_DOWN (matches the backend and wallets: never show more than is held).
  • Per-asset display decimals: fiat/stablecoins 2 (padded), BTC 8, ETH 6, SOL 4, others 6; crypto trims trailing zeros; min(table, market.decimals) when known.
  • Values below 1 keep 4 significant digits (max 8 dp); dust shows < 0.00000001 / < 0.01; never -0.
  • When rounded, the title carries the full value for reconciliation.
  • Applied to ramp (convert), lending (markets, market detail, risk) and cards/user detail. Removed the lossy ramp-format.formatAmount (Number + Intl, lost digits past ~15).

Kept exact on purpose: forms and API payloads, market version diffs, audit, ramp fee band config, ramp rebalance shortfall and rail floor (ops acts on them), the lending withdraw "≤ available" hint.

Behaviour changes: card amounts were half-up at 2 dp, now round down. USDC/USDT/DAI lending markets show 2 dp instead of 6.

Test plan

  • pnpm test (571 tests), pnpm type-check, pnpm lint:check (0 errors)
  • Mutation check: switching truncation to half-up fails 21 tests
  • Opus review gate: PASS after 2 rounds (round 2 NITs fixed in 78559572)
  • Local admin: lending markets / market detail / convert / cards render short amounts with full-value tooltips, no horizontal page overflow

🤖 Generated with Claude Code

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feat/admin-amount-display