Metric Docs | Build a Price Provider
Learn the design goals of a Metric Price Provider, including bid/ask/reference output, validation, failure behavior and update integrity.
Learn the design goals of a Metric Price Provider, including bid/ask/reference output, validation, failure behavior and update integrity.
Metric is built around Active Pools: liquidity pools that use a Price Provider to supply bid, ask and reference prices instead of relying only on reserve ratios. This page focuses on Build a Price Provider and the practical checks that matter when using or integrating the protocol.
What a Price Provider returns
A Metric Price Provider is responsible for supplying current bid, ask and reference pricing to the pool. The pool depends on this output before evaluating liquidity and executing a trade.
Validation checklist
| Check | Why it matters |
|---|---|
| Bid/ask ordering | Prevents internally inconsistent quotes |
| Reference validity | Avoids using malformed market data |
| Freshness | Reduces stale-price execution |
| Failure behavior | A provider should fail safely when it cannot quote |
| Authorization | Update paths must not accept unauthorized price changes |
Implementation guidance
When building a provider, keep source validation, update authorization, timestamp handling and fail-closed behavior explicit. Test both normal updates and broken-source scenarios.
Related Metric Docs
Last updated