Agara

Get settled PnL history

GET
/trade/v1/portfolio/pnl/history

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

from
Required
string

Inclusive RFC 3339 range start.

Format: "date-time"

to
Required
string

Inclusive RFC 3339 range end.

Format: "date-time"

limitinteger

Maximum completed buckets; defaults to 672 and cannot exceed 2880.

Minimum: 0
curl -X GET "https://app.agara.xyz/trade/v1/portfolio/pnl/history?from=2019-08-24T14%3A15%3A22Z&to=2019-08-24T14%3A15%3A22Z&limit=0" \
  -H "Authorization: Bearer <token>"

Completed lifetime-PnL buckets and step-held range boundaries. The change is not action attribution.

{
  "end": {
    "bucket_at": "2019-08-24T14:15:22Z",
    "chain_id": 0,
    "classification_version": 0,
    "collateral_micro": "string",
    "cumulative_inflow_micro": "string",
    "cumulative_outflow_micro": "string",
    "custody_through_block": 0,
    "custody_through_block_hash": "string",
    "custody_through_block_time": "2019-08-24T14:15:22Z",
    "lifetime_pnl_micro": "string",
    "mark_captured_at": "2019-08-24T14:15:22Z",
    "mark_run_id": "0449856b-20b9-47d9-a9ce-f431a68a8886",
    "position_count": 0,
    "positions_value_micro": "string",
    "wallet_universe_generation": 0
  },
  "from": "2019-08-24T14:15:22Z",
  "has_more": true,
  "lifetime_pnl_change_micro": "string",
  "points": [
    {
      "bucket_at": "2019-08-24T14:15:22Z",
      "chain_id": 0,
      "classification_version": 0,
      "collateral_micro": "string",
      "cumulative_inflow_micro": "string",
      "cumulative_outflow_micro": "string",
      "custody_through_block": 0,
      "custody_through_block_hash": "string",
      "custody_through_block_time": "2019-08-24T14:15:22Z",
      "lifetime_pnl_micro": "string",
      "mark_captured_at": "2019-08-24T14:15:22Z",
      "mark_run_id": "0449856b-20b9-47d9-a9ce-f431a68a8886",
      "position_count": 0,
      "positions_value_micro": "string",
      "wallet_universe_generation": 0
    }
  ],
  "start": {
    "bucket_at": "2019-08-24T14:15:22Z",
    "chain_id": 0,
    "classification_version": 0,
    "collateral_micro": "string",
    "cumulative_inflow_micro": "string",
    "cumulative_outflow_micro": "string",
    "custody_through_block": 0,
    "custody_through_block_hash": "string",
    "custody_through_block_time": "2019-08-24T14:15:22Z",
    "lifetime_pnl_micro": "string",
    "mark_captured_at": "2019-08-24T14:15:22Z",
    "mark_run_id": "0449856b-20b9-47d9-a9ce-f431a68a8886",
    "position_count": 0,
    "positions_value_micro": "string",
    "wallet_universe_generation": 0
  },
  "to": "2019-08-24T14:15:22Z"
}