{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pigi-finance/json-schema/pigi-finance-period-stats-schema.json",
  "title": "PeriodStats",
  "description": "Aggregated risk/return stats for a single time window.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pigi-finance-openapi.yml#/components/schemas/PeriodStats",
  "type": "object",
  "properties": {
    "tvl_low": {
      "type": [
        "number",
        "null"
      ]
    },
    "tvl_high": {
      "type": [
        "number",
        "null"
      ]
    },
    "apr": {
      "type": [
        "number",
        "null"
      ]
    },
    "apy": {
      "type": [
        "number",
        "null"
      ]
    },
    "inflows": {
      "type": [
        "number",
        "null"
      ],
      "description": "Net TVL change over the window (last day − first day): positive = net inflow, negative = net outflow. TVL-based, so it also reflects yield earned over the window, not just deposits/withdrawals."
    },
    "period_start": {
      "type": [
        "string",
        "null"
      ]
    },
    "period_end": {
      "type": [
        "string",
        "null"
      ]
    },
    "cagr": {
      "type": [
        "number",
        "null"
      ],
      "description": "Compound annual growth rate (%) over the window."
    },
    "volatility": {
      "type": [
        "number",
        "null"
      ],
      "description": "Return volatility over the window."
    },
    "sharpe": {
      "type": [
        "number",
        "null"
      ],
      "description": "Sharpe ratio over the window."
    },
    "sortino": {
      "type": [
        "number",
        "null"
      ],
      "description": "Sortino ratio over the window."
    }
  }
}