Identify the reference market
Two independent chains participate in a quote. Elysium mainnet (99901) supplies the HYPE/USDC reference. Obelisk Testnet (82746131) holds WHYPE/tUSDC inventory and executes the transfer. Deposits, withdrawals and trades change balances on the settlement chain.
The observer reads StateView.getSlot0(poolId) at an explicit canonical Elysium block hash. The source key encodes native HYPE as currency 0, USDC as currency 1, a fee field of zero, tick spacing 400 and the configured hook. The resulting pool ID is
0xf3ac4f8eedc7d6f26e56d6d41955216fe2a2530891a565e53db50e4b6d186573
The reference is a sampled spot price. An integrator can reproduce the read from the same block hash and pool ID. Uniswap v4 pool state reference ↗
Decode the Q64.96 price
Let S be sqrtPriceX96. Squaring S and dividing by 2192 gives the raw ratio of currency-1 atoms to currency-0 atoms. Multiplying by the number of base atoms in one whole HYPE before the integer division preserves the required quote precision.
// S is the uint160 read from slot 0.
const referenceAtoms = (S * S * 10n ** 18n) / (1n << 192n);
The contract consumes P as an integer in quote atoms per whole base token. For example, 68,750,000 represents 68.750000 USDC per HYPE for a six-decimal quote token. The relay carries the source observation timestamp through to settlement.
Follow a publication across chains
The observer checks the Elysium chain ID, reads one block and converts its square-root price to quote atoms. The configured publisher submits (price, sourceBlock, timestamp) to the settlement-chain adapter. The adapter requires a strictly increasing source height and a nondecreasing observation timestamp, then calls ObeliskPool.refresh() in the same transaction.
| Observation field | Interpretation |
|---|---|
sourceId | Height of the Elysium source block represented by the pool. |
observedAt | Unix time in seconds of that source block. |
updatedBlock | Obelisk block where the pool last saved an observation. A swap can save the same reference again. |
blockNumber | Obelisk block used for the API snapshot of price, inventory and active bin. |
The adapter authenticates its publisher. The keeper performs the upstream read and conversion off-chain. The settlement contract checks the submitted data’s ordering, range and freshness. A chart sample can appear before the relay transaction confirms, since the observer persists the sample before submitting it. Reference and activity endpoints →
Evaluate the freshness window
Write a = settlement block time − observation time in seconds. The pool accepts observations with −3 ≤ a ≤ 30, endpoints inclusive. Its allowed price range on this pair is 2 through 1012 quote atoms per whole base. Both conditions must hold before the pool can quote a direct swap.
The public quote API applies a stricter screen. It marks a pool stale when its observed time is ahead of the sampled settlement block, or more than 30 seconds behind the later of block time and the API server’s clock. A client receiving a stale-oracle response can read the pool snapshot, wait for a newer sourceId and obtain a fresh quote. Withdrawal uses reserve balances and share supply and remains available through an oracle interruption.