Raydium swap fees explain why quoted cost and final output differ

Raydium swap fees explain only part of a mismatch between a displayed quote and the tokens that finally reach a wallet. For an exact-input quote, the expected output already reflects pool pricing and the route’s pool charges, while price impact changes the exchange result without becoming a separate fee. Slippage sets an execution boundary rather than a planned deduction. Solana network charges reduce the fee payer’s SOL balance, and an eligible Token-2022 mint may apply its own transfer fee. Reconcile the same specified amount, swap mode, route, quote state, tolerance, and unit convention for each mint against the confirmed transaction. That comparison separates an ordinary execution difference from an unexplained balance change.

Last updated
Table of contents
Key takeaway: Compare the refreshed quote, minimum received, Solana network fee, and token balance delta before assigning a mismatch to pool fees.

Costs that appear before approval

A pre-approval quote can expose three cost classes with different accounting paths. Pool charges affect the exchange calculation, Solana fees use SOL, and mint-level transfer fees affect the token movement on which they are configured.

The pool charge

The pool fee is deducted under the configuration of each pool used by the route. It is normally incorporated into expected output rather than collected later from a second wallet debit. Its allocation among liquidity providers and protocol-controlled destinations does not create another deduction from the trader.

The network charge

The Solana network fee belongs to the transaction, not the exchange rate. A base fee covers signatures, while an optional priority fee can improve scheduling during congestion. Either charge affects the fee payer’s SOL balance without reducing the quoted output-token amount.

The mint transfer charge

A Token-2022 mint with a transfer-fee extension can withhold part of a transfer. The input mint, output mint, or both may carry that configuration. This deduction belongs to the mint’s rules and remains separate from the fee that the pool charges.


Price impact, fees, and the slippage boundary

Price impact measures how the requested amount moves through available liquidity relative to the pool’s pre-swap price. It changes expected output, especially when the amount is large relative to active liquidity. No separate account receives a line item called price impact, so subtracting it again from quoted output would count the same economic effect twice.

Slippage tolerance addresses a later change between quote calculation and execution. The prepared transaction carries a minimum output for an exact-input swap or a maximum input for an exact-output swap. Raising the tolerance does not lower the pool charge or guarantee a worse fill; it permits execution across a wider range. A successful exact-input swap may settle below its expected output but above its minimum. A successful exact-output swap may require more input than expected but no more than its maximum.


Route depth and repeated pool deductions

A multi-hop route passes one pool’s output into the next pool as input. Each participating pool applies its own configuration, so route-level cost depends on every hop. Raydium’s router does not add a separate routing fee, although several pool deductions can occur inside one route.

A route with more hops is not automatically worse. Deeper liquidity can produce a better final output despite another pool charge. Refreshing the quote may select different pools as their state changes, which means two quotes for the same token pair are not comparable until their routes and timestamps align.


Which values belong in a like-for-like comparison?

A like-for-like comparison uses the same specified amount and swap mode, a consistent unit convention for each mint, and the exact quote that produced the submitted transaction. For an exact-input swap, expected output, minimum output, and the confirmed balance delta answer different parts of the reconciliation. For an exact-output swap, compare the target output and maximum input with the confirmed token deltas.

Expected output

Expected output is an estimate calculated from the selected route and pool state. It describes the quote moment, not a promise that market state will remain unchanged until execution. A refreshed estimate replaces the older one for a new decision.

Minimum output

Minimum output is the execution boundary derived from the reviewed quote and slippage setting. A swap should fail rather than settle below the applicable bound. A value above that boundary can still be lower than the earlier expected output.

Confirmed balance delta

The balance delta compares the output token account before and after the confirmed transaction. Use the same mint, account, and smallest-unit convention on both sides. Rounded wallet displays can hide small differences, while transaction metadata preserves the recorded token amounts.


SOL as a separate prerequisite

The designated fee payer needs enough SOL before a normal swap transaction can be submitted. This remains true when neither exchanged token is SOL because the network charge is independent of the swap assets. An insufficient SOL balance is a missing prerequisite, not evidence that the pool fee increased.

A larger SOL debit may also reflect creation of a required token account when that instruction is present. The lamports reserved for account storage are not a Raydium trading fee. Inspect the transaction instructions and fee field before treating the entire SOL change as the cost of execution.

Token-2022 deductions at the mint boundary

Token-2022 transfer fees apply independently to each configured mint. An input-side fee can reduce what reaches the pool vault, while an output-side fee can reduce what reaches the recipient token account. Raydium’s supported Token-2022 swap paths account for these transfers, but the final balance delta remains the clearest completion evidence.

The mint configuration can include a maximum fee per transfer and an epoch-based change in its active rate. A quote should therefore distinguish the pool fee from any transfer-fee amount. If the applicable mint configuration changes after quoting, the transaction may produce a different net amount or fail its execution boundary.

Token-2022 deductions at the mint boundary: The mint configuration can include a maximum fee per transfer and an epoch-based change in its active rate.; A quote should therefore distinguish the pool fee from any transfer-fee amount.; If the applicable mint configuration changes after quoting, the transaction may produce a different net amount or fail its execution boundary.

Open full-size image

Worked reconciliation with two hypothetical quotes

All token roles, amounts, settings, and results in this example are hypothetical. A reader enters 7,314 input units and sees an older expected output of 6,384 units. With a hypothetical 1% tolerance, that quote shows a minimum of 6,320.16 units.

The wallet lacks enough SOL for the network charge, so neither action is ready for submission. Resolving that prerequisite comes before comparing the two exchange choices; otherwise, a fee-payer failure can be mistaken for a problem with the output quote.

The first action would rely on the older display. The second requests a fresh quote using the same 7,314 input units, then compares the route, expected output, minimum output, and disclosed fees on the same basis. Suppose the refreshed quote expects 6,350 units and sets a minimum of 6,286.50 units. Use the refreshed quote because it can be matched to the prepared transaction.

After confirmation, the output-token balance rises by 6,340 units. That is 10 units below the refreshed expectation but 53.50 units above its minimum. The transaction record also identifies the separate SOL charge. The old quote’s 44-unit difference is not an extra fee because that quote did not produce the submitted transaction.


A bounded reconciliation method

A bounded reconciliation follows the submitted quote through its recorded deductions and stops when every balance change has an identified cause. It does not rebuild the swap from a different quote or unrelated market price.

Fix the comparison basis

The comparison basis should preserve the specified input or output amount, exact-in or exact-out mode, token mints, route, slippage setting, and quote state. Use either raw smallest units throughout or apply the correct mint decimals consistently. Mixing display units with raw values creates false discrepancies.

Trace deductions in order

The deduction order starts with any input-mint transfer fee, continues through the pool fee and curve calculation at each hop, and ends with any output-mint transfer fee. Keep the Solana network charge in its SOL ledger. Do not subtract price impact after using the route’s expected output.

Resolve only the remainder

The remainder deserves investigation only after the confirmed token delta, mint-level deductions, pool charges, and SOL debit have been matched. Check whether the wallet showed another token account or rounded the display. If a retry is needed, obtain a fresh quote instead of silently widening the tolerance.

Why can a failed swap still reduce SOL?

A submitted Solana transaction that reaches execution can consume its network fee even when execution fails. Solana processes the signatures and attempted instructions before recording the error. The transaction’s state changes do not settle, so no successful swap output should appear, but the network work has still occurred.

A simulation or preflight rejection without an on-chain transaction is a different case. A wallet error alone does not prove that a fee was charged. Match the signature, status, fee payer, and recorded fee before adding the SOL debit to the reconciliation.


Pool configurations that change the diagnosis

Pool configuration determines which fee fields matter. CPMM pools can carry a separately enabled creator fee, and its fixed direction setting can place that fee on the input or output side for a given swap direction. CLMM pools use configuration-linked fee tiers, while legacy AMM v4 pools store their fee parameters with the pool.

Protocol, fund, treasury, buyback, and liquidity-provider shares describe distribution of a charged trade fee. They should not be added again as though each were a new trader charge. An enabled CPMM creator fee is different because it is a separate pool-level deduction, and the live quote must expose its effect.

Legacy AMM v4 does not support Token-2022 swaps, whereas supported CPMM and CLMM paths handle eligible Token-2022 transfer-fee mints. Identifying the actual pool type and route prevents rules from one program from being applied to another. Reconciliation closes when the confirmed output transfer, less any output-mint transfer fee, matches the wallet delta and each SOL debit has its own recorded cause.

What readers ask about Raydium swap fees

Does reversing a completed Raydium swap return the original fees?

No. A reverse swap is a new on-chain exchange with a fresh quote, pool deduction, price impact, and Solana network fee. It does not unwind the original transaction or restore its fee. Because pool state can move between the two swaps, reversing immediately may return less of the starting token even before the second network charge is considered.

When can a CPMM creator fee come from the output token?

A CPMM creator fee can come from output when the pool was created with creator fees enabled and its fixed direction setting places that fee on output for the swap direction. Otherwise, it may apply on input or remain disabled. The live quote and pool configuration, not the token symbol alone, determine whether that separate deduction applies.

Does closing an unused token account refund the Solana transaction fee?

Closing an eligible empty token account can return the lamports reserved for that account, but it does not refund any Solana network fee. The close authority must authorize the action, and the account must meet the token program’s closure conditions. The closing transaction also has its own network fee, so keep rent recovery and transaction charges as separate ledger entries.

Why can a Token-2022 transfer fee be lower than its stated percentage?

Token-2022 transfer fees can include a maximum amount per transfer, so the effective percentage falls after the cap is reached. Integer rounding can also affect the smallest-unit result. Read the mint’s applicable fee configuration for the execution epoch and compare the withheld amount with the transfer itself; a headline percentage alone may not reproduce the recorded deduction.

At what point should a Raydium fee quote be treated as stale?

A fee quote should be treated as stale when a refreshed quote changes its route, quoted amount, applicable slippage boundary, or fee lines, or when the prepared transaction no longer reflects the reviewed values. There is no durable universal age in seconds for every market. Pool state and configuration changes, rather than elapsed time by itself, determine whether the old comparison remains usable.

Could changing only the swap amount produce a different effective cost?

Yes. A different input amount can move farther along the pool’s pricing curve, cross more concentrated-liquidity ranges, or make another route produce better output. Pool fee rates may remain unchanged while price impact and route composition change. Compare effective output only after refreshing both quotes with the same slippage convention and the same token-unit basis.