feat: add protocol pool TVL and 24h/30d liquidity change (#569) #1102

Merged
PlasticDigits merged 3 commits from feat/569-protocol-liquidity into main 2026-08-20 03:29:39 +00:00
PlasticDigits commented 2026-08-20 02:18:42 +00:00 (Migrated from gitlab.com)

Summary

  • Add protocol-wide AMM pool TVL (total_liquidity_usd) to /protocol Global stats, plus 24h and 30d percent change vs indexer snapshots.
  • Materialize TVL and Δ% on global_stats_24h so GET /overview stays an O(1) rollup read (no live pair_reserves join or snapshot walk on the request path).
  • Reuse the same USD catalog as volume (P522-Q + hub UST1/USTR). Unpriced, stale, same-asset, overflow, and spoof-native pairs are omitted, not $0.

Closes #569.

What changed

  • Indexer: protocol_tvl.rs + global_liquidity_snapshots + additive overview JSON.
  • Frontend: liquidity boxes inside protocol-global-stats with formatProtocolPct (em-dash on missing / non-finite).
  • Docs/skills: P569-1–P569-8, invariants row, overview runbook, AGENTS.md.
  • Regression: make verify-issue-569.

Test plan

  • make verify-issue-569
  • make verify-issue-550 and make verify-issue-556 still green
  • /protocol shows Total liquidity + 24h% + 30d% next to volume; hub card still after stats
  • Young indexer / --fresh: Δ% is em-dash, not 0% or Infinity
  • Overview JSON is additive; Protocol never reads CG liquidity_in_usd

Closes #569

## Summary - Add protocol-wide AMM pool TVL (`total_liquidity_usd`) to `/protocol` Global stats, plus 24h and 30d percent change vs indexer snapshots. - Materialize TVL and Δ% on `global_stats_24h` so `GET /overview` stays an O(1) rollup read (no live `pair_reserves` join or snapshot walk on the request path). - Reuse the same USD catalog as volume (P522-Q + hub UST1/USTR). Unpriced, stale, same-asset, overflow, and spoof-native pairs are omitted, not `$0`. Closes #569. ## What changed - Indexer: `protocol_tvl.rs` + `global_liquidity_snapshots` + additive overview JSON. - Frontend: liquidity boxes inside `protocol-global-stats` with `formatProtocolPct` (em-dash on missing / non-finite). - Docs/skills: **P569-1–P569-8**, invariants row, overview runbook, `AGENTS.md`. - Regression: `make verify-issue-569`. ## Test plan - [ ] `make verify-issue-569` - [ ] `make verify-issue-550` and `make verify-issue-556` still green - [ ] `/protocol` shows Total liquidity + 24h% + 30d% next to volume; hub card still after stats - [ ] Young indexer / `--fresh`: Δ% is em-dash, not `0%` or Infinity - [ ] Overview JSON is additive; Protocol never reads CG `liquidity_in_usd` Closes #569
PlasticDigits commented 2026-08-20 02:19:09 +00:00 (Migrated from gitlab.com)

marked this merge request as ready

marked this merge request as **ready**
PlasticDigits commented 2026-08-20 03:29:36 +00:00 (Migrated from gitlab.com)

added 18 commits

  • 12343647...38c5252d - 16 commits from branch main
  • cfda26fc - Merge origin/main into feat/569-protocol-liquidity.
  • 2db2d42b - Keep Protocol liquidity StatBoxes visible with trailing-window volume copy.

Compare with previous version

added 18 commits <ul><li>12343647...38c5252d - 16 commits from branch <code>main</code></li><li>cfda26fc - Merge origin/main into feat/569-protocol-liquidity.</li><li>2db2d42b - Keep Protocol liquidity StatBoxes visible with trailing-window volume copy.</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/384/diffs?diff_id=1972544436&start_sha=12343647e4656eac71a850f57f5f753bb00ff02d)
PlasticDigits commented 2026-08-20 03:29:40 +00:00 (Migrated from gitlab.com)

mentioned in commit 91aed331f1

mentioned in commit 91aed331f1e06120e252fe1c05caf9ece1c5f025
PlasticDigits (Migrated from gitlab.com) merged commit 91aed331f1 into main 2026-08-20 03:29:40 +00:00
PlasticDigits commented 2026-08-20 03:54:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #569

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