Zenith testnet pull oracle
Request a Kaiko-signed price on demand, verify it on-chain, and use it in your own transaction. Verification happens in your contract call, not Kaiko's.
In this guide
How it works
Signing service
Off-chain, reached over the Kaiko API
Returns a price with a signature over it, bound to one chain and one contract.
Verifier contract
On-chain, one deployment per chain
Given a price and its signature, it confirms the pair is authentic. Stateless and read-only: it stores no prices and never initiates a transaction.
Your contract
On-chain
Calls the verifier, checks the price isn't too stale for what it's about to do, then acts on it. Usually five lines before your own logic.
Trust and verification
Signatures are EIP-712 typed data, bound to the destination chain and the verifier contract you'll submit to. Change the chain, the contract, or any digit of the price, and the signature stops matching.
The verifier only checks authenticity, meaning that Kaiko produced this exact price at this exact timestamp. Staleness checks happen in your contract, not in the oracle, using the signed timestamp returned with each price.
Getting started
Prerequisites
A Kaiko API key with access to the EVM pull oracle. This entitlement is granted separately from other Kaiko access; contact your Kaiko representative to enable it.
Request a price
Example:
Response fields:
asset_class
The instrument's asset class, part of the signed payload (e.g. crypto)
instrument_id
The instrument requested
destination
The target chain/contract identifier (zenith-testnet)
price
The reference price, scaled by the instrument's decimal exponent, returned as a string (scaled values can exceed the safe integer range in JSON)
decimal
The scaling exponent applied to price
timestamp
Unix timestamp of the price
signature
Kaiko's signature over the price data
Submit and verify
Submit the price and signature to Kaiko's verifier contract on Zenith Testnet (see Reference), in your own transaction, whenever your use case needs it.
Staleness and errors
Each price carries a maximum staleness window at the API level. If no price within that window is available, the request fails rather than returning outdated data:
InvalidArgument
The request is malformed, for example an unknown instrument or destination
NotFound
The requested instrument does not exist
FailedPrecondition
The latest available price is older than the allowed staleness window
Unavailable
No price has been received yet for this instrument
Handle these cases explicitly, for example by retrying shortly after, rather than assuming a price is always available on demand.
Example consumer contract
A minimal reference client, PriceConsumer, is deployed on Zenith Testnet (source-verified, see Reference). It is pinned to one instrument and does the three checks every consumer needs before acting on a price:
Try it end to end: request a signed price for KK_BRR_BTCUSD (see Request a price), then replay it through the deployed consumer contract via a free view call:
The tuple is the signed price struct in field order (asset_class, instrument_id, price, decimal, timestamp), filled from the response fields. A payload less than 10 minutes old returns the price and its decimal exponent. A payload older than 10 minutes reverts with stale price, a tampered one with invalid signature, and a validly signed price for another instrument (try KK_BRR_ETHUSD) with wrong instrument.
Reference
Verifier contract
0xa5156C36FF2fef927D53cd743eAb5B2288DBbA8A
Chain ID
936485
Explorer (source-verified)
Instruments available
BTC (KK_BRR_BTCUSD), ETH (KK_BRR_ETHUSD)
Example consumer
0xe863273ca397ee3467d5d7b7b809b16df0f9aa54, pinned to KK_BRR_BTCUSD, 10-minute staleness
Example consumer explorer (source-verified)
Additional instruments and chains are expected to follow.
Was this helpful?
