Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

CheckWhy it matters
Bid/ask orderingPrevents internally inconsistent quotes
Reference validityAvoids using malformed market data
FreshnessReduces stale-price execution
Failure behaviorA provider should fail safely when it cannot quote
AuthorizationUpdate 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.

Last updated