Documentation

Reference price

Clearing is anchored to a median of liquid, quote-whitelisted open pools. Thin venues are dropped. No median → no clear.

Why a band exists

A dark window without an open-market anchor is a quiet place to get clipped. The band keeps the print honest relative to visible liquidity.

Construction

Pull pairs for the asset. Keep Robinhood chain. Keep quote symbols in {WETH, USDG, USDC, USDT, USDE}. Drop pools under the liquidity floor. Take the median priceUsd.

const ALLOWED = ["WETH", "USDG", "USDC", "USDT", "USDE"];
const pools = pairs
  .filter((x) => x.chainId === "robinhood")
  .filter((x) => ALLOWED.includes(x.quoteToken.symbol))
  .filter((x) => (x.liquidity?.usd || 0) >= MIN_POOL_LIQ_USD);
const px = pools.map((p) => Number(p.priceUsd)).sort((a, b) => a - b);
const ref = px.length ? px[Math.floor(px.length / 2)] : null;