Wallet performance series — PNL and ROI

GET
/chains/{chain}/wallets/{address}/chart

One series carrying both metrics, so a chart switches between PNL and ROI without another round trip. Buckets are hourly for windows of a week or less and daily above that.

A bucket's roi is its realised profit over the cost basis it closed. cumulative_roi is running realised profit over running cost basis — not a sum of the per-bucket ratios, which would be a different and meaningless number.

Path Parameters

chain*string

chain slug (ton) or numeric chain id (950000)

Length1 <= length <= 32
address*string

the wallet address

Length1 <= length <= 128

Query Parameters

window?string

rolling window the metrics are computed over

Default"30d"

Value in

  • "1d"
  • "7d"
  • "30d"
  • "1y"
  • "all"

Header Parameters

Accept-Payment?string

payment methods the client can use, comma-separated, case-insensitive. With x402 in the list, a spent keyless budget answers 402 with the x402 challenge instead of 429.

PAYMENT-SIGNATURE?string

base64 x402 v2 payment payload for this request. A paid request skips the keyless budget and is settled only when it answers 2xx. The v1 header X-PAYMENT is accepted too.

Response Body

application/json

application/problem+json

application/problem+json

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/chains/string/wallets/string/chart"
{  "points": [    {      "timestamp": "string",      "realized_usd": 0.1,      "cumulative_usd": 0.1,      "cost_usd": 0.1,      "roi": 0.1,      "cumulative_roi": 0.1,      "wins": 0,      "losses": 0    }  ]}