API ReferencePositions
Live

Positions

Every wallet’s holdings are tracked lot-by-lot with FIFO cost basis. Each buy opens a lot; each sell pops tokens off the front of the queue. Query the current book over REST, or subscribe to position deltas to keep it live.

The position object

A position is one FIFO lot for a (wallet, token).

FieldTypeDescription
wallet_addressstringOwner
token_mintstringToken held
entry_signaturestringBuy tx that opened the lot
entry_timestampnumberEntry time, unix ms
entry_price_usdnumberUSD cost basis of the lot
price_per_tokennumberPer-token entry price
original_amountnumberTokens acquired in this lot
remaining_amountnumberUnsold residual (0 ⇒ closed)
statusstringOPEN · PARTIAL · CLOSED
exit_countnumberSells applied to this lot
entry_dexstringVenue used to enter

REST — current book

L2   GET /v1/wallet/{address}/positions

ParameterTypeDefaultDescription
statusstringallopen · closed · all
curl -H "Authorization: Bearer $API_KEY" \
  "https://api.conyr.ai/v1/wallet/7xKXtg.../positions?status=open"
{
  "positions": [
    {
      "wallet_address": "7xKXtg...",
      "token_mint": "EPjFWd...",
      "entry_signature": "5vGk...",
      "entry_timestamp": 1709654400000,
      "entry_price_usd": 234.0,
      "original_amount": 1000000.0,
      "remaining_amount": 500000.0,
      "price_per_token": 0.00000234,
      "status": "PARTIAL",
      "exit_count": 2,
      "entry_dex": "PumpFun"
    }
  ]
}

Stream — position deltas

L2   Channel wallet:{address}:position

Every open / partial-exit / close as it happens, as sequenced delta ops. Each message carries a per-wallet seq (monotonic), slot, ts, and an updates[] array; each update is tagged op: "upsert" or op: "remove".

Update fieldDescription
opupsert (lot changed) or remove (lot fully closed)
mint, entry_signatureIdentify the lot
amountRemaining raw amount of this lot
price, usd_valueLatest exit price and the lot’s USD value
total_remaining_amountWallet+mint aggregate remaining across all lots
avg_entry_price_usd, cost_basis_usdAggregate cost basis for the wallet+mint
directionbuy · sell · swap · flash_swap
ws.send(JSON.stringify({ op: "subscribe", channels: ["wallet:7xKXtg...:positions"] }));
// apply ops in `seq` order on top of the REST snapshot

Backfill with GET …/positions, then apply deltas in seq order — the zero-gap pattern from the REST + Streaming Model.

⚠️

Positions carry cost basis, not mark-to-market unrealized PnL. Derive it client-side as remaining_amount × (latest price − price_per_token) using the latest OHLCV close or Chart Tick. A first-class unrealized-PnL endpoint, and a durable closed-position audit stream (wallet:{addr}:position.closed, with exit pricing and close_reason), are Planned.