Ray

Ray Swap Size, Pool Depth And Price Impact

Ray swap price impact depends on trade size relative to available liquidity along the chosen route. RAY is Raydium's native token on Solana. Constant-product pools price swaps from their token reserves. Concentrated pools allocate liquidity within price ranges, which can change the depth available to a larger trade. A small-amount quote therefore cannot establish the execution price for a larger order. Compare expected output for the same input, token pair and quote time. Pool fees also affect that output, while slippage protection limits deterioration after quoting. The relevant comparison is the amount available at the intended size, including the route's constraints.

Bottom line: A concentrated pool can lose its pricing advantage when a larger RAY swap reaches price ranges with less active liquidity.

Constant-Product and Concentrated Pools at the Same Size

Pool depth can outweigh fee differences when the same RAY order consumes different shares of available liquidity. Raydium's constant-product market maker (CPMM) and AMM v4 use reserve-based pricing. Its concentrated liquidity market maker (CLMM) allocates deposits across price ranges. Concentrated liquidity can produce better quotes when sufficient depth extends through the swap's price path. A larger constant-product pool can outperform it when that path reaches thinner ranges. Neither design establishes the better fill by itself; the net quote for the same amount captures these differences.


Reserve Depth and the Constant-Product Curve

Constant-product reserves determine how much the execution price changes as input enters the pool. The curve trades against two token reserves whose relationship governs output. Adding input tokens reduces the output reserve, so successive portions of a sale receive less output per input token.

Trade Size Relative to Reserves

A RAY sale uses the pool's RAY balance as its input reserve. A purchase reverses the direction, making the counterpart token the input. The relevant balances are those available to the pricing curve. A CPMM vault can also contain accrued fees that the curve excludes. Reserve comparisons require the same starting exchange rate to isolate depth. More RAY alongside a proportionally larger counterpart reserve allows the same sale with less price movement. Increasing only one reserve also changes the starting price, so it changes the comparison.

Average Output and the Starting Price

The curve output is y × a / (x + a), where x and y are input and output reserves. Here, a is the input entering the curve after input-side deductions. This relationship describes output before further deductions and token-unit rounding. Actual fees can include charges outside this calculation.

The marginal pre-trade rate describes an infinitesimal swap. Multiplying a finite order by that pool's rate overstates its fee-free curve output because the trade moves along the curve.


Active Price Ranges and Larger Concentrated Swaps

Liquidity Around the Starting Price

A CLMM position supplies active liquidity only while the pool price is within its selected range. Several positions can overlap, adding depth around the same price, while total value locked includes deposits outside that region too. That total alone cannot reveal how much nearby trading the pool can absorb. A narrow cluster of liquidity can support a small RAY swap efficiently. Its advantage weakens when a larger trade moves beyond that cluster. Liquidity further along the price path determines subsequent portions of the fill.

Crossing Price Boundaries

Initialized ticks mark price boundaries at which active range liquidity can change. The swap calculation advances through those boundaries as necessary, updating liquidity for subsequent portions. Crossing a tick does not create a separate swap that requires another approval. It forms part of the concentrated-pool calculation.

Available limit orders can add liquidity at particular ticks in CLMM pools that support them. Their contribution depends on orders actually remaining at the prices that the swap reaches. Neither a pool's type nor its total deposits establishes that additional depth.


Matched Reserves in a Hypothetical RAY Sale

The deeper pool produces more output when the starting price and fee treatment match. For this hypothetical comparison, the RAY input after fees equals 3.5% of the smaller pool's RAY reserve. The deeper pool holds 2.5 times both token reserves. Both therefore start at the same exchange rate. Assume identical input-fee treatment, no output-side deductions and no intervening activity.

The smaller pool returns about 96.62% of the starting-price estimate, calculated as 1 / 1.035. The same input equals 1.4% of the deeper pool's RAY reserve. That pool returns about 98.62% of the estimate, calculated as 1 / 1.014. Both percentages compare output with the effective RAY input multiplied by the initial exchange rate in counterpart tokens per RAY.

The deeper pool consequently returns more counterpart tokens for the same effective input. These percentages isolate curve impact; they exclude the input fees already deducted and token-unit rounding. Different starting prices or fee treatment would remove the matched conditions. Rounding can erase a very small output difference.


Pool Fees and Multi-Pool Routes

Net output incorporates the cost of the liquidity path, so impact alone can misrank RAY quotes. A higher-fee pool with greater usable depth can return more than a cheaper, shallower pool. A CPMM pool can charge an additional creator fee when enabled. A CLMM pool that enables dynamic fees can apply a surcharge that responds to price movement.

Trading-fee allocation to RAY buybacks determines a portion's destination within the existing trading charge. If a supported counterpart token has a Token-2022 transfer-fee extension, its transfer deduction also affects net output.

A multi-hop route passes one pool's output into the next pool. Each leg encounters its own fees and liquidity. An intermediate pool can improve the overall quote by avoiding a shallow direct market or reduce proceeds through added costs. Compare final output in the same destination token across the routes actually available.

Graphic: Ray - Pool Fees and Multi-Pool Routes

View image file


Quote Protection and the Received Amount

Slippage protection limits deterioration from a quote that already incorporates the swap's expected curve impact. For an exact-input swap, the minimum output specifies the least amount that execution may return. Increasing tolerance permits a worse fill within that bound. It adds no liquidity and does not improve the quoted curve price.

Raydium's CPMM checks the net amount received against the transaction's minimum output. A swap that cannot meet that bound fails. Solana reverts state changes when an instruction fails within a transaction, although network fees can remain charged. A high-impact quote can still satisfy its bound because that bound derives from the quoted output.

Wallet signing authorizes the transaction; it does not establish that tokens have arrived. Successful transaction data records the actual token balance changes. Comparing that received amount with the earlier quote distinguishes expected curve impact from deterioration between quoting and execution.

Sequential Trades and Separate Pool Liquidity

Sequential RAY sales into the same constant-product pool leave altered reserves for the next sale. Ignoring fees and rounding, splitting the total input across consecutive swaps follows the same curve as one combined swap. Dividing an order alone therefore does not remove its aggregate curve impact.

Separate pools hold separate liquidity, so distributing input among them changes the depth that each portion encounters. That comparison requires the pools' actual starting prices and fee treatment. Executing smaller trades over time introduces another variable: other trades or liquidity changes can improve or worsen later quotes. Additional transactions also incur their own network costs.

Quote Freshness and the Limits of Pool Rankings

A quote's ranking applies to the amount, direction and pool state used to calculate it. Liquidity withdrawals can reduce depth, while added positions can increase it. Price movement can change which concentrated ranges participate. A route that ranked first earlier can therefore rank differently after those changes.

Preparation requires matching input and output mint addresses across comparisons, together with the amount and fee basis. A token name alone does not establish that identity. Before signing, the relevant quote is the one for the transaction's intended size. SOL must also remain available for network costs, which are separate from the quoted token output.

For later swaps, compare current amounts again rather than carrying forward a previous pool ranking. The earlier transaction establishes the delivered tokens for that trade. It does not establish the depth, price or fee configuration available to the next one.

Do Equal RAY Purchases and Sales Have Equal Price Impact?

Equal token quantities do not imply equal price impact in opposite directions. Selling RAY adds it to a pool's input reserve, while buying removes it from the output reserve. The relevant reserve share and price path differ. A sale quote therefore does not establish the cost of repurchasing the same amount.

Why Can a Very Small RAY Swap Fail to Produce Usable Output?

An extremely small input can produce output that rounds to zero in the output token's smallest units. Pool fees can further reduce the amount available to trade. Raydium's CPMM rejects swaps that would deliver zero net output. The boundary depends on reserves, fees and the output token's precision, so it is not a universal RAY amount.

Are RAY Swap Amounts Visible to Other People?

Completed RAY swaps appear in public Solana transaction data. The record includes account addresses and token balance changes, so someone inspecting it can see the movement associated with the swap. An address does not automatically disclose its owner's real name, although linking that address to an identity removes that separation.

Why Might Two Interfaces Show Different RAY price-impact Percentages?

An impact percentage is meaningful only with its reference price and calculation method. Comparing average execution with the pre-trade rate differs from comparing the pool's price before and after trading. Quote time, available routes and fee treatment can also differ. Matching input amounts and net token output provides a direct comparison when the percentage definitions differ.

Does Low Recent Trading Volume Prevent a RAY Pool From Handling a Swap?

Low recent volume does not by itself prevent a funded, active pool from processing a swap. Volume records past trading, while reserve depth and active price ranges govern the present quote. The selected pool must still allow swaps and have usable liquidity. High volume likewise does not establish sufficient depth for the intended amount.

Can a Finalized RAY Swap Be Cancelled Because Its Price Impact Was High?

A finalized, successful RAY swap cannot be cancelled by changing the slippage setting afterward. That setting constrains execution before completion. Trading the received tokens back would require a new transaction with a new quote and further fees. It does not reverse the original fill or restore the earlier pool state.

Updated on