Skip to content

API ReferencePricing and oraclesFunction

resolveOraclePriceUpdate()

function resolveOraclePriceUpdate(ctx, params): Promise<OraclePriceUpdate | undefined>;

Resolves an oracle update at the point a transaction is built.

Hermes is an availability optimization rather than an unconditional gate: if it is unavailable, an empty update remains safe only after the SDK proves the existing on-chain pair price fresh against the chain clock. Any doubt preserves the original typed PriceServerError.

Parameters

ParameterType
ctxSDKContext
paramsResolveOraclePriceUpdateParams

Returns

Promise<OraclePriceUpdate | undefined>

Throws

StalePythPriceError If Hermes responds with a price outside oracleConfig.maxPriceAgeSeconds. This unsafe-data failure does not use the on-chain fallback reserved for PriceServerError.