Skip to content

GuidesPortfolio and history

Orders and live data

Portfolio and history

Two read-only endpoints for wallet screens.

Portfolio

curl "$API/portfolio?owner=0xYou"
{
  "owner": "0xYou…",
  "totalUsd": 312.44,
  "tokens": [
    { "address": "HYPE", "symbol": "HYPE", "name": "HYPE (native)", "decimals": 18, "balance": "10120000000000000000", "price": 24.81, "usd": 251.08 },
    { "address": "0x7D29…", "symbol": "USDC", "name": "USD Coin", "decimals": 6, "balance": "61360000", "price": 1, "usd": 61.36 }
  ]
}
  • Balances are read in one multicall over every token the indexer knows (tokens in at least one pool), plus native HYPE.
  • Zero balances are left out.
  • price and usd come from the same spot prices as /v1/price; null when the token has no route to USDC. totalUsd sums the non-null values.
  • A token with no pool isn't listed (the indexer doesn't know it).

History

curl "$API/history?owner=0xYou&limit=50"
{
  "owner": "0xYou…",
  "items": [
    { "type": "Swapped", "tx": "0x…", "block": "24263601", "time": 1762448100,
      "tokenIn": "HYPE", "tokenOut": "USDC", "amountIn": "1000000000000000000", "amountOut": "24784177", "fee": "12398", "recipient": "0xYou…" },
    { "type": "OrderFilled", "tx": "0x…", "block": "24263580", "time": 1762448050,
      "orderId": "3", "keeper": "0x…", "amountIn": "250000000", "amountOut": "101200000000000000", "remaining": "500000000" }
  ]
}
typeSourceExtra fields
SwappedExecutor, where you are sender or recipienttokenIn, tokenOut (symbols), amountIn, amountOut, fee, recipient
OrderCreatedOrderBook, your ordersorderId, tokenIn, tokenOut, total, perSlice, minOutPerSlice, interval, expiry
OrderFilledOrderBook, your ordersorderId, keeper, amountIn, amountOut, remaining
OrderCancelledOrderBook, your ordersorderId, refunded
  • Newest first, limit up to 200, with block timestamps (time, seconds).
  • Swaps made through this Executor only (other routers' swaps aren't included).
  • The scan starts at EXECUTOR_FROM_BLOCK / ORDERBOOK_FROM_BLOCK; set them to the deployment blocks to make it fast.

PnL and positions

GET /v1/portfolio/pnl?owner= (details in the API reference):

FigmaField
Realized / unrealized PnLsummary.realizedUsd, summary.unrealizedUsd
Cost basis per tokenpositions[].avgCostUsd
Positions table (bought, sold, remaining, PnL, age)positions[]
Equity curveequity[] (180 days)
Daily PnL calendar, number of transactionscalendar[]
Gains by tranchedistribution[]

Method. Average cost, in USD at the time of each trade. Trades come from swaps routed through Lane (all of them) and from swaps on other venues that the indexer saw live with this wallet as the sender. Native HYPE and every WHYPE count as one asset. Tokens held before the tracked history (deposits, older swaps) have no known cost: when sold, they're valued at their sale price, so spending them is neither a gain nor a loss (notes says when that happened). The equity curve values the tracked holdings at each day's last price sample.

Transfers

GET /v1/portfolio/transfers?owner= lists token transfers from the explorer's API, with partOfSwap marking those that are a swap's legs, so the UI can show plain transfers separately.

Sharing

After a swap: post the link https://api.lane.markets/v1/share/swap/{tx}. For PnL: /v1/share/pnl/{address}. The page's preview on X is a 1200×630 card (…/{tx}.png, …/{address}.png), and clicking it opens the app (APP_URL).

Next: API reference

lane.markets · Make the most of every move.