Skip to main content
The stream won’t quote every combination directly. Want WETH/WBTC when only WETH/USDC and WBTC/USDC exist? Bridge the two: derive a synthetic cross rate through the token both pairs share. That derived number is a pre-trade filter - a cheap way to decide whether the route deserves a firm RFQ quote at all.
Typical scenario: a WETH/WBTC swap lands on your desk, and no direct pair exists on the stream - but both legs against USDC do. Deriving the cross rate from streamed depth tells you whether the route is competitive before you spend a firm quote on it.

Two Legs, One Rate

To price a WBTC purchase paid in WETH when only the USDC pairs stream, split the trade conceptually:
  1. Leg one: WETH out - your WETH sells into the WETH/USDC bids
  2. Leg two: WBTC in - the resulting USDC buys from the WBTC/USDC asks
Dividing the two per-leg VWAP estimates yields the effective WETH/WBTC rate. Per-leg VWAP - not top-of-book - matters here because the two books rarely carry the same depth shape at your size.

The Recipe

1

Map what's streaming

Index every pair in the snapshot, then intersect: which quote tokens do both of your base tokens trade against? (find_common_quotes below.)
2

Choose your bridge

Several candidates? Take the one with real depth on both sides - in practice that’s usually a major stablecoin, but let the data decide.
3

Price each leg on its own

Run the VWAP walk per leg: bids for the leg where you’re selling, asks where you’re buying.
4

Divide

Leg-one VWAP over leg-two VWAP - that quotient is your size-aware cross rate.

Discovering Bridge Tokens

Every pair on the network rides the same stream, so bridge discovery is a set intersection over the snapshot you already have. Don’t bake assumptions in: which tokens serve as common quotes differs chain to chain. Stablecoins show up often, but the snapshot itself is the only reliable answer.

Deriving the Cross Rate

With a bridge chosen, price both legs and take the ratio:

On the Live Stream

Plugged into the WebSocket connection from the Quickstart, the whole pipeline re-derives the cross rate on every snapshot:
A $250,000 WETH/WBTC derivation prints along these lines:
A derived cross rate inherits the uncertainty of both legs - it’s an indicative screen, and the firm quote that follows can differ. Never treat it as executable.

Watch-outs

  • Per-leg VWAP or nothing. The two books almost never share a depth profile, so top-of-book ratios mislead exactly when size matters - blend each leg at your true notional.
  • A thin leg poisons the whole number. Any unfilled remainder on either side makes the cross rate unreliable at that size; treat it as no-quote.
  • Bridge quality is depth on both sides. Given multiple shared tokens, the right bridge is the one that absorbs your size twice - once per leg.
  • Rediscover bridges from the data. The set of shared quote tokens shifts by chain and by snapshot; recompute it rather than pinning yesterday’s answer.