TECHNICAL CASE STUDY · Data visualization · Web

Ludicrously Sound Money

Supply economics, made visible.

Public application · retirement scheduled November 21, 2026

Ludicrously Sound Money supply dashboard and historical supply chart
Public application capture · November 20, 2026. Historical supply data.

FROM THE IMPLEMENTATION

Coalesce concurrent history requests

JavaScript · SELECTED SOURCE
async function fetchBlockData(blockNumber) {
  const cachedData = cache.historicalBlocks.get(blockNumber);
  if (cachedData) return cachedData;

  const pendingFetch = pendingBlockFetches.get(blockNumber);
  if (pendingFetch) return pendingFetch;

  const fetchPromise = fetchBlockDataFromApi(blockNumber)
    .finally(() => pendingBlockFetches.delete(blockNumber));
  pendingBlockFetches.set(blockNumber, fetchPromise);
  return fetchPromise;
}
LudicrouslySoundMoney/server.js: fetchBlockData

Requests for the same historical block share one pending fetch. The promise is removed on settlement, allowing a later request to retry after a failure. Exact excerpt.

THE ENGINEERING PROBLEM

What needed to work

A supply dashboard needs to explain how issuance, burns and staking change the amount of a token over time. Simply placing raw API fields on a page leaves users to interpret units, history and indexing delays themselves. I built Ludicrously Sound Money as a focused web application connecting a supply API to readable metrics, historical charts and a responsive interface.

Constraints and requirements

  • Historical views span multiple time windows and repeatedly request some of the same blocks. Browser sessions should share upstream work rather than independently recreating an expensive history crawl.
  • The current chain head and the indexed block used for supply calculations are different observations. The UI needs to expose that distinction, and caches need bounded retention rather than growing with every request.

ARCHITECTURE & DESIGN

How the system fits together

  1. Supply API + price sources
  2. Express shared-request cache
  3. Bounded historical batches
  4. Browser data model
  5. Supply components + charts

A small Express service owns latest supply, historical block, price and current-head caches. Background refresh builds on the latest supply observation before populating history. The browser asks this service for data and renders the charts.

The frontend combines a session block cache with selected local storage entries. Historical prefetch sends batches to the server, where validation, deduplication and bounded concurrency determine the upstream work.

Decisions and tradeoffs

Coalesce concurrent requests for the same historical block.

A map of pending promises lets callers share one fetch. Its entry is removed in finally, so a completed or failed request does not permanently occupy the in-flight slot.

Tradeoff The cache is local to a server process and is rebuilt after restart. That keeps this presentation layer simple, while leaving durable accounting to the separate supply API.

Batch history requests while limiting memory and upstream concurrency.

The batch endpoint accepts at most 500 items, rejects invalid block numbers and deduplicates them. Upstream work runs in groups of 30, while the historical cache retains at most 5,000 entries.

Tradeoff Batching reduces transport overhead without making requests unlimited. Large views can take several groups to complete, and missing upstream records still need to be handled rather than manufactured.

Tie browser asset identity to the reviewed application version.

The server inserts the package version into the page and asset URLs. The deployment entrypoint checks a fixed file set, release identity and post-copy hashes before treating the update as complete.

Tradeoff Releases require deliberate version discipline, but a browser can request the intended JavaScript and CSS instead of silently retaining an older application behind a cache.

PLANNING & EXECUTION

From requirements to working behavior

  1. I separated durable supply calculation from dashboard presentation, then addressed history loading across both browser and server. The implementation includes cache eviction, shared fetches, bounded batch admission and explicit failure responses for unavailable historical data.
  2. Release work connected semantic versioning, cache keys, deployment preflight and health verification. The same release identity is visible to the operator and the application visitor.

VALIDATION & RECOVERY

How the behavior is checked

  • Recorded local checks exercised startup, populated historical batches, deduplication and rejection of non-integer input. Browser observations checked initialization and request shape; release checks compared deployed files and versioned asset URLs.
  • The repository’s automated test command remains a placeholder. These focused observations establish specific behavior; they are not presented as a comprehensive automated regression suite or a broad performance benchmark.

Implementation references

Repository-relative references identify the implementation behind this case study. Selected code excerpts are also available in the portfolio.

  • LudicrouslySoundMoney/server.js: fetchBlockData
  • LudicrouslySoundMoney/server.js: cacheHistoricalBlock
  • LudicrouslySoundMoney/server.js: fetchBlocks
  • LudicrouslySoundMoney/server.js: POST /api/supply/blocks
  • LudicrouslySoundMoney/app.js: batchFetchBlocksEfficient
  • LudicrouslySoundMoney/app.js: fetchSupplyDataBatch
  • LudicrouslySoundMoney/scripts/deploy.sh
  • LudicrouslySoundMoney/package.json