Skip to content

API ReferenceAccount

Endpoints

Account

Balances valued in USD, and the swap and order history of an address.

Base URLhttps://api.lane.markets/v1local instance: http://localhost:3000/v1

Native and token balances, valued in USD

GET/v1/portfolio

Query parameters

  • owneraddressrequired

Responses

200Portfolio

  • owneraddress

  • totalUsdnumber

  • tokensobject[]

  • tokens[].addressstring

  • tokens[].symbolstring

  • tokens[].namestring

  • tokens[].decimalsinteger

  • tokens[].balanceuint string

  • tokens[].pricenumber | null

  • tokens[].usdnumber | null

Request
curl "https://api.lane.markets/v1/portfolio?owner=0xYourAddress"

Swaps and order lifecycle events of an address

GET/v1/history

Query parameters

  • owneraddressrequired

  • limitintegerdefault 50

Responses

200History, newest first

  • owneraddress

  • itemsobject[]

  • items[].type"Swapped" | "OrderCreated" | "OrderFilled" | "OrderCancelled"required

  • items[].txstringrequired

  • items[].blockuint stringrequired

  • items[].timeintegerrequired

    Block timestamp (s)

Request
curl "https://api.lane.markets/v1/history?owner=0xYourAddress"

Average-cost PnL, positions, calendar, distribution, equity curve

GET/v1/portfolio/pnl

Query parameters

  • owneraddressrequired

Responses

200PnL

  • summaryobject

  • positionsobject[]

  • calendarobject[]

  • distributionobject[]

  • equityobject[]

  • notesstring[]

Request
curl "https://api.lane.markets/v1/portfolio/pnl?owner=0xYourAddress"

Token transfers (explorer API), swap legs flagged

GET/v1/portfolio/transfers

Query parameters

  • owneraddressrequired

  • limitintegerdefault 50

Responses

200Transfers

  • itemsobject[]

  • sourcestring | null

502Explorer API unavailable

Request
curl "https://api.lane.markets/v1/portfolio/transfers?owner=0xYourAddress"

Order notifications, newest first

GET/v1/notifications

Query parameters

  • owneraddressrequired

  • sinceintegerdefault 0

    Last id seen

  • limitintegerdefault 50

Responses

200Notifications

  • itemsobject[]

  • items[].idinteger

  • items[].tsinteger

  • items[].type"order_created" | "order_filled" | "order_completed" | "order_cancelled" | "order_expired" | "dca_skipped"

  • items[].orderIdstring | null

  • items[].txstring | null

  • items[].dataobject

Request
curl "https://api.lane.markets/v1/notifications?owner=0xYourAddress"

WebSocket: send {"owner": "0x…"}, receive {"notification": {...}}

WS/v1/ws/account

Responses

101Switching protocols

WebSocket
const ws = new WebSocket("wss://api.lane.markets/v1/ws/account");
ws.onopen = () => ws.send(JSON.stringify({ subscribe: ["HYPE", "0x7D29d8047B905000459c0E80c34a26CeedcB47b2"] }));
ws.onmessage = (event) => console.log(JSON.parse(event.data).prices);
lane.markets · Make the most of every move.