Overview
A trace that records a swap of0.5 ETH tells you the size in tokens but not in dollars. Comparing that against a 1200 USDC trade, or alerting when a trade exceeds a dollar threshold, means knowing the rate at the moment the action happened — not the rate at the time you look.
Mirador’s rate hint ties an asset symbol and quantity to a trace. The backend ratehint plugin resolves the USD spot rate and stamps both the rate and the resulting notional onto the trace:
RateHintAdded→RateTrackingStartedRateAdded(the resolved rate and notional) orRateNotFoundRateTrackingFinished(terminal)
Rate hints are emitted over OpenTelemetry only. There is no Web SDK method — no
Web3Plugin, no trace.market.* namespace. Emit the reserved span event described below.Recording a Rate Hint
Add themirador.market.asset.ratehint event to the active span with a symbol and a quantity.
Attributes
asset.symbol is upper-cased server-side, so casing does not matter. asset.quantity keeps its fractional part and accepts a numeric string for SDKs that cannot express a double.
asset.kind is passed through as-is and lowercased. Any value other than crypto or fiat is treated as unspecified, and the market service falls back to inferring the kind from the symbol — an unrecognized value does not invalidate the hint. Prefer crypto, fiat, or nothing at all.What Gets Stamped
On a successful resolution,RateAdded carries the rate and notional, and the following attribute bag is stamped inside the synthetic ratehint span:
RateAdded also records rate_as_of for source freshness and the resolution source (cache, coingecko, or exchangerate).
Terminal Statuses
RateTrackingFinished closes the lifecycle with one of:
UNAVAILABLE is transient and worth retrying on a later trace; UNSUPPORTED means the symbol will not resolve. Both emit RateNotFound before the terminal event, so a missing rate is always visible in the trace rather than silently absent.
End-to-End Example
Pricing Both Sides
A rate hint prices one asset. Emit one per asset when you want both sides of a trade in dollars — one action per event is the rule for every hint.Next Steps
Enrichment Hints
The full reserved-event catalog and attribute contract
Stripe Payments
Track payments through charge and payout
Metrics over OTLP
Export metrics alongside your traces
Automation Rules
Alert on notional thresholds