CRIUS
PricesTutorialWebSocket

How to get real-time token prices on Robinhood Chain

Three ways to get live Robinhood Chain token prices (single, batch and streaming), how on-chain prices are derived, and how to avoid bad prices from thin liquidity.

Crius 3 min read

Every app built on Robinhood Chain needs prices: a wallet valuing holdings, a bot deciding when to sell, a dashboard showing market caps. On-chain there is no price oracle for the long tail of tokens; the price is whatever the pools say. This guide covers how that price is derived, and three ways to get it from the Crius API depending on how many tokens you track and how fresh you need it.

Where an on-chain price comes from

A token’s USD price on Robinhood Chain is derived in two hops:

  1. Token → quote asset. Find the token’s deepest pool and read its price against that pool’s quote asset: usually ETH, WETH or the USDG stablecoin. For Uniswap v3 and v4 this uses the pool’s current tick and only in-range liquidity.
  2. Quote asset → USD. Convert ETH or WETH to USD through the deepest ETH/USDG pool.

Two things can go wrong. A token can have its “best” pool be tiny, so one small trade moves the price; and a launchpad token on a bonding curve has a price set by the curve formula rather than a pool. Crius handles both: every price comes with the source_pool, its liquidity_usd, a confidence level and a thin_liquidity flag, and launchpad tokens are priced from their curve until they graduate.

1. One token: the price endpoint

The fastest call in the API:

const res = await fetch(
"https://api.crius.sh/v1/robinhood/token/0x0bd7d308f8e1639fab988df18a8011f41eacad73/price",
{ headers: { "x-api-key": process.env.CRIUS_API_KEY } },
);
const { data, meta } = await res.json();
console.log(`${data.symbol}: $${data.usd} (pool ${data.source_pool}, ${data.confidence} confidence)`);

It costs 1 credit and works without a key at low rates. Use it for single lookups, alerts and price checks right before a trade.

2. Many tokens: batch prices

Valuing a wallet or refreshing a watchlist one token at a time wastes requests. Batch prices take up to 100 tokens in one call:

Terminal window
curl -X POST "https://api.crius.sh/v1/robinhood/prices" \
-H "x-api-key: $CRIUS_API_KEY" \
-H "content-type: application/json" \
-d '{"tokens": ["0x7b8892cea949bc60d494681d1bc3ea96071ab0b8", "0x0bd7d308f8e1639fab988df18a8011f41eacad73"]}'

Unknown addresses don’t fail the request; they are listed in meta.missing. If you also need market cap or 24h change, use /tokens/batch with a field list such as ["price.usd", "price.change_pct.24h", "market.market_cap_usd"].

3. Always fresh: the price stream

Polling has a trade-off between freshness and cost. The WebSocket stream removes it: subscribe to price:<token> and you receive an update whenever the price changes, plus a snapshot immediately after subscribing.

const ws = new WebSocket(`wss://api.crius.sh/v1/robinhood/stream?api_key=${process.env.CRIUS_API_KEY}`);
ws.onopen = () =>
ws.send(JSON.stringify({ op: "subscribe", channels: ["price:0x7b8892cea949bc60d494681d1bc3ea96071ab0b8"] }));
ws.onmessage = (e) => {
const m = JSON.parse(e.data);
if (m.ch.startsWith("price:")) console.log(m.block, m.data.usd);
};

A stream connection costs 1 credit regardless of how many updates it delivers, which makes it the cheapest option for anything you watch continuously. The Free plan includes one connection with 10 subscriptions.

Avoiding bad prices

  • Check thin_liquidity and confidence before acting on a price. A token whose deepest pool holds a few hundred dollars can be moved by a single trade.
  • Use quote_liquidity_usd for exit size. liquidity_usd follows the DEX-screener convention (2 × the quote side); quote_liquidity_usd is the quote that sellers could actually withdraw.
  • Watch the block. Every response says which block it reflects (meta.block). If you combine prices from several calls, prefer calls that reflect the same or nearby blocks.
  • Tiny prices need plain decimals. Meme tokens often trade below $0.00001. The API always writes numbers in plain decimal notation (0.00000576413), never exponents, so they parse cleanly everywhere.

Which method to use

Need Use Cost
A price now and then /token/{address}/price 1 credit per call
A watchlist or portfolio /prices (≤ 100 tokens) 1 credit per call
Prices plus market data /tokens/batch with fields 1 credit per call
Continuous updates price:<token> stream 1 credit per connection

Try them in the API playground, or read the token and price reference.

Build with Crius

Robinhood Chain data in one API

Free plan with 1M credits a month. Your key in under a minute.

Related APIs

More from the blog