Index Price

Index Price oracle racle price details and computation

Perpetual Futures are synthetic instruments, meaning that their price is derived from an external source instead of the value of a physically deposited asset.

Perps use funding rates to try to move the price towards the Index oracle Price in the system.

NFT Index Price computation

The index price on Hook is computed using a global view of the NFT orderbook as well as the mid-market price on top NFT venues.

By default, the Oracle aggregates all of the asks and offers across the NFT ecosystem using Reservoir. Then, the price is computed as a Price-Impact Mid-Market price across all of those orders. The price impact is variable depending on market liquidity, but the target is $10,000.

Secondly, the oracle aggregates mark prices and mid-market prices from a variety of NFT venues. If the maximum spread between venues is greater than 5%, the index price is instead computed as the median price across venues. This escape hatch is added to diversify the data sources and to reduce the impact of market manipulation occuring on a single venue.

ERC-20 Index Price Computation

The majority of ERC20s price feeds supported on Hook are mostly traded on DEXs on their home chain, instead of on CEXs along with larger cap coins. As a result, Hook's oracle currently exclusively ingests data from DEXs.

To compute the price, the oracle periodically (with the period always less than 10s but depending on the asset), polls a DEX aggregator API for two prices: the price to sell $100 of USDC for the token, and the price to buy $100 of USDC by selling the token. The swap could include multiple legs (e.g. across multiple dexs) and does not incorporate the gas fees. The price could be quoted by an offchain market maker an RFQ response. The midpoint of these two prices is reported as the oracle price.

Note: If USDC depegs, the price may not be equivalent between its USDC denominated price and other stablecoins. As a result, all markets are listed as {Token}-USDC markets, and currenly only accept USDC collateral.

Pull-based oracle

To prevent frontrunning and oracle lag times, the oracle is pull-based. That means that, on each transaction that depends on the oracle, the oracle price is signed and committed into the transaction.

Last updated