Skip to main content
GET
Get Wallet Position History
Alpha — This endpoint is in early access. Response shape, field names, and cycle boundary semantics may change without notice.

What is a “cycle”?

Existing /wallet/position and /wallet/positions endpoints return the lifetime aggregate for a wallet+token pair (sum of all buys, sum of all sells, one blended avg price). That’s great for “what did I do overall”, but it hides the fact that most traders buy → fully sell → buy again → fully sell, and each of those is a distinct trade with its own PnL. A cycle is exactly that: a contiguous run of trades that opens on the first buy after a flat (zero-balance) state and closes when the cumulative token balance falls back to ≈ 0. Formally, a cycle is considered closed when the remaining balance ≤ 0.1% of the max balance reached within the cycle, so residual dust from rounding doesn’t keep cycles open forever. If the most recent cycle hasn’t closed yet, it’s returned with isOpen: true and a non-zero unrealizedPnlUSD computed from the wallet’s current remaining balance × the token’s live price.

Query Parameters

ParameterTypeRequiredDescription
walletstringYesWallet address.
assetstringYesToken contract address.
blockchainstringYesBlockchain name or chain ID (e.g. solana, ethereum, evm:8453).

Usage Example

Sample Response

If the wallet is currently holding the token, the trailing cycle looks like this instead:

Field semantics

FieldMeaning
isOpentrue if the last cycle has not yet returned to dust balance.
entryDate / exitDateFirst and last swap in the cycle. exitDate is null when isOpen: true.
buys / sellsBuy and sell swap counts within this cycle only.
volumeBuyToken / volumeSellTokenCumulative token amounts bought / sold in the cycle.
volumeBuyUSD / volumeSellUSDCumulative USD value paid / received.
avgBuyPriceUSD / avgSellPriceUSDVolume-weighted average buy / sell unit price within the cycle.
realizedPnlUSD(avgSellPriceUSD − avgBuyPriceUSD) × min(volumeSellToken, volumeBuyToken). For a cleanly closed cycle this equals volumeSellUSD − volumeBuyUSD.
unrealizedPnlUSDOpen cycles only: remainingBalance × (currentPriceUSD − avgBuyPriceUSD). 0 for closed cycles.
totalPnlUSDrealizedPnlUSD + unrealizedPnlUSD.
remainingBalanceTokens still held at the cycle’s end. 0 for closed cycles (within dust tolerance).
currentPriceUSDLive unit price used to compute unrealizedPnlUSD. null for closed cycles.
feesUSDSum of gas + platform + mev fees paid across all swaps in the cycle.
swapCountTotal number of swaps that touched this cycle.
Orphaned sells that happen before any buy (for example, a token received via a raw transfer and later dumped) have no cost basis and are skipped — they cannot open a cycle.

SDK Usage

Query Parameters

wallet
string
required

Wallet address

asset
string
required

Token contract address

chainId
string

Blockchain chain ID (e.g., "evm:56", "solana:solana")

Response

200 - application/json

Ordered list of position cycles for the wallet/token pair.

token
object
required
cycles
object[]
required