feat(token-aggregation): add historical pricing context, backfill, and indexer hardening #3

Open
nsatoshi wants to merge 0 commits from feature/token-aggregation-historical-pricing into main
Owner

Summary

This PR adds the historical pricing APIs and backfill support needed for transfer-time valuation, while also hardening deploy and indexer behavior.

What Changed

  • add pricing endpoints for:
    • current price
    • price-at
    • pricing-context
  • add swap-event persistence and historical pricing backfill tooling
  • add historical replay support for OHLCV-driven valuation
  • prevent stale OHLCV candles from being marked as locked historical prices
  • prevent CoinGecko historical fallback from using future datapoints
  • add overlap protection to the periodic indexer
  • add adaptive RPC chunking for large log-range queries
  • make token-aggregation deploys deterministic
  • clean up runtime and dev dependency audit debt

Validation

  • npm audit -> 0 vulnerabilities
  • npm test -- --runTestsByPath src/api/routes/tokens.test.ts
  • npm run build

Live Verification

  • pricing-context now returns valid locked historical pricing only when the source is acceptable
  • stale fallback responses now return locked: false
  • token-aggregation service on CT 5000 is active

Notes

This PR is the API/backend half of the explorer pricing rollout and pairs with the UI wiring in explorer-monorepo.

## Summary This PR adds the historical pricing APIs and backfill support needed for transfer-time valuation, while also hardening deploy and indexer behavior. ## What Changed - add pricing endpoints for: - current price - `price-at` - `pricing-context` - add swap-event persistence and historical pricing backfill tooling - add historical replay support for OHLCV-driven valuation - prevent stale OHLCV candles from being marked as locked historical prices - prevent CoinGecko historical fallback from using future datapoints - add overlap protection to the periodic indexer - add adaptive RPC chunking for large log-range queries - make token-aggregation deploys deterministic - clean up runtime and dev dependency audit debt ## Validation - `npm audit` -> 0 vulnerabilities - `npm test -- --runTestsByPath src/api/routes/tokens.test.ts` - `npm run build` ## Live Verification - `pricing-context` now returns valid locked historical pricing only when the source is acceptable - stale fallback responses now return `locked: false` - token-aggregation service on CT 5000 is active ## Notes This PR is the API/backend half of the explorer pricing rollout and pairs with the UI wiring in `explorer-monorepo`.
nsatoshi added 4 commits 2026-04-26 06:56:20 +00:00
feat(token-aggregation): add historical pricing context, backfill, and indexer hardening
Some checks failed
CI/CD Pipeline / Solidity Contracts (pull_request) Failing after 1m6s
CI/CD Pipeline / Security Scanning (pull_request) Successful in 12m42s
CI/CD Pipeline / Lint and Format (pull_request) Failing after 42s
CI/CD Pipeline / Terraform Validation (pull_request) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (pull_request) Successful in 27s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (pull_request) Failing after 49s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (pull_request) Failing after 26s
Validation / validate-genesis (pull_request) Successful in 36s
Validation / validate-terraform (pull_request) Failing after 28s
Validation / validate-kubernetes (pull_request) Failing after 12s
Validation / validate-smart-contracts (pull_request) Failing after 13s
Validation / validate-security (pull_request) Failing after 1m39s
Validation / validate-documentation (pull_request) Failing after 18s
fcd55aa9c4
Some checks failed
CI/CD Pipeline / Solidity Contracts (pull_request) Failing after 1m6s
CI/CD Pipeline / Security Scanning (pull_request) Successful in 12m42s
CI/CD Pipeline / Lint and Format (pull_request) Failing after 42s
CI/CD Pipeline / Terraform Validation (pull_request) Failing after 25s
CI/CD Pipeline / Kubernetes Validation (pull_request) Successful in 27s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (pull_request) Failing after 49s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (pull_request) Failing after 26s
Validation / validate-genesis (pull_request) Successful in 36s
Validation / validate-terraform (pull_request) Failing after 28s
Validation / validate-kubernetes (pull_request) Failing after 12s
Validation / validate-smart-contracts (pull_request) Failing after 13s
Validation / validate-security (pull_request) Failing after 1m39s
Validation / validate-documentation (pull_request) Failing after 18s
Checking for merge conflicts…
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/token-aggregation-historical-pricing:feature/token-aggregation-historical-pricing
git checkout feature/token-aggregation-historical-pricing
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: d-bis/smom-dbis-138#3