Skip to content

How Rangeview calculates Raydium profit and loss

By , Rangeview operator · Reviewed

Rangeview calculates position profit / loss as current liquidity plus unclaimed fees, claimed fees and withdrawn capital, minus total deposits. Historical cash flows use USD prices at their transaction timestamps.

What is the position P/L formula?

Profit / loss = current liquidity + unclaimed fees + claimed fees + withdrawn capital − total deposits. Network and transaction costs are excluded. This measures the position’s valued cash flows, not performance relative to holding the original tokens.

For an illustrative example, $2,480 current liquidity + $32 unclaimed fees + $60 claimed fees + $140 withdrawn capital − $2,600 total deposits = $112 profit. These are sample amounts, not a live portfolio or a forecast.

Where do the figures come from?

Solana RPC supplies the transaction history of each personal position. Rangeview decodes Raydium CLMM events to distinguish deposits, returned capital and collected trading fees. Separate positions in one pool are accounted for independently.

Birdeye historical token prices value deposits, withdrawals and claimed fees at each transaction timestamp. Current token prices come from Raydium. Unclaimed fees are derived from current pool and boundary-tick state. Valuations can be incomplete or delayed.

Total deposits include the opening deposit and later liquidity increases, each valued at its own timestamp. A withdrawal is returned capital, not a collected trading fee; keeping these separate avoids counting a withdrawal as fee income.

Why does Rangeview display Unavailable?

A complete calculation needs archival RPC history back to position creation, token metadata and historical USD prices for both tokens at each cash-flow event. Missing configuration or source data makes historical metrics Unavailable. Rangeview does not treat missing data as zero.

Current liquidity, range status and available unclaimed fees can load independently of historical P/L. A failure in historical valuation does not mean the wallet has no positions.

How should I read APR and estimated earnings?

Estimated yearly fees use current liquidity USD × the position’s available Lifetime Fee APR / 100. Monthly estimates divide that amount by 12; daily estimates divide it by 365. The projection does not compound and excludes unclaimed fees from its liquidity base.

An out-of-range projection describes a scenario after the position returns to range. It does not mean fees are currently accruing outside the range. Missing APR is not replaced by a pool-wide APR. Changing prices, liquidity and activity can change results; estimates do not guarantee future earnings.

Sources and method

This guide describes Rangeview’s implementation. The data sources page explains which sources the application uses. The underlying protocol is documented in Raydium’s CLMM program and SDK.

Values are estimates for informational purposes, not investment advice. Verify figures at their source before making decisions. Rangeview is an independent application and is not an official Raydium product.