Get account value snapshots
curl --request GET \
--url https://api.mainnet.kuru.io/api/v1/users/{userId}/account-value-snapshotsconst options = {method: 'GET'};
fetch('https://api.mainnet.kuru.io/api/v1/users/{userId}/account-value-snapshots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mainnet.kuru.io/api/v1/users/{userId}/account-value-snapshots"
response = requests.get(url)
print(response.text){
"feedEpoch": "0",
"data": {
"totalAccountValueX18": "2500000000000000000000",
"performance": [
["2500000000000000000000", "-5000000000000000000", 1791763200]
],
"relativePnlX18": "-5000000000000000000",
"relativeVolumeX18": "100000000000000000000"
}
}
Data Source REST methods
Get account value and PnL snapshots
Read hourly history and latest indexed account value and PnL in USDC.
GET
/
api
/
v1
/
users
/
{userId}
/
account-value-snapshots
Get account value snapshots
curl --request GET \
--url https://api.mainnet.kuru.io/api/v1/users/{userId}/account-value-snapshotsconst options = {method: 'GET'};
fetch('https://api.mainnet.kuru.io/api/v1/users/{userId}/account-value-snapshots', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mainnet.kuru.io/api/v1/users/{userId}/account-value-snapshots"
response = requests.get(url)
print(response.text){
"feedEpoch": "0",
"data": {
"totalAccountValueX18": "2500000000000000000000",
"performance": [
["2500000000000000000000", "-5000000000000000000", 1791763200]
],
"relativePnlX18": "-5000000000000000000",
"relativeVolumeX18": "100000000000000000000"
}
}
Returns stored hourly snapshots and a live indexed point for the specified account, without combining
its subaccounts. Account value and PnL share this endpoint; there is no separate
PnL snapshot endpoint. No request body is accepted.
All monetary values are exact decimal strings in USDC × 10¹⁸:
Historical hours are stored snapshots; missing hours are not fabricated. Unknown
valuations or unavailable snapshot values are
Unknown users return HTTP 200 with empty history, not 404. Invalid IDs,
unsupported timeframes, and unknown query parameters return 400. Unsupported
methods, including POST, return 405.
string
required
Unsigned 64-bit Kuru account ID as a decimal string.
string
default:"7d"
One of
1d, 7d, or 30d. History starts one timeframe before the current
UTC hour (exclusive). A live point extends the response through the latest
indexed balance/trade source time or last stored hourly boundary, whichever
is later (inclusive). This does not prove ingestion is caught up to the chain."1000000000000000000" represents 1 USDC. PnL can be negative. Timestamps
are Unix seconds, not milliseconds.
string | null
required
Materialization feed epoch, or
null before initialization. "0" is valid.
This is not a snapshot timestamp or a WebSocket replay sequence.string | null
required
Latest indexed account value, including free and reserved token balances,
valued at latest indexed prices. Does not include passive LP positions.
array
required
Tuples
[accountValueX18, pnlX18, timestamp], oldest first. At most
24, 168, or 720 hourly points plus one live point. The final point need not
be hour-aligned; duplicate timestamps are not returned.string | null
required
Latest cumulative total PnL minus start-hour cumulative total PnL. An amount,
not a percentage. Null when a required boundary value is unavailable.
string | null
required
The user’s maker/taker trade notional over the selected window, converted to
USDC at each trade’s historical quote-token price. Excludes transfers.
Performance tuple
| Position | Field | Type | Meaning |
|---|---|---|---|
| 0 | accountValueX18 | string or null | Total token-balance value in USDC at the tuple timestamp. |
| 1 | pnlX18 | string or null | Cumulative realized plus unrealized PnL across markets, not just that hour’s PnL. |
| 2 | timestamp | integer | Unix seconds. The live point uses indexed source time or the last stored hourly boundary, whichever is later—not request time. |
null, not zero. A nonzero
holding without a supported valuation market makes the account total unknown.
For a configured valuation market with no trade yet, the valuation uses zero.
The single live point reads current free and reserved balances directly from
user_token_balances and current inventory, cost basis and realized PnL from
user_market_positions, valued using latest indexed trade prices. It does not
reconstruct live state from append-only events or hourly snapshots. History,
current state, prices and feed epoch are read in one consistent database snapshot.
With no snapshots but indexed account state, the live point is still returned.
Accounts without history or state return performance: [] and null account/PnL
summaries. Volume includes trades through the indexed source cutoff and is "0"
when none exist. Historical values are never repriced using current prices.
Illustrative response:
{
"feedEpoch": "0",
"data": {
"totalAccountValueX18": "2500000000000000000000",
"performance": [
["2500000000000000000000", "-5000000000000000000", 1791763200]
],
"relativePnlX18": "-5000000000000000000",
"relativeVolumeX18": "100000000000000000000"
}
}