Orakl Network
LOADING PRICES…

AMZN-USD

Mag 7

AMZN price in USD, published onchain on Kaia.

Latest answer

—USD
Loading history…

Offchain answers, sampled every 5m. The onchain answer is written from them on price moves or heartbeats.

Contracts

Read through the proxy. Its address stays the same when the aggregator behind it is replaced.

Read it onchain

On Kaia Mainnet this feed is written at least every 15s, and sooner when the price moves.

PriceConsumer.sol · Solidity ^0.8.20
import {IFeedProxy} from "@bisonai/orakl-contracts/v0.2/src/interfaces/IFeedProxy.sol";

contract PriceConsumer {
    // AMZN-USD on Kaia Mainnet
    IFeedProxy constant FEED = IFeedProxy(0xd6718A6F974c46fC5B5AaB901cbEf6f47f691603);

    function latest() external view returns (int256 answer, uint8 decimals) {
        (, int256 a, uint256 updatedAt) = FEED.latestRoundData();
        require(block.timestamp - updatedAt < 2 minutes, "stale");
        return (a, FEED.decimals());
    }
}

The example rejects answers older than 2 minutes. In quiet markets updates can pause, so set a limit your protocol can tolerate.

Read it offchain

The Data Availability Layer (DAL) serves the latest signed answer over REST and WebSocket, with a proof you can submit onchain yourself.

REST · Kaia Mainnet
curl https://dal.mainnet.orakl.network/latest-data-feeds/AMZN-USD \
  -H "X-API-Key: $API_KEY"
WebSocket · Kaia Mainnet
websocat wss://dal.mainnet.orakl.network/ws -H "X-API-Key: $API_KEY"
{"method": "SUBSCRIBE", "params": ["submission@AMZN-USD"]}

Every DAL request needs an API key. Email business@orakl.network with your project name and the feeds you need. See the DAL docs for all endpoints and the onchain submission flow.