Real time Solana DEX volume can be counted before confirmation by summing the amounts each swap instruction declares: the exact input it commits, or the cap it allows. Treat that figure as provisional, store it apart from settled volume, and replace each row once the transaction's outcome is known, because declared amounts and executed amounts are different numbers.
Provisional volume is volume people asked for#
A swap instruction is a request. It names a pool or a route, the token accounts involved, and amount limits. Nothing in it says what the pool returned, because shreds carry only the signed transaction and never its execution result.
So live volume built from raw shreds measures demand: the value traders tried to move in a given slot. That is useful on its own. A spike in requested volume on one pair is a signal whether or not every request fills. It only becomes a problem when the number is shown as if it were settled.
Declared amounts versus executed amounts#
Most pool programs offer two directions of swap. Raydium AMM v4, for example, has a base-in form carrying amount_in and minimum_amount_out, and a base-out form carrying max_amount_in and amount_out. Other programs use the same idea under different names, so read each program's own layout.
| Swap form | What the instruction fixes | What it bounds | Safe provisional figure |
|---|---|---|---|
| Exact input | The amount sent in | The least the trader accepts out | The input amount |
| Exact output | The amount wanted out | The most the trader will pay in | The output amount, or the cap on input marked as an upper bound |
| Routed swap | The input, through a planned route | The minimum final output | The input amount at the first hop only, so multi hop routes are not counted twice |
Pick one side per swap, usually the input, and convert it to a common unit with a price you record next to the row. Never add the minimum output to the input: that double counts the same trade.
Labelling early numbers and correcting them#
Give every early row a status and keep it next to the amount: provisional when decoded from raw data, then confirmed or failed once the outcome is known. The provisional rows post sets out that status model.
The correction comes from RPC. After the transaction lands, its metadata holds pre and post token balances, which give the executed amounts. Write those into the same row, keyed by the transaction's first signature, and move the status forward. An analytics store built for replacement makes this cheap; the ClickHouse guide uses a versioned table so the settled row wins.
Keep both numbers. The gap between requested and executed volume, per pair and per slot, says something about slippage and failed demand that settled data alone hides.
What to show users while numbers are provisional#
- Show the provisional series with a visible marker, such as a lighter line or a "live, unconfirmed" label.
- Show settled volume as the headline figure for any period that has finished settling.
- Never mix the two in one total without saying so.
- When a provisional row turns out to have failed, remove it from the provisional series too, so the live chart does not drift upward.
Failed, partial and duplicate swaps#
Failed swaps. A transaction can land in a block, pay its fee and still fail, for example when the price moved past the trader's limit. Its swap instruction looks exactly like a successful one. Landed but failed explains why raw data cannot tell them apart.
Partial fills. On an exact output swap, the trader may pay less than the cap. Counting the cap overstates volume until the real amount arrives.
Duplicates. The same transaction can reach your receiver more than once. Key rows by the first signature so repeats update instead of adding.
Routes. A routed trade passes through several pools. Count it once at the entry, then attribute venues later; who made this swap covers the attribution side. Order also matters when two swaps hit one pool in the same slot, which order inside a slot explains.
Questions about early volume#
Can early volume be more accurate than settled volume?#
No. It is earlier, not more accurate. Settled volume is the record; provisional volume is a fast estimate of demand.
How much of the provisional figure usually gets corrected?#
That depends on the pair, market conditions and how many failed swaps you see. Measure it on your own data by comparing the provisional and settled series for the same slots.
Do I need prices at the moment of the swap?#
Yes, if you report in a common currency. Record the price you used with each row, so corrections stay consistent. Oracle updates covers one on chain source of prices.
When early volume is the wrong number to publish#
If a figure feeds fees, rewards or anything contractual, use settled volume only. The same goes for comparisons between venues, because failure rates differ by pool and would skew a provisional ranking. Early volume is for monitoring and live displays, where a labelled estimate is better than a late exact number.
Build it#
Start from how swaps look as instructions, then store rows with the ClickHouse guide. If your live chart is time sensitive, compare it with Ultra Low Latency Shreds.
Sources#
- Raydium AMM v4 instruction source (SwapBaseIn: amount_in, minimum_amount_out; SwapBaseOut: max_amount_in, amount_out) (checked 2026-11-18)
- solana-transaction-status 4.4.1, TransactionStatusMeta (pre and post token balances come from execution) (checked 2026-11-18)
- Solana RPC docs: getSignatureStatuses (checked 2026-11-18)
- Agave commitment levels (checked 2026-11-18)
Raw shreds on your own server
Ultra Low Latency Shreds is $200 and Standard Shreds is $100. You pay in crypto, tell us which IPv4 address and UDP port should receive the stream, and we wire it up by hand.