Skip to content

feat(trade,observability,cache): reconcile ledger data, pending activity, latency metrics, and safe caching headers - #821

Merged
IbrahimIjai merged 1 commit into
SO4-Markets:mainfrom
chukwuebuka19:feat/trading-reconciliation-metrics-cache-770-771-780-781
Sep 27, 2026
Merged

IbrahimIjai merged 1 commit into
SO4-Markets:mainfrom
chukwuebuka19:feat/trading-reconciliation-metrics-cache-770-771-780-781

Conversation

@chukwuebuka19

Copy link
Copy Markdown
Contributor

Summary

This PR addresses and resolves the following 4 related issues in a single unified changeset:

  1. OB-115 (Closes OB-115: Reconcile ledger confirmation with delayed indexer data #770): Reconcile ledger confirmation with delayed indexer data

    • Created apps/web/src/features/trade/lib/ledger-reconciliation.ts and apps/web/src/features/trade/hooks/useLedgerReconciliation.ts.
    • Projects confirmed ledger state locally until indexer catches up.
    • Provides clear reconciliation status tags (synced, reconciling, stale) and polling revalidation fallbacks.
    • Unit tests: apps/web/src/features/trade/lib/ledger-reconciliation.test.ts.
  2. OB-116 (Closes OB-116: Show local pending activity without inventing settled balances #771): Show local pending activity without inventing settled balances

    • Created apps/web/src/features/trade/lib/pending-activity.ts and apps/web/src/features/trade/hooks/usePendingActivity.ts.
    • Maintains a local pending overlay for in-flight orders, deposits, withdrawals, and position amends without fabricating settled wallet balances.
    • Includes pending status badges, elapsed timers, and direct Stellar block explorer links for ledger transaction hashes.
    • Unit tests: apps/web/src/features/trade/lib/pending-activity.test.ts.
  3. OB-125 (Closes OB-125: Set safe caching headers for assets and public data #780): Set safe caching headers for assets and public data

    • Created apps/web/src/shared/lib/cache-headers.ts and configured Nitro in apps/web/nitro.config.ts.
    • Static assets (/_build/assets/*, fonts, immutable chunks): public, max-age=31536000, immutable.
    • Dynamic HTML pages & server-rendered routes: no-cache, no-store, must-revalidate.
    • Public market data & GraphQL cache: public, max-age=0, s-maxage=5, stale-while-revalidate=15.
    • Private / authenticated wallet endpoints: private, no-cache, no-store, must-revalidate.
    • Unit tests: apps/web/src/shared/lib/cache-headers.test.ts.
  4. OB-126 (Closes OB-126: Measure route speed, feed health, and transaction-refresh latency #781): Measure route speed, feed health, and transaction-refresh latency

    • Created apps/web/src/features/observability/lib/telemetry.ts and apps/web/src/features/observability/hooks/usePerformanceMetrics.ts.
    • Records route transition durations, market data feed tick/event latency, staleness windows, and transaction submission-to-refresh timings.
    • Provides summary metrics and threshold breaches for real-time observability.
    • Unit tests: apps/web/src/features/observability/lib/telemetry.test.ts.

Changelog Entries

  • .changelog/unreleased/770-ob-115-ledger-indexer-reconciliation.md
  • .changelog/unreleased/771-ob-116-pending-activity-overlay.md
  • .changelog/unreleased/780-ob-125-safe-caching-headers.md
  • .changelog/unreleased/781-ob-126-route-feed-latency-telemetry.md

Verification

  • bun lint 100% passing across all 6 packages.
  • bun typecheck 100% passing across all 6 packages.
  • bun run check:tokens 100% passing (442 files scanned, 0 violations).
  • bun run check:content 100% passing (41 pages, 0 orphans).
  • All unit and integration test suites passing.
  • Full workspace production build (bun run build) succeeds.

Closes #770
Closes #771
Closes #780
Closes #781

…ity, latency metrics, and safe caching headers (SO4-Markets#770, SO4-Markets#771, SO4-Markets#780, SO4-Markets#781)

- OB-115 (Closes SO4-Markets#770): Implement ledger reconciliation for delayed indexer data, with status badges, local optimistic ledger projection, and automatic fallback revalidation.
- OB-116 (Closes SO4-Markets#771): Implement pending activity overlay without inventing settled balances, providing optimistic state indicators with explicit pending tags and ledger hash links.
- OB-125 (Closes SO4-Markets#780): Configure safe caching headers across static assets (immutable 1y), HTML routes (no-cache), public GraphQL/REST responses (s-maxage=5, stale-while-revalidate=15), and private wallet endpoints (private, no-store).
- OB-126 (Closes SO4-Markets#781): Implement client-side observability measuring route transitions, market data feed health/staleness, and post-submission transaction-refresh latency.
@vercel

vercel Bot commented Sep 27, 2026

Copy link
Copy Markdown

@chukwuebuka19 is attempting to deploy a commit to the Ijai's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@chukwuebuka19 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@IbrahimIjai
IbrahimIjai merged commit f8fb5ef into SO4-Markets:main Sep 27, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants