fix(indexer): keep candle USD as-of quote and mark idle bars #1101

Merged
PlasticDigits merged 3 commits from fix/568-candle-usd-mark-to-market into main 2026-08-20 03:23:49 +00:00
PlasticDigits commented 2026-08-20 02:17:44 +00:00 (Migrated from gitlab.com)

Summary

  • Stop hub refresh from rewriting historical swap_events.price_usd and candle USD to the live hub tick (the as-of-now flatten on Charts Price (USD)).
  • After the live hub_prices snapshot, write idle mark-to-market bars on catalog-quoted factory pairs (usd = last_human × as-of quote USD, trade_count = 0, zero volume).
  • One-shot SQL repair rebuilds USTC/LUNC-quoted history from oracle_prices as-of timestamp. UST1/USTR-quoted history cannot be replayed (no hub time series).

Closes #568.

Test plan

  • make verify-issue-568 (docs, source, lib, integration, frontend)
  • Related ladders: verify-issue-556 verify-issue-543 verify-issue-522 verify-issue-515
  • cargo test --test candle_usd_mark --test api_hub_prices --test candle_human_usd --test candle_skip_zero_price -- --test-threads=1
  • Frontend priceChartCandles.test.ts + tradePairDisplayOrientation.test.ts
  • Quiet-window USTC move on columbus-5 (prod QA; inverted UST1/cUSTC should track CEX USTC)
  • Optional: verify-issue-524 / verify-issue-548 (not in the #568 related chain; invert and overview USD rules are unchanged)
## Summary - Stop hub refresh from rewriting historical `swap_events.price_usd` and candle USD to the live hub tick (the as-of-now flatten on Charts Price (USD)). - After the live `hub_prices` snapshot, write idle mark-to-market bars on catalog-quoted factory pairs (`usd = last_human × as-of quote USD`, `trade_count = 0`, zero volume). - One-shot SQL repair rebuilds USTC/LUNC-quoted history from `oracle_prices` as-of timestamp. UST1/USTR-quoted history cannot be replayed (no hub time series). Closes #568. ## Test plan - [x] `make verify-issue-568` (docs, source, lib, integration, frontend) - [x] Related ladders: `verify-issue-556` `verify-issue-543` `verify-issue-522` `verify-issue-515` - [x] `cargo test --test candle_usd_mark --test api_hub_prices --test candle_human_usd --test candle_skip_zero_price -- --test-threads=1` - [x] Frontend `priceChartCandles.test.ts` + `tradePairDisplayOrientation.test.ts` - [ ] Quiet-window USTC move on columbus-5 (prod QA; inverted UST1/cUSTC should track CEX USTC) - [ ] Optional: `verify-issue-524` / `verify-issue-548` (not in the #568 related chain; invert and overview USD rules are unchanged)
PlasticDigits commented 2026-08-20 02:31:50 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 1a18a620 - test(qa): run #568 lib filters for candle_mark and merge_ohlc

Compare with previous version

added 1 commit <ul><li>1a18a620 - test(qa): run #568 lib filters for candle_mark and merge_ohlc</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/383/diffs?diff_id=1972489663&start_sha=a9041b0b412b823d2846c1fa9d68ff7625798337)
PlasticDigits commented 2026-08-20 02:31:51 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
PlasticDigits commented 2026-08-20 03:23:46 +00:00 (Migrated from gitlab.com)

added 13 commits

  • 1a18a620...704e5b97 - 12 commits from branch main
  • 43515da3 - Merge origin/main into fix/568-candle-usd-mark-to-market.

Compare with previous version

added 13 commits <ul><li>1a18a620...704e5b97 - 12 commits from branch <code>main</code></li><li>43515da3 - Merge origin/main into fix/568-candle-usd-mark-to-market.</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/383/diffs?diff_id=1972535861&start_sha=1a18a62011faf4451ef176aae5fec797069bc464)
PlasticDigits (Migrated from gitlab.com) merged commit 38c5252de3 into main 2026-08-20 03:23:49 +00:00
PlasticDigits commented 2026-08-20 03:23:52 +00:00 (Migrated from gitlab.com)

mentioned in commit 38c5252de3

mentioned in commit 38c5252de3582f12601fc30b0943cfbc6a6c472c
PlasticDigits commented 2026-08-20 03:54:23 +00:00 (Migrated from gitlab.com)

mentioned in issue #568

mentioned in issue #568
PlasticDigits commented 2026-08-20 03:54:52 +00:00 (Migrated from gitlab.com)

mentioned in issue #583

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