Domain
MarketStats
Floor, volume, charts, and event history from one market index.
Usage
tsx
import { MarketStats } from "@whitehash/ui"import { useMarketIndex } from "@whitehash/react"const { index } = useMarketIndex("/market-index.json")if (!index) return null<MarketStats.Root index={index}><MarketStats.Tiles /><MarketStats.FloorChart /><MarketStats.VolumeChart /><MarketStats.Events limit={25} /></MarketStats.Root>
Parts
tsx
MarketStats.Root // provides the index and its chain currencyMarketStats.Tiles // the default stat set, in a responsive gridMarketStats.Floor // individual tilesMarketStats.ListedMarketStats.MedianMarketStats.Volume // span="24h" | "7d" | "30d" | "all" | …MarketStats.SalesMarketStats.HighestSaleMarketStats.LowestSaleMarketStats.FloorChart // daily floor, with a crosshairMarketStats.VolumeChart // daily traded volumeMarketStats.Events // newest-first history; limit={25}MarketStats.Tile // label/value cell for your own arrangementsMarketStats.Delta // signed percentage, colored by direction
Currency is handled for you
Every money field in an index is a base-unit string, mutez on Tezos and wei on EVM. The parts format them with the chain the index came from, so your code never converts. The same helpers are exported from @whitehash/market if you render your own layout.
FloorChart renders nothing when active listings are unavailable, which is the case on Ethereum and Base: fxhash listings there are signed off-chain, so only sales can be recovered. Floor and Listed say so on the tile.