fix: invert Price (USD) candles with invertUsd, not 1/x (#543) #1069

Merged
PlasticDigits merged 1 commit from fix/543-usd-candle-invert into main 2026-08-17 04:44:06 +00:00
PlasticDigits commented 2026-08-17 04:13:12 +00:00 (Migrated from gitlab.com)

Summary

  • USD candles on /trade and /charts now invert with invertUsd (factory_usd / human per bar) so Last and the candle pane show the same displayed-base dollars.
  • Indexer candle JSON keeps factory USD in open/high/low/close (no human fallback) and adds *_human for per-bar invert. Bars without price_usd are omitted.
  • Adaptive USD priceFormat so $0.000047 / $0.012258 are readable (not fixed 2-dp 0.00).

Closes #543.

Test plan

  • make verify-issue-543 (unit A1–A9 / H1–H3 + docs/skill grep + indexer rebuild)
  • make verify-issue-524 still green
  • Real-library charts invert cases (USTR-scale last close ≈ 0.012, cLUNC format ≠ 0.00)
  • Manual /trade + /charts smoke on columbus-5: UST1/USTR, UST1/cUSTC, cLUNC/UST1, both pill orientations
  • After indexer migrate/rebuild, confirm GET /candles has *_human and USD ~1 on UST1/USTR
## Summary - USD candles on `/trade` and `/charts` now invert with `invertUsd` (`factory_usd / human` per bar) so Last and the candle pane show the same displayed-base dollars. - Indexer candle JSON keeps factory USD in `open/high/low/close` (no human fallback) and adds `*_human` for per-bar invert. Bars without `price_usd` are omitted. - Adaptive USD `priceFormat` so `$0.000047` / `$0.012258` are readable (not fixed 2-dp `0.00`). Closes #543. ## Test plan - [x] `make verify-issue-543` (unit A1–A9 / H1–H3 + docs/skill grep + indexer rebuild) - [x] `make verify-issue-524` still green - [x] Real-library charts invert cases (USTR-scale last close ≈ `0.012`, cLUNC format ≠ `0.00`) - [ ] Manual `/trade` + `/charts` smoke on columbus-5: UST1/USTR, UST1/cUSTC, cLUNC/UST1, both pill orientations - [ ] After indexer migrate/rebuild, confirm GET `/candles` has `*_human` and USD ~1 on UST1/USTR
PlasticDigits commented 2026-08-17 04:44:07 +00:00 (Migrated from gitlab.com)

mentioned in commit f53e3bf768

mentioned in commit f53e3bf768b325dbbbef4e494dac8784f754c4a2
PlasticDigits (Migrated from gitlab.com) merged commit f53e3bf768 into main 2026-08-17 04:44:07 +00:00
PlasticDigits commented 2026-08-17 04:53:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #543

mentioned in issue #543
PlasticDigits commented 2026-08-17 04:53:45 +00:00 (Migrated from gitlab.com)

mentioned in issue #541

mentioned in issue #541
PlasticDigits commented 2026-08-17 04:53:46 +00:00 (Migrated from gitlab.com)

mentioned in issue #542

mentioned in issue #542
PlasticDigits commented 2026-08-17 04:53:58 +00:00 (Migrated from gitlab.com)

mentioned in issue #545

mentioned in issue #545
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!1069
No description provided.