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).
| Field | Type | Description |
|---|---|---|
wallet_address | string | Owner |
token_mint | string | Token held |
entry_signature | string | Buy tx that opened the lot |
entry_timestamp | number | Entry time, unix ms |
entry_price_usd | number | USD cost basis of the lot |
price_per_token | number | Per-token entry price |
original_amount | number | Tokens acquired in this lot |
remaining_amount | number | Unsold residual (0 ⇒ closed) |
status | string | OPEN · PARTIAL · CLOSED |
exit_count | number | Sells applied to this lot |
entry_dex | string | Venue used to enter |
REST — current book
L2 GET /v1/wallet/{address}/positions
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | all | open · 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 field | Description |
|---|---|
op | upsert (lot changed) or remove (lot fully closed) |
mint, entry_signature | Identify the lot |
amount | Remaining raw amount of this lot |
price, usd_value | Latest exit price and the lot’s USD value |
total_remaining_amount | Wallet+mint aggregate remaining across all lots |
avg_entry_price_usd, cost_basis_usd | Aggregate cost basis for the wallet+mint |
direction | buy · sell · swap · flash_swap |
ws.send(JSON.stringify({ op: "subscribe", channels: ["wallet:7xKXtg...:positions"] }));
// apply ops in `seq` order on top of the REST snapshotBackfill 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.