Raydium fees - swap cost comparisons and final balance checks
The total cost of a Raydium swap combines each pool's configured swap charges with the Solana fee for the processed transaction. Some tokens can also impose transfer fees. Price impact affects the quoted exchange result, while slippage tolerance sets an execution boundary; neither is an additional protocol charge. Compare routes with the same token mints, trade direction, amount, quote mode, slippage setting, and observation time. For an exact-input swap, the strongest comparison is net quoted output plus the separately denominated SOL cost. After confirmation, reconcile the input decrease, output increase, and SOL decrease against the transaction record. That balance check reveals charges or account funding that a single percentage can miss.
Updated
Compare net quoted output and separate SOL charges, then use confirmed balance changes to establish the swap's final cost.
Comparing two quotes on the same basis
A valid comparison holds the exchange request constant. For exact input, use the same input quantity and compare the net output that each route quotes. For exact output, hold the requested output constant and compare the required input. Mixing these quote modes can make one route appear cheaper even though the two quotes answer different questions.
Quote time matters because pool balances and active liquidity can change between observations. Record both routes close together and use the same slippage tolerance. A lower displayed fee rate does not settle the comparison by itself. Available liquidity, the number of pool interactions, transfer charges, and price impact can all change the quantity that reaches the wallet.
Keep the estimated Solana fee in SOL instead of adding it directly to a token-denominated pool charge. Converting everything into one currency requires a valuation rate and timestamp, which should remain consistent across both routes.
Which costs belong in the final total?
The final cost record includes pool, token-transfer, and network charges, while keeping the exchanged principal separate. Price impact and slippage also need distinct labels because neither one is an additional fee paid to Raydium.
- Each pool in the selected route applies its configured trading fee. A CPMM pool applies a separate creator fee only when that fee is enabled for the pool.
- The quoted exchange result reflects the route's pool fees and curve pricing.
- A Token-2022 mint can deduct its own transfer fee from an input or output transfer.
- Solana charges a transaction fee in SOL, including any selected priority component.
- A missing receiving token account can require separate SOL funding for account creation.
Price impact describes how the requested trade changes the pool's execution price relative to its reference price. Slippage tolerance sets the worst acceptable execution boundary as the market state changes. A wider tolerance can permit a less favorable fill, but it does not increase the configured pool fee rate.
Pool fees across route structures
Route structure determines where trading charges enter the calculation. The router can use a direct pool, several pools in sequence, or eligible branches that divide the input. Each participating pool applies its own configuration to the amount that reaches it.
Direct pool route
Fee basis
The fee that the pool charges is calculated in the token units used by that pool's swap instruction. The quote applies that charge before presenting the expected exchange result. Distributing the trading fee among liquidity providers and protocol destinations does not add another charge. An enabled CPMM creator fee is separate from that trading fee.
Comparison evidence
Quoted output is the practical measure for an exact-input comparison because it captures both the fee and the pool's pricing curve. The displayed percentage remains useful for explaining the route, but it cannot show the effect of available liquidity on its own.
Multi-hop and split routes
A multi-hop route passes one pool's output into the next pool, so each hop calculates a fee on the amount it receives. A split route sends portions through separate branches, where every branch uses its own pool settings. Compare the combined final output with a direct route rather than multiplying a headline rate by the original input for every interaction.
Why can a lower-fee route return less?
A lower-fee route can return less when its pricing curve produces greater price impact than a route with a higher fee. The amount and distribution of active liquidity affect the quoted exchange rate. A longer route may also outperform a direct pool if its intermediate pools offer a stronger combined result after every applicable fee.
Use net quoted output for the decision, then inspect the fee and price-impact fields to understand the difference. Repeat the comparison if one quote is older or based on a changed pool state. The preferred route can change when the input quantity changes because both curve movement and per-hop amounts change with trade size.
Network and token transfer charges
A Solana transaction fee consists of a base fee plus any optional priority fee selected for the transaction. A higher priority fee can improve the transaction's scheduling position during congestion, but it does not improve the pool's quoted exchange rate. Because the network charge uses SOL, the fee payer needs enough SOL in addition to the token being exchanged.
Token-2022 transfer fees belong to the affected mint rather than the liquidity pool. A fee can apply as the input moves into a pool or as output reaches the wallet. The live mint configuration supplies the rate and any maximum charge, so a cached percentage is not enough for an accurate comparison. Net wallet receipt is the relevant output measure.
Account creation can produce another SOL balance change. If the receiving token account already exists, that funding is absent. If the transaction creates one, separate its rent-exempt account funding from the validator fee and the Raydium pool charge.
How do you verify the quoted cost after confirmation?
Verification compares the pre-swap balances and acceptance limits with the confirmed transaction and post-swap balances. Assume every number and state in this example is hypothetical: an exact-input exchange uses 1,273 input units, quotes 508.4 output units, shows a 0.25% pool fee, and uses 0.6% slippage. The output balance starts at 40 units, the SOL balance starts at 1.8 SOL, no token transfer fee applies, and the receiving account already exists.
The minimum output is 508.4 × (1 - 0.006), or 505.3496 units. The reader's acceptance condition requires at least 505 output units and no more than 12,000 lamports in network fees. The hypothetical transaction uses one signature, with a projected 5,000-lamport base fee and 7,000-lamport priority fee. Its quoted minimum output and projected 12,000-lamport network fee therefore meet both conditions before approval.
After confirmation, the input balance has decreased by 1,273 units, the output balance is 546.9 units, and the SOL balance is 1.799988 SOL. The observed output increase is 506.9 units, which exceeds the 505.3496-unit slippage minimum and the 505-unit acceptance minimum. The SOL decrease equals the 12,000-lamport fee cap, and no separate account funding appears. The confirmed state therefore matches the permitted cost and output range.
Failures, retries, and fees already spent
A failed on-chain swap can reduce the fee payer's SOL balance even when neither token balance changes. Solana charges the transaction fee whether execution succeeds or fails. A rejection that occurs before submission has no on-chain transaction fee because the network never processes a signed transaction.
Count each retry that produces an on-chain transaction record as a separate network-cost event. A replacement attempt can also use a different quote, route, priority fee, or slippage boundary. Preserve the transaction record for every processed attempt so the final cost does not omit SOL spent on earlier failures.
Choosing the better route for the job
Route selection should follow the quote mode. An exact-input swap favors the route with the acceptable highest net output, while an exact-output swap favors the acceptable lowest required input. In both cases, compare token results first and keep SOL charges visible beside them. A currency conversion is optional, but both routes need the same valuation basis.
Final balances provide the strongest reconciliation. Match the confirmed input decrease, output increase, and SOL decrease to the transaction details, then identify any transfer deduction or account funding separately. A route that looked cheaper from its pool percentage can lose the comparison once price impact, extra hops, or token-level charges enter the recorded total.
Raydium fees: what people ask
Do Raydium pool fees always come out of SOL?
No. Pool trading fees are applied within the token amounts processed by the selected liquidity pools, and their effect appears in the quoted exchange result. The Solana transaction fee is the separate charge paid in SOL. A Token-2022 transfer fee, when configured for a participating mint, is also denominated in that token rather than SOL. The SOL balance change therefore does not represent every swap cost.
Which figure makes exact-input and exact-output quotes comparable?
The quotes become comparable only after one side of the exchange is held constant. With exact input, keep the input quantity fixed and compare net output. With exact output, keep the requested output fixed and compare required input. If the modes differ, normalize them to the same input or output target before judging cost, while keeping network fees and observation times consistent.
Can the same fee rate produce a different token charge?
Yes. A percentage applies to the amount handled at that point in the route, so changing the trade size or the quantity reaching a later hop changes the token charge. Integer rounding can also affect the smallest token units. On a route with several pools, each pool applies its fee to its own received amount rather than repeatedly charging the original input quantity.
When can a Token-2022 transfer charge stop increasing proportionally?
A Token-2022 transfer charge stops rising proportionally when the mint's configured maximum fee is reached. Below that cap, the percentage governs the deduction; at the cap, a larger transfer does not increase that particular charge beyond the configured maximum. The applicable configuration can depend on the current epoch, so the quote and confirmed token balance should use the active mint settings.
Does creating a receiving token account count as a Raydium fee?
No. Funding a new receiving token account is separate from the pool trading charge and protocol fee distribution. It can still increase the transaction's SOL balance change because the account-creation payer must fund the new account's rent-exempt balance. Check whether the account existed before the swap, then distinguish its funding from the validator fee when reconciling the final cost.