Kaskad

Oracle

Oracles provide the prices Kaskad uses to value collateral, calculate health factors, and trigger liquidations. Kaskad runs its own oracle, Nuntius. Nuntius prices every lending reserve on Igra and PONS on Robinhood Chain. The other Robinhood Chain reserves (WETH, USDG, NVDA and TSLA) use third-party aggregator feeds.

Developers can find endpoints, contracts and code in the Oracle API Reference.

How It Works

  1. Nuntius runs inside AWS Nitro Enclaves: isolated virtual machines whose memory the host cannot read or modify.
  2. The enclave fetches prices for each asset from a fixed set of public sources over TLS, removes outliers, and selects one price per asset.
  3. It signs each price with a key that exists only inside enclaves, and serves the signed prices over HTTPS.
  4. A price reaches the chain only when a transaction submits it. The oracle contract accepts it only if the key that signed it was registered with an AWS attestation of the enclave image.
  5. The Kaskad app attaches fresh signed prices to borrows and withdrawals through KaskadRouter. Liquidators and other integrators can do the same.
Public APIs
Price sources
  • 13 exchanges
  • CoinGecko, Igra Labs
TLS
AWS Nitro Enclave
Nuntius
  • fetches and filters quotes
  • selects one price per asset
  • signs it
HTTPS
Off-chain
App or bot
  • GET /prices
  • adds prices to its transaction
tx
On-chain
KaskadPriceOracle
  • through KaskadRouter or directly
  • verifies the signature
  • checks the limits, stores

Price Sources

The enclave sends requests only to these 15 hosts. The list is part of the enclave image, so the attestation covers it.

  • Exchanges (13): Binance, OKX, Bybit, Coinbase, MEXC, KuCoin, Gate.io, Kraken, Bitget, Bitfinex, Bitstamp, Crypto.com and HTX.
  • CoinGecko, a price aggregator.
  • The Igra Labs price API, used only for IGRA.

Each asset uses a subset:

AssetConfigured sources
BTC/USD, ETH/USDBinance, OKX, Bybit, Coinbase, CoinGecko, MEXC, KuCoin, Gate.io, Kraken, Bitget, Bitfinex, Bitstamp, Crypto.com, HTX
KAS/USDBybit, CoinGecko, MEXC, KuCoin, Gate.io, Bitget, HTX
TAO/USDBinance, MEXC, KuCoin, Gate.io, CoinGecko, Bitget, HTX
USDC/USDBinance, OKX, CoinGecko, Kraken, Bitget, Bitfinex, Bitstamp, HTX
USDT/USDCoinbase, Kraken, Bitstamp, CoinGecko
USDG/USDKraken, Bitstamp, CoinGecko, OKX, Gate.io, KuCoin
PONS/USDOKX, Bybit, Bitget, Gate.io, KuCoin, MEXC, CoinGecko
NVDA/USDBinance, OKX, Bybit, Gate.io, CoinGecko, MEXC (tokenized-stock markets)
TSLA/USDBinance, OKX, Bybit, Gate.io, CoinGecko, MEXC, KuCoin (tokenized-stock markets)
IGRA/USDIgra Labs, CoinGecko
TIBBIR/USDMEXC, CoinGecko

Not every configured source contributes to every price. A source that fails, times out, or is filtered out is left out of that round. num_sources in each signed price shows how many were used, and the oracle contract rejects a price with fewer than the asset's minimum. The minimums are listed in the API reference.

The configuration is public: config/assets.json in the enclave repository.

How a Price Is Computed

The enclave processes the assets in a loop and refreshes each price about every 15 seconds, depending on how quickly the sources respond. For each asset:

  1. Fetch. It queries each source in turn. TLS ends inside the enclave, and certificates are checked against the Mozilla root store compiled into the image. Each quote is timestamped with the HTTP Date header of its response, or, for Igra Labs, with the update time in the response. A response without a Date header is discarded.
  2. Convert to USD. Most of the exchange markets used are quoted in USDT. The enclave first computes USDT/USD from USD-quoted sources, then converts each USDT quote with it. If USDT/USD cannot be computed, the last value is reused for up to 15 minutes, after which 1 USDT counts as 1 USD.
  3. Check the quorum. With fewer usable quotes than the asset's minimum, the asset is skipped for this round and keeps its previous price.
  4. Remove outliers. With three or more quotes, a quote is dropped when it is further from the median than three scaled median absolute deviations, or further than the asset's cap, whichever is tighter. The caps range from 0.5 % (BTC, ETH and stablecoins) to 10 % (TIBBIR). Quotes whose time is more than 5 minutes from the median time are also dropped, and the quorum is checked again.
  5. Select. The price is the volume-weighted median of the remaining quotes: in price order, the first quote at which the cumulative 24-hour volume reaches half of the total. Each source's weight is capped at five times the median volume. When half or fewer of the quotes report volume, all quotes count equally. The result is always one source's quote, converted to USD where needed, and never an average.
  6. Timestamp. The signed time is the median of the remaining quotes' times. The enclave never uses the host's clock.
  7. Sign on request. The result is cached and signed when someone requests it, so requests between two refreshes return the same signed price.

On Igra, the enclave prices seven assets. It counts USDT quotes as USD, and its outlier filter has no per-asset cap.

Order-Book Method

The enclave source also contains a consolidated-order-book method for BTC, ETH, KAS, USDC and TAO, from Eliott Méa's A Mathematical Framework for Price Oracles. It projects the order books of many venues onto a common price grid, clears crossed liquidity as an arbitrageur would, and takes the midpoint of the remaining spread. According to the paper, moving such a price requires capital that grows with the depth of the combined book.

The method needs live order books from the venues' WebSocket feeds. When the enclave has fresh books from enough venues for an asset, it uses this method's result instead of the steps above. Otherwise, including whenever no order books arrive, the asset is priced by the steps above.

How Prices Reach the Chain

Nuntius is a pull oracle: the enclave signs prices but sends no transactions, and prices are not pushed on a schedule. A price is stored on-chain only when a transaction submits it.

  • KaskadPriceOracle.updatePrice is permissionless. Anyone can submit a signed price, and the contract decides whether to accept it.
  • KaskadRouter submits prices and then borrows, withdraws or liquidates in the same transaction.
  • A stored price can be days old if nobody has used the market. Contracts and bots that need a current price should submit one first. See Freshness.

The app fetches signed prices every 10 seconds and checks on-chain that their signer is registered. On Igra it uses whichever of the two enclaves has the newest prices, and it attaches prices for every Nuntius-priced reserve. If no valid prices are available, the app shows Under maintenance and pauses all actions, including the Bridge tab, until prices are back. Transactions already sent are unaffected.

On-chain Safeguards

Signer registration. The oracle accepts prices only from registered keys. A key can be registered only with an AWS-signed attestation of an enclave whose PCR0, the hash of the enclave image, matches the value the contract expects.

Ordering. A price is accepted only if its signed time is later than that of the stored price, so an older price can never replace a newer one.

Change limits. An update is rejected if it moves the stored price by more than a set limit. On Robinhood Chain the limit is set per asset, from 2 % for stablecoins to 30 % for TIBBIR. On Igra it is 15 %. Once an hour has passed since the last accepted update, a looser limit applies: up to 50 % on Robinhood Chain and 30 % on Igra. After a larger market move, updates are therefore rejected until an hour has passed.

Staleness checks.

  • Igra: the lending market refuses borrows while reserve prices were last submitted more than an hour ago, by chain time. Under the same condition it blocks liquidation of positions with a health factor between 0.95 and 1. Positions below 0.95 can always be liquidated. Supply, repay and withdraw are not checked.
  • Robinhood Chain: the PONS feed rejects a price signed more than an hour ago. Until a fresh price is submitted, any action that computes the health factor of an account holding PONS reverts.

Why It Is Safe

On Robinhood Chain, the key exists only in enclave memory. It is generated inside the enclave from the Nitro hardware random number generator. Replicas and restarted enclaves receive it from a running enclave over TLS 1.3, in which both sides prove by attestation that they run the same image.

The code is verifiable. The attestation covers the enclave image: the code, the source list, the asset configuration and the root certificates. It also binds the signing key. The source of the Robinhood Chain image is public, and you can rebuild it and compare the result with the attestation and the on-chain value; see Enclave Verification.

The host cannot forge prices. The enclaves run on EC2 instances operated by Kaskad. A host cannot:

  • read or change the TLS traffic between the enclave and a source;
  • forge a source's response or its Date header;
  • inject a price, or make the enclave sign anything it did not compute itself;
  • read or extract the signing key.

Outages are visible. If some sources cannot be reached, fewer are used, and an asset stops updating when it falls below its minimum. An older signed price shows its age in timestamp, and the contract never accepts a price older than the stored one.

Enclave Security covers the enclave design in detail.

Igra and Robinhood Chain

Robinhood ChainIgra
EnclavesOne key. Served from the US, with failover to EuropeTwo enclaves, US and Europe, each with its own key
Key storageEnclave memory onlyEncrypted with AWS KMS, per region
Assets127
USDT quotesConverted to USDCounted as USD
Oracle contractKaskadPriceOracleV2: limits per assetKaskadPriceOracle: 15 % and 30 % limits
Lending reserves priced by NuntiusPONSAll five

On-chain Contracts

ContractRole
KaskadPriceOracleV2 (Robinhood Chain), KaskadPriceOracle (Igra)Verify signatures, enforce source minimums and change limits, store price history
Attestation verifierVerifies AWS Nitro attestation documents and returns the image PCR0 and the enclave's public key
KaskadAggregatorV3 (Igra)Chainlink-compatible feed per asset for the lending market. Returns the last stored price
PONS feed (Robinhood Chain)Chainlink-compatible feed for PONS. Rejects prices signed more than an hour ago
KaskadRouterSubmits prices, then borrows, withdraws or liquidates in the same transaction
KaskadStalenessChecker (Igra)Aave price-oracle sentinel. Blocks borrows, and liquidations above a health factor of 0.95, while prices are stale

Addresses, functions and errors are in the Oracle API Reference.

Source Code

The live oracle on Robinhood Chain runs an image built from Kaskad-Lending/kaskad-pontifex-enclave at the tag robinhood-mainnet-v1. Verify the Enclaves shows how to build that image yourself and match it to the live attestation and the on-chain pin.

The oracle is developed in Kaskad-Lending/kaskad-nuntius, together with the Pontifex bridge enclave and the tests. At commit 34b7222, Dockerfile.oracle, Dockerfile.pontifex and every repository file they copy are identical to kaskad-pontifex-enclave at robinhood-mainnet-v1. The kaskad-nuntius README shows how to build and test the oracle and run a pricing round on your own machine, and its Run Your Own Oracle section lists the build arguments for an image of your own.

The contracts and their deploy scripts are in Kaskad-Lending/kaskad-nuntius-contracts. To run an oracle of your own on Robinhood Chain, follow Deploy on Robinhood Chain in its README. In outline: predict the oracle's address, build Dockerfile.oracle with that address built in, deploy an oracle pinned to the image's PCR0, boot the enclave, then register its signer and your assets. Your assets and sources go in config/assets.json and config/exchanges.json of kaskad-pontifex-enclave before the build. They are compiled into the image, so changing them changes its PCR0.

The guide covers the contracts and the image. An enclave has no network access of its own, so you also run its Nitro parent instance, which relays the enclave's connections to its price sources, its RPC endpoints and the apps that fetch its prices.

Oracle's Role in the Protocol

Collateral valuation
The value of a user's collateral is calculated using oracle price feeds. This determines maximum borrowing power (LTV ratios) and current health factor.

Liquidation triggers
When oracle-reported prices cause a borrower's health factor to drop below 1.0, the position becomes eligible for liquidation. Liquidators can use KaskadRouter to submit current prices in the same transaction as the liquidation.

Milestone validation
TVL milestones are validated using TWAL (Time-Weighted Average Liquidity). Oracle prices feed into health factor calculations that determine whether positions are genuinely collateralised or artificially inflated.

Risk parameter calibration
LTV, liquidation threshold, and liquidation penalty are set per asset. Thinner markets with lower oracle manipulation cost receive more conservative parameters to ensure the attack is unprofitable even at launch liquidity levels.