curl --request GET \
--url https://api.0xarchive.io/v1/lighter/accounts/{account_index}/positions/changes \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.0xarchive.io/v1/lighter/accounts/{account_index}/positions/changes"
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/lighter/accounts/{account_index}/positions/changes', 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/lighter/accounts/{account_index}/positions/changes"
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": [
{
"timestamp": "2026-09-25T14:03:11.482Z",
"symbol": "BTC",
"coin": "BTC",
"side": "B",
"price": "65010.2",
"size": "0.25",
"start_position": "-0.5",
"end_position": "-0.25",
"entry_price_after": "64210.5",
"event_type": "reduce",
"cause": "trade",
"fee": "0.4875",
"fee_token": "USDC",
"trade_id": 26121110211,
"order_id": 844421856609148,
"opened_at": "2023-11-07T05:31:56Z",
"continuity": "ok",
"finalized": true,
"account_index": "513030",
"account_kind": "user",
"dex": "xyz",
"direction": "Close Short",
"closed_pnl": "19.9",
"realized_pnl": "19.9",
"crossed": true,
"is_maker": false,
"seq": 0,
"block_number": 745512345,
"event_index": 12,
"position_size_before": "-0.5",
"position_size_after": "-0.25",
"fee_rate": "0.00002",
"fee_usdc": "0.325",
"usdc_amount": "16252.55"
}
],
"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 account position changes
0xArchive API reference for Get Lighter account position changes. Includes route metadata, schemas, examples, and implementation notes.
curl --request GET \
--url https://api.0xarchive.io/v1/lighter/accounts/{account_index}/positions/changes \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.0xarchive.io/v1/lighter/accounts/{account_index}/positions/changes"
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/lighter/accounts/{account_index}/positions/changes', 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/lighter/accounts/{account_index}/positions/changes"
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": [
{
"timestamp": "2026-09-25T14:03:11.482Z",
"symbol": "BTC",
"coin": "BTC",
"side": "B",
"price": "65010.2",
"size": "0.25",
"start_position": "-0.5",
"end_position": "-0.25",
"entry_price_after": "64210.5",
"event_type": "reduce",
"cause": "trade",
"fee": "0.4875",
"fee_token": "USDC",
"trade_id": 26121110211,
"order_id": 844421856609148,
"opened_at": "2023-11-07T05:31:56Z",
"continuity": "ok",
"finalized": true,
"account_index": "513030",
"account_kind": "user",
"dex": "xyz",
"direction": "Close Short",
"closed_pnl": "19.9",
"realized_pnl": "19.9",
"crossed": true,
"is_maker": false,
"seq": 0,
"block_number": 745512345,
"event_index": 12,
"position_size_before": "-0.5",
"position_size_after": "-0.25",
"fee_rate": "0.00002",
"fee_usdc": "0.325",
"usdc_amount": "16252.55"
}
],
"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
Inclusive start in Unix milliseconds. Defaults to 24 hours before end.
Exclusive end in Unix milliseconds. Defaults to now.
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 account position changes
Position change log legs in timestamp order.
true
Hide child attributes
Hide child attributes
Execution time (UTC).
"2026-09-25T14:03:11.482Z"
Market symbol (HIP-3: dex:COIN).
"BTC"
Alias of symbol.
"BTC"
Side of this account in the trade, exactly as on the trades routes: B (buy) or A (sell).
B, A "B"
Execution price.
"65010.2"
Traded size in base units.
"0.25"
Signed position size before the leg.
"-0.5"
Signed position size after the leg.
"-0.25"
Average entry price after the leg. Null when the position is flat after it.
"64210.5"
Effect on the position: open, increase, reduce, close, or flip. Lighter also reports settlement (the settlement counterparty side of a market settlement) and unchanged.
"reduce"
Why the leg happened: trade, liquidation, liquidation_counterparty, adl, settlement, or unknown.
"trade"
Fee paid for the leg (negative is a rebate).
"0.4875"
Asset the fee is paid in: USDC on Hyperliquid and Lighter mainnet, USDG on Lighter on Robinhood Chain.
"USDC"
Trade ID, shared by both legs of a trade.
26121110211
Order ID of this account.
844421856609148
Start of the position lifecycle this leg belongs to. Null when it opened before coverage.
ok when start_position continues the previous leg exactly, inferred when it was bridged, first_seen for the first leg recorded for the account and market, quarantined when the chain is broken and the leg is held out of position state.
ok, inferred, first_seen, quarantined "ok"
True when the leg is final and will not be re-derived.
true
Lighter only: account index as a string.
"513030"
Lighter only: user, insurance, settlement, or system.
"user"
HIP-3 only: dex of the market.
"xyz"
Hyperliquid and HIP-3 only: direction label as reported by Hyperliquid (for example Close Short).
"Close Short"
Hyperliquid and HIP-3 only: realized PnL of the leg in USD.
"19.9"
Lighter only: realized PnL of the leg in the quote asset (0 on open and increase).
"19.9"
Hyperliquid and HIP-3 only: true when this account was the taker.
true
Lighter only: true when this account was the maker.
false
Hyperliquid and HIP-3 only: order of legs that share a timestamp.
0
Hyperliquid and HIP-3 only, present when known (from September 17, 2026): block that executed the leg.
745512345
Hyperliquid and HIP-3 only, present with block_number: execution order within the block.
12
Lighter only: alias of start_position.
"-0.5"
Lighter only: alias of end_position.
"-0.25"
Lighter only: fee rate as a decimal ratio.
"0.00002"
Lighter only: fee in the quote asset, computed from the notional and the fee rate.
"0.325"
Lighter only: notional of the leg in the quote asset.
"16252.55"
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?