exchange.IO("lp.positions", ...)
List a wallet's Meteora DLMM, Raydium CLMM and Orca Whirlpools positions with range, current amounts, value and uncollected fees.
exchange.IO(k)
exchange.IO(k, filter)
exchange.IO(k, filter, wallet)Examples
-
List this wallet's positions and flag those out of range.
javascriptfunction main() { var list = exchange.IO("lp.positions") if (!list) { Log("Query failed:", GetLastError()) return } if (list.length == 0) { Log("No positions") return } list.forEach(function(p) { Log(p.id, p.symbol, p.priceLower.toFixed(4), "-", p.priceUpper.toFixed(4), p.inRange ? "in range" : "out of range", "value", p.value.toFixed(2), "uncollected fees", p.feesValue.toFixed(4)) }) } -
View another wallet's SOL/USDC positions read-only.
javascriptvar WALLET = "" // the Solana wallet address to view function main() { if (!WALLET) { Log("Set WALLET to a wallet address first") return } var list = exchange.IO("lp.positions", "SOL_USDC", WALLET) if (!list) { Log("Query failed:", GetLastError()) return } list.forEach(function(p) { Log(p.protocol, p.id, p.inRange ? "in range" : "out of range", "value", p.value, "rent", p.rentSol) }) }
Returns
| Type | Description |
array / null value | An array of positions with the common fields |
Arguments
| Name | Type | Required | Description |
k | string | Yes | Set to |
filter | string | No | A pair (such as |
wallet | string | No | Another wallet address, to view that wallet's positions read-only. Defaults to this exchange object's wallet. |
See Also
Jupiter exchange.IO exchange.IO("lp.add") exchange.IO("lp.collect") exchange.IO("lp.decrease") exchange.IO("lp.remove") exchange.IO("lp.increase")
Remarks
Common fields
idis the position ID, which can be passed tolp.increase,lp.decrease,lp.collectandlp.remove:meteora:position account addresson DLMM,raydium:position NFT mintandorca:position NFT minton Raydium and Orca.- Orientation of
symbol, prices and amounts: that of the pair when one is given; otherwise the stablecoin (then SOL) is the quote.priceis the current price,priceLowerandpriceUpperthe range ends, andinRangewhether the price is inside the range. amountBaseandamountQuoteare the position's current token amounts andvaluetheir worth in the quote token at the current price;feesBase,feesQuoteandfeesValueare the uncollected fees;rewardsare the uncollected farm rewards[{mint, symbol, amount}].rentSolis the rent the position locks (returned on closing);closedtruemeans the position has no liquidity, fees or rewards left (only the accounts remain; close them withlp.removeto get the rent back).
Fields by protocol
| Protocol | Extra fields | Notes |
|---|---|---|
| Meteora DLMM | lowerBinId, upperBinId, activeId, binStep, width, feeOwner | width is the number of bins; liquidity is the sum of the bin shares; a position whose feeOwner is not null pays its fees to another wallet and is not supported for operations |
| Raydium CLMM | tickLower, tickUpper, tick, tickSpacing, nftMint, positionAccount, nftAccount | Uncollected fees and rewards are brought up to date from the growth inside the range (rewards advanced to now at their emission rate) |
| Orca Whirlpools | tickLower, tickUpper, tick, tickSpacing, nftMint, positionAccount, nftProgram | Amounts come from the liquidity at the current price, fees and rewards are estimated from the on-chain growth; positions in a Position Bundle carry bundleMint and bundleIndex, and their id is orca:position account address |
How positions are found
- DLMM positions are found by owner with the node's
getProgramAccounts; the official public node serves it, some nodes do not or rate-limit it, and then the call fails. For frequent queries configure your own node in the node address setting. - Raydium and Orca positions are NFTs: NFTs with amount 1 in the wallet are found with
getTokenAccountsByOwnerand their position accounts read (on Orca, positions in Position Bundles the wallet holds are listed too). The position belongs to whoever holds the NFT. - Positions created by
lp.addin this process and those registered withlp.trackare checked as well (ownership verified on chain each time; transferred-away and closed ones are not listed).
Monitoring and exiting are up to the strategy: use inRange, value and feesValue to decide when to rebalance, collect or cut losses.