Skip to main content

Endpoint

POST /info

Request Body

ParameterTypeDescription
type*stringMust be "portfolio"
user*stringUser’s wallet address (case-insensitive), e.g., "0x1234567890abcdef..."
periodstringTime period for history: "perpWeek" (last 7 days, default) or "perpMonth" (last 30 days)

Response

{
  "accountValueHistory": [
    [1702512000000, "10000.00"],
    [1702515600000, "10250.50"],
    [1702519200000, "10100.25"]
  ],
  "pnlHistory": [
    [1702512000000, "0.00"],
    [1702515600000, "250.50"],
    [1702519200000, "100.25"]
  ],
  "vlm": "0",
  "warnings": [
    {
      "asset": "BTC",
      "assetId": "0x00",
      "timestamp": 1702515600000,
      "type": "perp",
      "reason": "No price data available for timestamp"
    }
  ]
}

Response Fields

FieldTypeDescription
accountValueHistoryarrayArray of [timestamp, value] tuples showing account value over time
pnlHistoryarrayArray of [timestamp, pnl] tuples showing profit/loss over time
vlmstringVolume (currently always “0”, reserved for future use)
warningsarrayWarnings about missing price data during calculation
| accountValueHistory[].timestamp | number | Unix timestamp in milliseconds | | accountValueHistory[].value | string | Account value in USDC | | pnlHistory[].timestamp | number | Unix timestamp in milliseconds | | pnlHistory[].pnl | string | Cumulative profit/loss in USDC | | warnings[].asset | string | Asset symbol | | warnings[].timestamp | number | Timestamp when price data was missing | | warnings[].type | string | Asset type: "spot" or "perp" | | warnings[].reason | string | Explanation of the warning |

Example Request

curl -X POST https://api.notional.xyz/info \
  -H "Content-Type: application/json" \
  -d '{
    "type": "portfolio",
    "user": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    "period": "perpWeek"
  }'

Error Responses

{
  "error": "Missing 'user' parameter for portfolio"
}
HTTP Status: 400 Bad Request

Notes

  • History is calculated from ledger events and historical prices
  • Warnings indicate timestamps where price data was unavailable
  • Empty arrays are returned if oracle cache is unavailable