Skip to content

Freshness and invalid data

Refresh a price when your application needs it, with the validity and freshness information to decide how to use it.

Refresh and use the price in one transaction

Mimir supports on-demand pricing. Your application can include a refresh before its consuming instruction in the same Solana transaction. Mimir calculates the price onchain, then the application checks and uses that result. Colada uses this pattern.

You do not need a keeper continuously publishing prices for this flow. The transaction requests the update when the application needs it, with the applicable feed and transaction fees. If a required instruction fails, the transaction does not commit a partial result.

An RPC read retrieves the stored observation, which a dashboard can display directly. To calculate and record an updated price onchain, include a refresh. Applications using stored observations can evaluate their age and validity against their own policy.

Offchain prices with Shadow

Shadow calculates prices offchain for explorers, terminals and dashboards, without submitting a refresh transaction. It follows Mimir's pricing logic using the account data it reads, rather than just returning the last stored price.

A Shadow result leaves the onchain observation unchanged. At the same slot, matching account state, feed configuration and calculation version give the same price as the onchain calculation. A later refresh uses the state available when its transaction executes.

Using the feed's status

ConditionIntegration guidance
Wrong feed or mismatched accountsResolve the intended feed and matching accounts before using the price.
Inactive or invalid stateWait for a valid, active feed before using it as a price reference.
Expired validity window or unacceptable ageUse the supported refresh path, or defer the action.
Insufficient sources or liquidityKeep the application's source and liquidity criteria in place.
RPC or refresh failureShow an unavailable state and follow a defined retry/recovery policy.

Composite feeds inherit dependencies

A composite draws on its component prices and any quote conversions. Mimir checks these inputs against the feed's validity rules. Input timestamps describe the age of the component data; the composite's calculation time records when that data was combined.

Price data and application policy

Mimir exposes the price's sources and validity information. Applications combine that information with their own requirements for liquidity, exposure and the assets they support. For tokenized assets, the issuer's terms also inform those choices.

Next: manipulation safeguards, or the application integration path.

Documentation v0.1.1 · Beta