Skip to content
← Market recipes

Before you open an RFQ market, price it against the order books

A table of what a $1k, $100k and $1M market order costs from one dealer's quote and on the order books that trade the same markets, by session. It's built from public APIs with no keys. You'll save a round of Variational, Lighter and Hyperliquid, price every size on the books with an order-matching engine, and see where a single dealer is cheaper and where it isn't.

Run it now (about 4 min) ↓For AI agents, the same recipe as Markdown: /llms/recipes/rfq-vs-books.md

What you end up with

Here's where you end up: the cost of each size at each venue, by market and session, and how often each venue was cheapest. Below is our table from nine days, a weekend included. Crypto went to Lighter's book, and single stocks at $1M to Hyperliquid's. The dealer won clearly only on its swaps, at every size. On its perps of the same underlyings it lost on weekdays and only tied Hyperliquid at weekends.

Public APIs, no keys, every 5 minutesVariational: one dealerbid/ask at $1k · $100k · $1MLighter: order book250 orders a sideHyperliquid: order book20 levels, HIP-3 includedquotes as givenwalk · rdk-clobBook::quote_market prices each sizesummary.pycost by market · session · size, fee included; who was cheapest
2,207 rounds of 40 markets, every 5 minutes, 2026-11-16 08:45 to 11-25 10:15 UTC. Median bp of mid, fee included, over the rounds where every venue listing the market filled (n per venue in brackets); the last column is how often each was cheapest. Indices and commodities are split by Variational's contract: swap or perp. Shown: the $1M rows; every size is in results-20261125.txt.
2,207 rounds of 40 markets, every 5 minutes, 2026-11-16 08:45 to 11-25 10:15 UTC. Median bp of mid, fee included, over the rounds where every venue listing the market filled (n per venue in brackets); the last column is how often each was cheapest. Indices and commodities are split by Variational's contract: swap or perp. Shown: the $1M rows; every size is in results-20261125.txt.

Run it (4 min)

  1. 1

    Save one round

    1 min
    git clone https://github.com/fabrknt/research && cd research/2026-11-16-one-quote-vs-books
    python3 collect.py 1

    You will see

    40 markets
    20:29:36 0 40 22.8 s

    Variational's /metadata/v2/stats gives its bid and ask at $1k, $100k and $1M. Lighter's orderBookOrders gives 250 resting orders a side, and Hyperliquid's l2Book 20 levels. All three are public, with no keys. Variational answers 429 under load, and the script waits as long as it's told.

  2. 2

    Price every size on the books

    1 min
    cd walk && cargo build --release && cd ..   # needs Rust
    cat data/snap-*.jsonl | walk/target/release/walk > data/walks.jsonl
    wc -l data/walks.jsonl

    You will see

        Finished `release` profile [optimized] target(s) in 21.35s
         107 data/walks.jsonl

    walk rebuilds each saved book in rdk-clob and prices $1k, $100k and $1M with Book::quote_market, which walks the book without changing it. A size the visible book can't fill is marked, not guessed.

  3. 3

    Compare

    1 min
    python3 summary.py

    You will see

    group            session      size   Variational    Lighter  Hyperliquid  cheapest: var/lighter/hl
    crypto           US closed     $1k     3.23 (16)   0.92 (13)    4.74 (16)  19%/69%/12%
    crypto           US closed   $100k     6.99 (16)   3.47 (13)    7.27 (16)  12%/69%/19%
    crypto           US closed     $1M     14.04 (7)  10.36 (7)    10.52 (7)  0%/71%/29%
    stock            US closed     $1k     2.65 (10)   0.88 (10)     1.46 (9)  0%/90%/10%
    stock            US closed   $100k     8.27 (10)   2.88 (10)     3.74 (9)  0%/70%/30%
    stock            US closed     $1M     24.25 (1)  11.24 (1)     6.95 (1)  0%/0%/100%
    idx/cmdty swap   US closed     $1k      0.25 (6)   0.83 (4)     1.09 (6)  100%/0%/0%
    idx/cmdty swap   US closed   $100k      1.06 (6)   1.52 (4)     1.95 (6)  67%/17%/17%
    idx/cmdty swap   US closed     $1M      1.25 (4)   4.59 (4)     2.85 (4)  75%/0%/25%
    idx/cmdty perp   US closed     $1k      2.37 (5)   0.44 (4)     1.15 (4)  0%/60%/40%
    idx/cmdty perp   US closed   $100k      3.01 (5)   1.92 (4)     2.21 (4)  0%/60%/40%
    idx/cmdty perp   US closed     $1M      8.72 (2)  17.95 (2)     9.14 (2)  50%/0%/50%

    One round, Wednesday evening in Tokyo, US closed: a picture of one moment, not a result. The cost is half the round trip in bp of the median mid, plus the taker fee (Variational 0, Lighter 0 on standard accounts, Hyperliquid 4.5 bp, 0.9 bp on HIP-3 in growth mode). A venue more than 1% from the median is a different instrument and is dropped. Indices and commodities come in two rows: Variational's swaps and its perps on the same underlyings.

  4. 4

    Check the Hyperliquid fallback

    1 min
    python3 check_coarse.py

    You will see

    1 rounds
    $    1,000 n=  37  coarse - full, bp: min 0.13  median 0.71  max 3.70  coarse cheaper: 0
    $  100,000 n=  28  coarse - full, bp: min 0.39  median 0.90  max 4.58  coarse cheaper: 0
    $1,000,000 n=  11  coarse - full, bp: min 0.68  median 1.28  max 3.67  coarse cheaper: 0

    When Hyperliquid's 20 levels can't fill a size, summary.py walks its 4-significant-figure book instead. Over 1,026 size-rounds that both books filled, the coarse book was never cheaper, and a median 1.0 bp dearer. So the fallback overstates Hyperliquid's cost; it never flatters it.

Why: what went wrong (measured)

Put together: the parts

1. Save and compare: fabrknt/research (opens in a new tab)

collect.py, summary.py and check_coarse.py. Python standard library only, Apache-2.0.

git clone https://github.com/fabrknt/research

2. Price a size on any book: rdk-clob (opens in a new tab)

Book::quote_market walks the book without changing it. We added it for this study; a property test checks it against a real fill.

rdk-clob = { git = "https://github.com/psyto/rdk", rev = "f263f0882e937f324519201b09fd0995bbcbda1a" }
let q = book.quote_market(Side::Buy, qty);
// q.filled, q.notional, q.worst_price; the book is unchanged

Go deeper, in order

  1. Variational: the read API (opens in a new tab): Quotes by size at /metadata/v2/stats, the rate limit (10 requests per 10 s per IP), and the 600 s cache.
  2. Variational: fees (opens in a new tab): No trading fees; the spread is the revenue. That's why you compare the spread with a book's spread plus its fee.
  3. Hyperliquid: the order book (opens in a new tab): How levels and nSigFigs work, before you trust a walk of 20 levels.

Before real money

Run end to end

2026-11-25 We followed it from a fresh clone of the public repository on 2026-11-25 11:29 UTC (fabrknt/research 4fd3f2b): steps 1 to 4, with the outputs above, in about 45 seconds of machine time (collect 24 s, build 21 s). The first time, on 2026-11-16, it printed sizes as 1e+03; that was fixed in da06d7c.

Fabrknt is independent. We're not affiliated with Variational, Lighter or Hyperliquid. Variational's single-maker design is from its docs, not an accusation. Nothing here is trading advice.