fix: humanize Charts pair 24h volume and TWAP for mixed decimals #1088

Merged
PlasticDigits merged 2 commits from fix/564-charts-vol-twap-human into main 2026-08-19 02:05:21 +00:00
PlasticDigits commented 2026-08-19 01:02:27 +00:00 (Migrated from gitlab.com)

Summary

  • Charts pair 24h Stats now humanizes raw volume_base / volume_quote with the pair row’s decimals (formatPairStatsVolume) and shows Vol (USD) from indexer volume_usd.
  • TWAP 5m/1h/24h is human quote-per-base (raw × 10^(d0−d1) + formatPairPrice), not compact T on the raw Decimal. USD OHLC uses formatPairPrice (no compact T).
  • Candle volume histogram on /charts and /trade scales quote (else base) by pair-leg decimals. Indexer JSON units stay raw.

Closes #564

Test plan

  • make verify-issue-564
  • /charts UST1/USTR: Vol (UST1) hundreds-not-millions; Vol (USTR) K not T; TWAP ~111 class not 111T
  • UST1/cUSTC 6/6: vols readable; TWAP ~1 class if reserves ~1:1
  • Vol (USD) unpriced + trades → —; idle 0 trades → $0
  • /trade UST1/USTR volume pane is not 1e18 scale
  • Overview 24h Volume (USD) and catalog vol badges unchanged (#548 / #534)
## Summary - Charts pair **24h Stats** now humanizes raw `volume_base` / `volume_quote` with the pair row’s decimals (`formatPairStatsVolume`) and shows **Vol (USD)** from indexer `volume_usd`. - **TWAP 5m/1h/24h** is human quote-per-base (`raw × 10^(d0−d1)` + `formatPairPrice`), not compact `T` on the raw Decimal. USD OHLC uses `formatPairPrice` (no compact `T`). - Candle volume histogram on `/charts` and `/trade` scales quote (else base) by pair-leg decimals. Indexer JSON units stay raw. Closes #564 ## Test plan - [ ] `make verify-issue-564` - [ ] `/charts` UST1/USTR: Vol (UST1) hundreds-not-millions; Vol (USTR) `K` not `T`; TWAP ~111 class not `111T` - [ ] UST1/cUSTC 6/6: vols readable; TWAP ~1 class if reserves ~1:1 - [ ] Vol (USD) unpriced + trades → `—`; idle 0 trades → `$0` - [ ] `/trade` UST1/USTR volume pane is not 1e18 scale - [ ] Overview 24h Volume (USD) and catalog vol badges unchanged (#548 / #534)
PlasticDigits commented 2026-08-19 02:05:17 +00:00 (Migrated from gitlab.com)

added 17 commits

  • 3c412e9a...8515da19 - 16 commits from branch main
  • 94278ff6 - Merge origin/main into fix/564-charts-vol-twap-human.

Compare with previous version

added 17 commits <ul><li>3c412e9a...8515da19 - 16 commits from branch <code>main</code></li><li>94278ff6 - Merge origin/main into fix/564-charts-vol-twap-human.</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/370/diffs?diff_id=1969758818&start_sha=3c412e9a2bcb45182da89b0e05c5114fc9a7d8a9)
PlasticDigits commented 2026-08-19 02:05:21 +00:00 (Migrated from gitlab.com)

mentioned in commit e9a6270966

mentioned in commit e9a627096668d4f963a9ebc4ef1a1c9687c5946f
PlasticDigits (Migrated from gitlab.com) merged commit e9a6270966 into main 2026-08-19 02:05:21 +00:00
PlasticDigits commented 2026-08-19 02:16:49 +00:00 (Migrated from gitlab.com)

mentioned in issue #564

mentioned in issue #564
PlasticDigits commented 2026-08-19 02:16:56 +00:00 (Migrated from gitlab.com)

mentioned in issue #565

mentioned in issue #565
PlasticDigits commented 2026-08-19 02:28:46 +00:00 (Migrated from gitlab.com)

mentioned in issue #573

mentioned in issue #573
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1088
No description provided.