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

Closed
PlasticDigits wants to merge 0 commits from 568-fix-charts-price-usd-history-flattened-to-live-hub-mark-idle-ustc-ust1-never-mark-to-market into main
PlasticDigits commented 2026-08-20 02:17:15 +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

  • VERIFY_ISSUE_568_SKIP_RELATED=1 make verify-issue-568
  • 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
  • make verify-issue-568 related 556/543/522/515 on a dedicated test DB (shared dex_indexer_test collided with in-flight #569 migration 20260820120000)
  • Quiet-window USTC move on columbus-5 (prod QA; inverted UST1/cUSTC should track CEX USTC)

Closes #568

## 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] `VERIFY_ISSUE_568_SKIP_RELATED=1 make verify-issue-568` - [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` - [ ] `make verify-issue-568` related 556/543/522/515 on a dedicated test DB (shared `dex_indexer_test` collided with in-flight #569 migration `20260820120000`) - [ ] Quiet-window USTC move on columbus-5 (prod QA; inverted UST1/cUSTC should track CEX USTC) Closes #568
PlasticDigits (Migrated from gitlab.com) closed this pull request 2026-08-20 02:17:43 +00:00

Pull request closed

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!1100
No description provided.