GET /account
Get account summary including balances, margin, and fee tier.Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string | Yes | Provider identifier |
address | query | string | Yes | User’s wallet address |
x-lifi-api-key | header | string | Yes | API key |
x-lifi-integrator | header | string | No | Integrator identifier |
Response 200
Positions and orders are fetched via separate endpoints: GET /positions and GET /orders.
getAccount()
GET /positions
Get the user’s open positions. Results are paginated.Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string | Yes | Provider identifier |
address | query | string | Yes | User’s wallet address |
symbol | query | string | No | Filter by asset identifier |
limit | query | integer | No | Items per page (default 50, max 100) |
cursor | query | string | No | Pagination cursor from previous response |
x-lifi-api-key | header | string | Yes | API key |
x-lifi-integrator | header | string | No | Integrator identifier |
Response 200
Position fields
| Field | Type | Description |
|---|---|---|
asset | AssetDisplay | Asset identity (see below) |
side | 'LONG' | 'SHORT' | Position direction |
size | string | Position size |
entryPrice | string | Average entry price |
markPrice | string | Current mark price |
liquidationPrice | string | Estimated liquidation price |
unrealizedPnl | string | Unrealized profit/loss |
leverage | number | Current leverage |
marginUsed | string | Margin allocated |
marginMode | 'ISOLATED' | 'CROSS' | Margin mode |
AssetDisplay
TheAssetDisplay object is used across positions, orders, fills, and activity to identify assets:
| Field | Type | Description |
|---|---|---|
assetId | string | Provider’s canonical identity (e.g., "BTC", "xyz:PURR", "@142") |
market | string | Market category (e.g., "hyperliquid", "xyz", "spot") |
displaySymbol | string | UI-friendly symbol (e.g., "BTC", "PURR") |
displayQuote | string | null | Quote asset (e.g., "USDC") |
getPositions()
GET /orders
Get the user’s open orders and trigger orders. Results are paginated.Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string | Yes | Provider identifier |
address | query | string | Yes | User’s wallet address |
symbol | query | string | No | Filter by asset identifier |
limit | query | integer | No | Items per page (default 50, max 100) |
cursor | query | string | No | Pagination cursor from previous response |
x-lifi-api-key | header | string | Yes | API key |
x-lifi-integrator | header | string | No | Integrator identifier |
Response 200
OpenOrder fields
| Field | Type | Description |
|---|---|---|
id | string | Order ID |
asset | AssetDisplay | Asset identity |
side | 'BUY' | 'SELL' | Order direction |
type | OrderType | Order type: MARKET, LIMIT, STOP_MARKET, STOP_LIMIT, TAKE_PROFIT_MARKET, TAKE_PROFIT_LIMIT, TRIGGER_ONLY |
size | string | Order size |
price | string | Limit price |
filledSize | string | Amount filled |
reduceOnly | boolean | Whether reduce-only |
label | string? | Optional order label |
createdAt | string | ISO 8601 timestamp |
TriggerOrder fields
| Field | Type | Description |
|---|---|---|
id | string | Order ID |
asset | AssetDisplay | Asset identity |
type | OrderType | Trigger order type (e.g., TAKE_PROFIT_MARKET, STOP_LIMIT) |
size | string | Order size |
triggerPrice | string | Price at which the order activates |
limitPrice | string? | Execution limit price (market order if omitted) |
label | string? | Optional order label |
createdAt | string | ISO 8601 timestamp |
getOrders()
GET /fills
Get paginated order fills. Results are sorted by creation time, newest first.Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string | Yes | Provider identifier |
address | query | string | Yes | User’s wallet address |
startTime | query | integer | No | Filter: orders after this timestamp (ms) |
endTime | query | integer | No | Filter: orders before this timestamp (ms) |
cursor | query | string | No | Pagination cursor from previous response |
limit | query | integer | No | Items per page (default 50, max 100) |
x-lifi-api-key | header | string | Yes | API key |
x-lifi-integrator | header | string | No | Integrator identifier |
Response 200
The filledSize, fee, and realizedPnl fields are optional — they may be absent on cancelled or rejected orders, and realizedPnl is null when the order did not close a position.
Fill fields
| Field | Type | Description |
|---|---|---|
id | string | Fill ID |
asset | AssetDisplay | Asset identity |
side | 'BUY' | 'SELL' | Order direction |
type | OrderType | Order type |
size | string | Original order size |
price | string | Fill price |
status | FillStatus | FILLED, PARTIALLY_FILLED, CANCELLED, REJECTED |
filledSize | string? | Amount filled (absent if no fills yet) |
fee | string? | Total fees paid (absent if no fills yet) |
realizedPnl | string | null? | Realized PnL (present only when closing a position, null otherwise) |
startPosition | string? | Position size before this fill |
classification | FillClassification | How this fill affected the position (see below) |
createdAt | string | ISO 8601 timestamp |
FillClassification
Describes how the fill affected the user’s position:| Value | Description |
|---|---|
OPENED_LONG | Opened a new long position from zero |
OPENED_SHORT | Opened a new short position from zero |
INCREASED_LONG | Added to an existing long position |
INCREASED_SHORT | Added to an existing short position |
REDUCED_LONG | Partially closed a long position |
REDUCED_SHORT | Partially closed a short position |
CLOSED_LONG | Fully closed a long position |
CLOSED_SHORT | Fully closed a short position |
SWITCHED_LONG | Closed a short and opened a long (crossed zero) |
SWITCHED_SHORT | Closed a long and opened a short (crossed zero) |
SPOT_BUY | Spot market buy |
SPOT_SELL | Spot market sell |
Pagination
Use thecursor from the response to fetch the next page:
hasMore is false, there are no more pages.
SDK: getFills()
GET /activity
Get paginated account activity: deposits, withdrawals, liquidations, and funding payments.Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
provider | query | string | Yes | Provider identifier |
address | query | string | Yes | User’s wallet address |
startTime | query | integer | No | Filter: activity after this timestamp (ms) |
endTime | query | integer | No | Filter: activity before this timestamp (ms) |
cursor | query | string | No | Pagination cursor from previous response |
limit | query | integer | No | Items per page (default 50, max 200) |
type | query | string[] | No | Filter by activity type(s): DEPOSIT, WITHDRAWAL, FUNDING, LIQUIDATION |
x-lifi-api-key | header | string | Yes | API key |
x-lifi-integrator | header | string | No | Integrator identifier |
Response 200
The response contains a discriminated union of activity items — the type field determines which fields are present.
Activity Types
All activity items share these base fields:| Field | Type | Description |
|---|---|---|
id | string | Activity ID |
provider | string | Provider identifier |
type | string | Activity type (discriminator) |
timestamp | string | ISO 8601 timestamp |
| Field | Type | Description |
|---|---|---|
amount | string | Deposit amount |
| Field | Type | Description |
|---|---|---|
amount | string | Withdrawal amount |
fee | string | Withdrawal fee |
| Field | Type | Description |
|---|---|---|
asset | AssetDisplay | Asset identity |
amount | string | Funding amount (negative = paid) |
positionSize | string | Position size at time of funding |
fundingRate | string | Funding rate applied |
| Field | Type | Description |
|---|---|---|
liquidatedNotionalPosition | string | Total notional value liquidated |
accountValue | string | Account value at time of liquidation |
leverageType | string | Leverage type (e.g., "Cross") |
liquidatedPositions | LiquidatedPosition[] | Positions that were liquidated |
LiquidatedPosition:
| Field | Type | Description |
|---|---|---|
asset | AssetDisplay | Asset identity |
size | string | Position size liquidated |
Pagination
Use thecursor from the response to fetch the next page:
hasMore is false, there are no more pages.
SDK: getActivity()