Agara

Get exact realised PnL

GET
/trade/v1/portfolio/pnl/realized

Authorization

Authorization
Required
Bearer <token>

Personal access token issued from the web app's Settings → API tokens page. Send as Authorization: Bearer agt_….

In: header

Scope: portfolio:read

Query Parameters

granularity
Required
string

Required UTC bucket resolution. Use hour or day with fixed windows, and week with all.

Value in: "hour" | "day" | "week"

window
Required
string

Required UTC calendar window. Use 1d, 7d, or 30d with hour/day buckets, and all with week buckets.

Value in: "1d" | "7d" | "30d" | "all"
curl -X GET "https://app.agara.xyz/trade/v1/portfolio/pnl/realized?granularity=hour&window=1d" \
  -H "Authorization: Bearer <token>"

Timestamped UTC buckets for the requested calendar window, plus exact seven-day, thirty-day, and all-time totals since reporting started.

{
  "amountScale": 0,
  "asOf": "2019-08-24T14:15:22Z",
  "buckets": [
    {
      "directMerges": "string",
      "redemptions": "string",
      "sales": "string",
      "timestamp": "2019-08-24T14:15:22Z",
      "total": "string"
    }
  ],
  "coverageStartedAt": "2019-08-24T14:15:22Z",
  "currency": "string",
  "currentBucketPartial": true,
  "granularity": "hour",
  "reportingStartedAt": "2019-08-24T14:15:22Z",
  "throughEvent": {
    "eventSeq": "string",
    "shardId": 0
  },
  "timezone": "string",
  "totals": {
    "allTime": {
      "directMerges": "string",
      "redemptions": "string",
      "sales": "string",
      "total": "string"
    },
    "last30Days": {
      "directMerges": "string",
      "redemptions": "string",
      "sales": "string",
      "total": "string"
    },
    "last7Days": {
      "directMerges": "string",
      "redemptions": "string",
      "sales": "string",
      "total": "string"
    }
  },
  "window": "1d"
}