API ReferencePricing and oraclesInterface
Price
A price between two tokens, in smallest units of the output token per smallest unit of the input token. Both tokens’ decimals are already folded in, so you can convert one token’s onchain amount into the other’s without looking up either token’s decimals; rescale only to display the rate.
The value is price * 10 ** exponent. For example, if token A has 10 decimals, token B has 5, and
one whole A is worth one whole B, then one smallest unit of B is worth 10^5 smallest units of A, so
the price of B in A is:
{ price: 1n, exponent: 5n, publishTime: 1735689600n }Properties
exponent
exponent: bigint;The base-10 exponent by which price must be scaled (price * 10 ** exponent).
price
price: bigint;Integer significand. price * 10 ** exponent is the number of smallest units of the output token
per one smallest unit of the input token — both tokens’ decimals are already folded in, so rescale
only for display.
publishTime
publishTime: bigint;When the price was published, in Unix seconds.