curl --request GET \
--url https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"data": {
"positions": [
{
"symbol": "BTC",
"coin": "BTC",
"size": "-0.5",
"side": "short",
"entry_price": "64210.5",
"mark_price": "65020.1",
"mark_time": "2023-11-07T05:31:56Z",
"position_value": "32510.05",
"unrealized_pnl": "-404.8",
"return_on_equity": "-0.1245",
"leverage": {
"type": "cross",
"value": "20"
},
"max_leverage": 40,
"margin_used": "1625.5",
"liquidation_price": "81250",
"liquidation_price_status": "exact",
"cum_funding": {
"all_time": "-12.345678",
"since_open": "-1.25",
"since_change": "-0.5"
},
"opened_at": "2023-11-07T05:31:56Z",
"snapshot_as_of": "2023-11-07T05:31:56Z",
"quality": "complete",
"snapshot_ts": "2023-11-07T05:31:56Z",
"account_index": "281474976710654",
"account_kind": "user",
"dex": "xyz",
"initial_margin_fraction": "0.05",
"allocated_margin": "1200.5",
"margin_mode": "cross",
"mark_source": "mark",
"finalized": true
}
],
"account": {
"total_position_value": "412000.5",
"total_unrealized_pnl": "2510.25",
"long_value": "300000",
"short_value": "112000.5",
"n_positions": 4,
"quality": "complete",
"snapshot_ts": "2023-11-07T05:31:56Z",
"account_index": "513030",
"dex": "xyz",
"account_value": "125000.5",
"cross_account_value": "118000.25",
"collateral": "100000",
"total_margin_used": "20500.75",
"cross_maintenance_margin_used": "6100.2",
"withdrawable": "<string>",
"account_mode": "standard",
"snapshot_as_of": "2023-11-07T05:31:56Z"
},
"account_seen": "flat"
},
"meta": {
"count": 123,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"next_cursor": "<string>",
"as_of": "2023-11-07T05:31:56Z",
"snapshot_ts": "2023-11-07T05:31:56Z",
"source": "snapshot",
"quality": "<string>",
"stale": true,
"built_through": "2023-11-07T05:31:56Z",
"finalized_through": "2023-11-07T05:31:56Z",
"requested_end": "2023-11-07T05:31:56Z",
"clamped_to": "2023-11-07T05:31:56Z",
"totals": {
"snapshot_ts": "2023-11-07T05:31:56Z",
"symbol": "BTC",
"coin": "BTC",
"long_count": 18234,
"short_count": 15102,
"long_size": "8123.45",
"short_size": "8120.1",
"long_value": "528000000.5",
"short_value": "527800000.25",
"long_avg_entry_price": "63120.4",
"short_avg_entry_price": "66210.9",
"long_positions_with_entry": 18230,
"short_positions_with_entry": 15100,
"long_top10_value_share": "0.412345",
"short_top10_value_share": "0.385",
"top10_value_share": "0.301",
"quality": "complete",
"dex": "xyz"
},
"coverage_from": "2023-11-07T05:31:56Z",
"notice": "<string>"
}
}{
"code": 400,
"error": "Failed to deserialize query string: limit: invalid digit found in string",
"error_code": "invalid_query_params",
"request_id": "3f2a9c71-5b0e-4d68-9a4c-7e1d2b6f8a05"
}{
"code": 401,
"error": "Missing or invalid API key. Provide X-API-Key header."
}{
"code": 404,
"error": "Resource not found"
}{
"code": 429,
"error": "Rate limit exceeded"
}{
"code": 503,
"error": "Account positions are not available right now.",
"error_code": "positions_unavailable"
}Get Lighter on Robinhood Chain account positions
0xArchive API reference for Get Lighter on Robinhood Chain account positions. Includes route metadata, schemas, examples, and implementation notes.
curl --request GET \
--url https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.0xarchive.io/v1/rh-lighter/accounts/{account_index}/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true,
"data": {
"positions": [
{
"symbol": "BTC",
"coin": "BTC",
"size": "-0.5",
"side": "short",
"entry_price": "64210.5",
"mark_price": "65020.1",
"mark_time": "2023-11-07T05:31:56Z",
"position_value": "32510.05",
"unrealized_pnl": "-404.8",
"return_on_equity": "-0.1245",
"leverage": {
"type": "cross",
"value": "20"
},
"max_leverage": 40,
"margin_used": "1625.5",
"liquidation_price": "81250",
"liquidation_price_status": "exact",
"cum_funding": {
"all_time": "-12.345678",
"since_open": "-1.25",
"since_change": "-0.5"
},
"opened_at": "2023-11-07T05:31:56Z",
"snapshot_as_of": "2023-11-07T05:31:56Z",
"quality": "complete",
"snapshot_ts": "2023-11-07T05:31:56Z",
"account_index": "281474976710654",
"account_kind": "user",
"dex": "xyz",
"initial_margin_fraction": "0.05",
"allocated_margin": "1200.5",
"margin_mode": "cross",
"mark_source": "mark",
"finalized": true
}
],
"account": {
"total_position_value": "412000.5",
"total_unrealized_pnl": "2510.25",
"long_value": "300000",
"short_value": "112000.5",
"n_positions": 4,
"quality": "complete",
"snapshot_ts": "2023-11-07T05:31:56Z",
"account_index": "513030",
"dex": "xyz",
"account_value": "125000.5",
"cross_account_value": "118000.25",
"collateral": "100000",
"total_margin_used": "20500.75",
"cross_maintenance_margin_used": "6100.2",
"withdrawable": "<string>",
"account_mode": "standard",
"snapshot_as_of": "2023-11-07T05:31:56Z"
},
"account_seen": "flat"
},
"meta": {
"count": 123,
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"next_cursor": "<string>",
"as_of": "2023-11-07T05:31:56Z",
"snapshot_ts": "2023-11-07T05:31:56Z",
"source": "snapshot",
"quality": "<string>",
"stale": true,
"built_through": "2023-11-07T05:31:56Z",
"finalized_through": "2023-11-07T05:31:56Z",
"requested_end": "2023-11-07T05:31:56Z",
"clamped_to": "2023-11-07T05:31:56Z",
"totals": {
"snapshot_ts": "2023-11-07T05:31:56Z",
"symbol": "BTC",
"coin": "BTC",
"long_count": 18234,
"short_count": 15102,
"long_size": "8123.45",
"short_size": "8120.1",
"long_value": "528000000.5",
"short_value": "527800000.25",
"long_avg_entry_price": "63120.4",
"short_avg_entry_price": "66210.9",
"long_positions_with_entry": 18230,
"short_positions_with_entry": 15100,
"long_top10_value_share": "0.412345",
"short_top10_value_share": "0.385",
"top10_value_share": "0.301",
"quality": "complete",
"dex": "xyz"
},
"coverage_from": "2023-11-07T05:31:56Z",
"notice": "<string>"
}
}{
"code": 400,
"error": "Failed to deserialize query string: limit: invalid digit found in string",
"error_code": "invalid_query_params",
"request_id": "3f2a9c71-5b0e-4d68-9a4c-7e1d2b6f8a05"
}{
"code": 401,
"error": "Missing or invalid API key. Provide X-API-Key header."
}{
"code": 404,
"error": "Resource not found"
}{
"code": 429,
"error": "Rate limit exceeded"
}{
"code": 503,
"error": "Account positions are not available right now.",
"error_code": "positions_unavailable"
}X-API-Key with this request. See REST authentication.Shared request rules
Shared request rules
Machine schema
Machine schema
Authorizations
API key for authentication. Get yours at https://0xarchive.io/dashboard
Path Parameters
Lighter account index (an integer). Resolve an L1 address on Lighter mainnet with GET /v1/lighter/accounts?l1_address=0x...
^[0-9]+$"513030"
Query Parameters
As-of instant in Unix milliseconds: the state after every event before it. An exact hour with a committed snapshot serves that snapshot; any other instant is reconstructed (meta.source: reconstructed) and clamped to meta.built_through. Omit for the latest live snapshot.
Only this perpetual (e.g. BTC). Pass it exactly as the instruments route lists it, in uppercase.
Maximum rows per page (default 500, max 5000).
1 <= x <= 5000Cursor from the previous response meta.next_cursor. Keep every other parameter unchanged.
Response
Get Lighter on Robinhood Chain account positions
Positions of one wallet or account.
true
Positions of one wallet or account at one instant.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Market symbol (HIP-3: dex:COIN).
"BTC"
Alias of symbol.
"BTC"
Signed position size in base units (negative is short).
"-0.5"
Position side.
long, short "short"
Average entry price.
"64210.5"
Mark price used for value and PnL. Null when no mark is available.
"65020.1"
Time of the mark price.
Absolute position value in USD at the mark price.
"32510.05"
Unrealized PnL in USD at the mark price.
"-404.8"
Return on equity as a decimal ratio. Hyperliquid snapshot rows only.
"-0.1245"
Leverage of a position.
Hide child attributes
Hide child attributes
Margin type: cross, isolated, or unknown. On Lighter this is the margin mode of the position.
"cross"
Leverage multiple as a decimal string. Null when unknown (Lighter rows and as-of reconstructions).
"20"
Maximum leverage allowed for the market. Hyperliquid snapshot rows only.
40
Margin allocated to the position in USD. Hyperliquid snapshot rows only.
"1625.5"
Liquidation price as reported for the position. Hyperliquid snapshot rows only.
"81250"
How liquidation_price should be read: exact, not_published_cross, changed_since_snapshot, or unavailable (always unavailable on Lighter and on as-of reconstructions).
"exact"
Cumulative funding in USD (decimal strings). Null when not reported, including every Lighter row and as-of reconstructions.
Hide child attributes
Hide child attributes
Funding paid or received over the account lifetime for this coin.
"-12.345678"
Funding since the current position opened.
"-1.25"
Funding since the last change in position size.
"-0.5"
Start of the current position lifecycle. Null when it opened before coverage.
Time the leverage, margin, and funding fields describe, which can differ from the hour. Hyperliquid snapshot rows only.
Quality of this row. complete, partial (a mark or entry is missing, so value and PnL fields are null), or degraded. Lighter rows can also read preliminary (built from real-time trades not yet reconciled), unreconciled (a market with no reconciled trades), or incomplete. No row reads complete when its own data is not complete, or when its snapshot has a problem that could not be pinned to specific rows. A small number of Hyperliquid positions around three short windows in June and July 2025, where Hyperliquid's published fill data has gaps, read partial.
"complete"
Hour the row describes. Present on hourly history rows only.
Lighter only: account index, serialized as a string because it can exceed JavaScript integers.
"281474976710654"
Lighter only: user, insurance, settlement, or system. Non-user accounts appear in market routes only with include_system=true.
"user"
HIP-3 only: the dex the position belongs to.
"xyz"
Lighter only: initial margin fraction at the last trade, as a decimal ratio.
"0.05"
Lighter only: isolated margin allocated to the position.
"1200.5"
Lighter only: cross, isolated, or unknown.
"cross"
Lighter only: where the mark came from: mark, last_trade, stale_mark, or none.
"mark"
Lighter only: true when every trade behind the row is final (reconciled).
true
Account summary on the first page of a snapshot read. Hyperliquid core: the wallet's summary when the snapshot holds one. HIP-3: when the request is scoped to one dex. Lighter: position aggregates when no symbol filter is set. Null otherwise, on later pages, and on as-of reconstructions.
Hide child attributes
Hide child attributes
Sum of absolute position values in USD.
"412000.5"
Sum of unrealized PnL in USD.
"2510.25"
Value of long positions in USD.
"300000"
Value of short positions in USD.
"112000.5"
Number of open positions.
4
complete, partial (a total is null because a position has no mark), or degraded.
"complete"
Hour the row describes. Present on hourly history rows only.
Lighter only: account index as a string.
"513030"
HIP-3 only: dex the account summary belongs to.
"xyz"
Hyperliquid and HIP-3 only: account value in USD.
"125000.5"
Hyperliquid and HIP-3 only: cross-margin account value in USD.
"118000.25"
Hyperliquid and HIP-3 only: collateral in USD.
"100000"
Hyperliquid and HIP-3 only: total margin used in USD.
"20500.75"
Hyperliquid and HIP-3 only: cross maintenance margin used in USD.
"6100.2"
Hyperliquid and HIP-3 only: withdrawable amount in USD. Null outside the periods where it was captured.
Hyperliquid and HIP-3 only: account abstraction mode, standard, unified, portfolio, dex_abstraction, or unknown.
"standard"
Hyperliquid and HIP-3 only: time the clearinghouse fields describe.
Present only when positions is empty: flat (activity is recorded but no position is open), never_seen (no recorded activity in the covered history, with meta.notice and meta.coverage_from), or outside_coverage (the requested instant is before coverage).
flat, never_seen, outside_coverage Response metadata of the account positions routes. Every instant is RFC 3339 UTC with milliseconds and comes from the data, never the request time.
Hide child attributes
Hide child attributes
Number of records returned.
Unique request ID for support.
Signed cursor for the next page, bound to the request. Pass it back with the same parameters. A market cursor pins its snapshot; if that snapshot is replaced or expires the next page answers 409 snapshot_advanced.
Instant the returned state describes: the snapshot tick or hour, or the requested as-of time.
Committed snapshot the response was read from. Market routes echo the resolved hour here.
How the rows were produced: snapshot (live or hourly snapshot), reconstructed (as-of state between snapshots), or changes (change log).
snapshot, reconstructed, changes Completeness of the snapshot the response was read from: complete, partial, or degraded. Rows carry their own quality. On Lighter and Robinhood Chain, snapshots from the latest day, before the venue's daily trade reconcile, can read degraded while their rows read preliminary; they read complete once the reconcile has run.
True on current reads when the latest snapshot is older than 12 minutes; paired with notice.
Every event before this instant is built into the change log and as-of state. Reads are clamped to it.
Every event before this instant is final and will not be re-derived (Lighter: the trade finalization watermark). Never later than built_through.
The end or timestamp the caller asked for, echoed when the read was clamped.
Boundary the read was clamped to (built_through). Present only when clamped.
Market listings, first page only: aggregates over the whole filtered result set, not just this page.
Hide child attributes
Hide child attributes
Snapshot the aggregates describe.
"BTC"
Alias of symbol.
"BTC"
18234
15102
Total long size in base units.
"8123.45"
Total short size in base units.
"8120.1"
Total long value in USD. Null when any long position has no mark.
"528000000.5"
Total short value in USD. Null when any short position has no mark.
"527800000.25"
Size-weighted average entry of long positions with a known entry.
"63120.4"
Size-weighted average entry of short positions with a known entry.
"66210.9"
18230
15100
Share of long value held by the ten largest long positions.
"0.412345"
Share of short value held by the ten largest short positions.
"0.385"
Share of total value held by the ten largest positions.
"0.301"
complete, partial, or degraded, from this market's own rows.
"complete"
HIP-3 only.
"xyz"
Coverage start, present with notice when the request falls before coverage or the address has no recorded activity.
Human-readable advisory: before coverage, no recorded activity, or a stale snapshot.
Was this page helpful?