The price service

A small, separate HTTP service that isolates the dapp's only external dependency.

Why it is separate

The dollar price of a tokenized stock cannot come from the chain — it comes from an API. Putting it in an application route would stitch that dependency into the product.

By pulling it out, the dapp keeps reading all protocol state directly from the chain and stays useful when the price service is down. It then shows "price unavailable", never zero.

The freshness rule

This is a design rule of the project, not an implementation detail:

A financial value is never shown without knowing whether it is fresh, and an unavailable price is shown as unavailable, never as zero, never as a silent estimate.

Every returned price therefore carries its provenance, the timestamp at which it was observed upstream, and a staleness flag. The full payload also carries a "degraded" flag if at least one symbol could not be priced.

Locally

The service runs in fixtures mode: frozen prices, no network call, which makes the local scenario reproducible.