Solana · read from pool accounts

How it reads.

DepthNet reads every pool it knows about straight from its accounts on Solana, replays each pool's own swap arithmetic until it stops absorbing, and publishes two numbers per token: how far apart the exchanges are, and how much each one will take. This page is the whole method, including the rules that make the numbers smaller.

01

In plain terms

When you buy a tokenized stock on a Solana exchange, nobody sells it to you. You draw it out of a pool.

A pool is a program account holding two things, say NVIDIA xStocks and dollars. A buyer puts dollars in and takes shares out, and the pool's arithmetic sets the rate. Every share that leaves makes the next one dearer, so a large order pays more per share than a small one. That difference is the cost to fill.

Most pools do not spread their liquidity evenly. It sits in bands around the current price, deposited by whoever chose to. An order walks through the bands, paying a little more in each, until it is filled or the bands run out. Past the last band the pool has nothing left to sell at any price. DepthNet calls that point the wall, and publishes where it is.

The same token trades in many pools at once, on Orca, Raydium, Meteora and PumpSwap, and none of them talk to each other. At any instant they quote different prices. The cheapest quote is often the shallowest pool, which is exactly why a price on its own is not enough.

02

What DepthNet is

An instrument, not an exchange. It reads and publishes. It holds no funds and never asks a wallet to sign anything.

The name is what it measures: depth, how much a pool can take before its price walks away from the market. Every concentrated pool stores a liquidity_net at each initialized tick: how much liquidity begins or ends there. Add them up as you walk and you have the depth; reach the last one and you know where it runs dry.

It doesHow
Read every pool from chain stateSix programs, six account layouts, decoded byte by byte. No price feed and no indexer on the request path.
Walk depth band by bandThe pool's own swap loop, replayed in the same integer arithmetic, fees included, until it fills or stops.
Test whether a gap can be takenBuy on one exchange and sell on another in simulation, through both pools' real arithmetic.
Not executeNo router, no custody, no signature. A reading is getMultipleAccounts: nobody sees it, nothing moves.
03

The read path

"Pool" is six different programs on Solana, each with its own account layout and its own way of holding liquidity. Reading one as another puts a quote far from the market, so each gets its own decoder, and a pool owned by a program DepthNet cannot read is left out.

ExchangeKindPrice fromDepth from
Orca Whirlpoolsconcentratedsqrt_price (Q64.64) @65tick arrays of 88, fixed or dynamic layout
Raydium CLMMconcentratedsqrt_price_x64 @253tick arrays of 60
Meteora DLMMbinsactive bin pricebin arrays of 70, each bin its own price
Raydium CPMMconstant productvault balances, minus protocol, fund and creator fees still owed
Raydium AMM v4constant productvault balances, minus the pnl the program has yet to take
PumpSwapconstant productvault balances

Two batches, one slot

A reading is two rounds of getMultipleAccounts, up to a hundred accounts a call: first every pool (with its fee config, its vaults, and for Orca its fee oracle), then the liquidity arrays around each price. The second round asks for a minimum context slot equal to the first, so the arrays can never be older than the prices they belong to. The slot a reading names is the slot it was read at.

Addresses are computed, not looked up

Tick arrays, bin arrays and fee oracles live at program-derived addresses: a SHA-256 of fixed seeds (the pool, the array's start index) and the program id, pushed off the ed25519 curve. DepthNet derives them itself, so it can ask for exactly the arrays a walk will touch and nothing else.

04

Bands, bins and fees

Concentrated pools

Orca and Raydium CLMM keep prices as Q64.64 square roots on the same 1.0001-per-tick grid Uniswap uses. DepthNet shifts them into Q64.96 and walks them with the tick arithmetic it already proved exact against Uniswap's own quoters. Each step stops where the program's own loop stops: at the next initialized tick or the edge of the current tick array (88 ticks for Orca, 60 for Raydium).

Orca's adaptive fees

Many Orca pools no longer charge a flat fee. Their oracle account tracks a volatility accumulator, and the fee rises with the square of how many tick groups a trade crosses: static fee plus ⌈control · (va · group size)² / 10¹³⌉, capped at 10%. A small order barely notices; a large one can pay well over 1%. DepthNet reads the oracle, refreshes the references the way the program does at the start of a swap, and recomputes the fee in every tick group the walk crosses.

Meteora bins

A DLMM pool is a row of bins, each a constant-sum market at its own price. A trade drains the active bin's output side, then moves one bin on. Its fee also rises with every bin crossed, from the pool's own volatility parameters. DepthNet walks the bins in order with the same fee rule.

Constant-product pools

Raydium CPMM, Raydium AMM v4 and PumpSwap price from their vault balances: x·y = k, the fee taken from the input first and rounded up, the output rounded down. Fees owed to the protocol still sit in the vaults until they are claimed, so they are subtracted before anything is priced.

05

Walking the depth

Liquidity sits between ticks. An order walks from the current price toward the next initialized tick, takes whatever that band holds, crosses the tick (adding or removing the liquidity that starts or ends there), and carries on. DepthNet runs that loop against the pool's own tick data, in BigInt, with the program's own rounding. It is not a curve fitted to past trades.

// engine/simulate.mjs, the loop in outline
while (remaining > 0n) {
  const next = ticks[idx];                                  // next initialized tick ahead
  const target = next ? sqrtAtTick(next.t) : limit;
  const step = swapStep(sqrtP, clamp(target, limit), L, remaining, feeHere);
  remaining -= step.amountIn + step.feeAmount;
  out += step.amountOut;
  sqrtP = step.next;
  if (sqrtP !== target) break;                              // filled inside this band
  L = zeroForOne ? L - next.net : L + next.net;            // crossed: the band changes
  idx += zeroForOne ? -1 : 1;
}

Checked against real quotes

npm run verify asks Jupiter, Solana's main router, for a direct route restricted to each pool's exchange. When Jupiter routes through the same pool, its quote is that pool's own program answering, and DepthNet's replay of the same trade is compared with it, buying and selling from $100 to $50,000.

On 7 November 2026: 140 trades across all six exchanges, 135 within one basis point of Jupiter, most of them exact to the last unit (Meteora's TRUMP, BONK and JUP pools, Orca's MPLX and JLP pools, Raydium's QQQx and CRCLx pools, every Raydium AMM and CPMM pool tried). The five that were further out were all on busy or fee-shifting pools, where the pool can change between DepthNet's read and Jupiter's: up to 10 basis points on a $10,000 trade through an Orca adaptive-fee pool, and 20 on one $100 trade through a Meteora pool.

The ladder

Every token is drilled at the same six sizes, in dollars, plus any size you type:

$100   $1,000   $10,000   $50,000   $250,000   $1,000,000

Pools quoted in SOL are walked in SOL, at the price of the deepest SOL/USDC concentrated pool, read in the same batch. Nothing else prices the SOL leg.

06

The wall

A walk stops in one of three places: the order is filled, the liquidity runs out, or the marginal price has moved 10% from where it started. The third is a rule, not a fact about the pool, and it is the same rule for every kind of pool.

Without it, a pool with one wide position would report that it "absorbs" any size at all, just at an absurd price, and constant-product pools never run out by construction. Ten percent is far past anything anyone fills on purpose. When you see runs out, the pool genuinely had nothing left; when you see price up 10%, it still had liquidity, but only at prices nobody should accept.

07

What counts in a spread

The price gap is the difference between the cheapest and dearest exchange at one slot. Which pools belong in it is a decision. Here are the three rules. Each one makes the headline smaller.

An emptied pool is not a quote

A drained pool keeps the price it was abandoned at forever. Only pools that can fill the smallest rung ($100) whole count toward the gap. The rest stay in the table, marked.

A ticker is not an identity

Anyone can mint a token called NVDAx, and people do: on the day this was written, the single largest "NVDAx" pool on Solana held a lookalike priced at a cent. Every xStock resolves to its official mint (the issuer's addresses all begin Xs), every other ticker to the mint whose money-paired pools hold the most, and the ones set aside are listed with what they hold.

Unknown programs are dropped

A pool owned by a program DepthNet has no decoder for is recorded as unclassified rather than priced. That is why the exchange list is shorter than the list of names on Solana.

The fair price, the number costs are measured against, is the median mid-price of the pools that can fill $100.

08

The crossing

A gap is only interesting if it can be taken. At every rung, DepthNet buys on each fillable pool and tries selling exactly what came out on every other one, using the state it has already read. Both fees and both price impacts are inside the result.

Not inside it: network fees, the chance that someone else takes it first, and the fact that both pools move the moment anyone acts. It measures a disagreement. It promises nothing, and most of the time it comes back empty.

09

The registry

Something has to say which pools exist. That is the only job an indexer does here. npm run canon walks GeckoTerminal and DexScreener once, offline, then asks the chain what each pool actually is: which program owns it, which mints it holds, where its vaults and fee config are. The result is written to data/registry.json. From then on a page load is chain reads and nothing else, so another service's rate limit or outage cannot change a published number.

Reading the registry…

10

The API

The same endpoints the pages call. CORS is on, there is no key, and every response names the slot it was read at (as blockNumber).

GET /api/assay?ticker=NVDAx
GET /api/assay?ticker=SPYx&size=25000
GET /api/assay?ticker=Xsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh&sizes=100,5000,1m

  blockNumber     the slot every number was read at
  readMs          how long the read took
  spot            median mid of the fillable pools
  dispersionBps   cheapest to dearest, fillable pools only
  venues[]        per pool: kind, fee, spot, capacity, stop, the ladder, the curve
  best[]          the pool that gives the most tokens at each rung
  crossing        the best buy-here, sell-there that survives, or null
  impostors[]     same-symbol tokens that were set aside
GET /api/board                  the watchlist at one slot: gap, depth, best per rung
GET /api/compare?tickers=NVDAx,AAPLx,TSLAx&size=25000   ranked by all-in cost
GET /api/venues                 every exchange: wins, fills and typical cost at each size
GET /api/tickers                what the registry knows
GET /api/registry?ticker=NVDAx  the pools behind one token

Readings are cached for fifteen seconds so bursts are served from memory rather than the chain. A reading is only true for the slot it names.

11

Reproduce it

Every figure has a command behind it. They are the same functions the server calls.

npm run assay NVDAx         # one token, every pool, the whole ladder
npm run assay SPYx 25k 1m   # at the sizes you name
npm run canon               # rebuild the registry: the only step that uses an indexer
npm test                    # the tick math, against the contracts' own constants
npm run verify              # every simulated fill, against Jupiter's quotes

Point DEPTHNET_SOL_RPC at any Solana node and the numbers come out the same, because they come out of the chain.

12

What it cannot see

Being plain about the edges is part of the method.

  • Fees that depend on the clock. Orca's adaptive fees and Meteora's variable fees decay with time since the last trade. DepthNet uses this computer's clock, which can be a few seconds from the chain's, so on very large orders through those pools the fee can be off by a few basis points.
  • Order books and other programs. Phoenix, OpenBook, Lifinity, Meteora's dynamic pools and market makers that quote off chain are listed as unclassified rather than priced.
  • Transfer fees. Some Token-2022 mints charge a fee on every transfer. It is not inside the numbers.
  • Routing. The best exchange at a size is a single pool taking the whole order. Splitting across pools can do better; that is a router's job, and DepthNet is not a router.
13

Glossary

TermWhat it means here
xStockA tokenized share on Solana, issued by Backed (NVDAx is NVIDIA). One token tracks one share.
PoolOne program account holding two tokens that trade against each other.
Band · binA stretch of price with its own liquidity: between two ticks in a concentrated pool, one bin in Meteora.
Fair priceThe median mid-price of the pools that can fill $100.
Above fairWhat you pay per token, fee and impact included, compared with the fair price.
Price gapThe difference between the cheapest and dearest pool that can fill $100, at one slot.
Can absorbThe dollars an order can put in before the price is up 10% or the pool runs out.
SlotSolana's clock: one every 400 milliseconds or so. Every reading names the one it was taken at.
Basis pointA hundredth of a percent. The site shows percentages; the API keeps basis points.