bayesline.api.equity.PortfolioHoldingsScenario#

pydantic model bayesline.api.equity.PortfolioHoldingsScenario#

Scenario definition for portfolio holdings overrides.

Organized as a mapping of portfolio_id to its override configuration, where each portfolio has a rebalance frequency and a list of time-windowed override sets.

Show JSON schema
{
   "title": "PortfolioHoldingsScenario",
   "description": "Scenario definition for portfolio holdings overrides.\n\nOrganized as a mapping of portfolio_id to its override configuration,\nwhere each portfolio has a rebalance frequency and a list of\ntime-windowed override sets.",
   "type": "object",
   "properties": {
      "type": {
         "const": "portfolio_holdings",
         "default": "portfolio_holdings",
         "title": "Type",
         "type": "string"
      },
      "portfolios": {
         "additionalProperties": {
            "$ref": "#/$defs/PortfolioOverride"
         },
         "description": "Mapping of portfolio_id to its override configuration.",
         "title": "Portfolios",
         "type": "object"
      }
   },
   "$defs": {
      "HoldingsOverrideWindow": {
         "description": "A time-windowed set of holdings overrides for a single portfolio.",
         "properties": {
            "snapshot_date": {
               "anyOf": [
                  {
                     "format": "date",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If set, replace the portfolio's holdings within this window with the full holdings as of this date. Overrides are then applied on top. If None, only the explicit overrides are applied.",
               "title": "Snapshot Date"
            },
            "start_date": {
               "description": "Override effective start date.",
               "format": "date",
               "title": "Start Date",
               "type": "string"
            },
            "end_date": {
               "description": "Override effective end date.",
               "format": "date",
               "title": "End Date",
               "type": "string"
            },
            "overrides": {
               "additionalProperties": {
                  "type": "number"
               },
               "description": "Mapping of asset_id to target NAV, applied after snapshot replacement.",
               "title": "Overrides",
               "type": "object"
            }
         },
         "required": [
            "start_date",
            "end_date"
         ],
         "title": "HoldingsOverrideWindow",
         "type": "object"
      },
      "PortfolioOverride": {
         "description": "All overrides for a single portfolio within a scenario.",
         "properties": {
            "rebalance_frequency": {
               "$ref": "#/$defs/RebalanceFrequency",
               "default": "never",
               "description": "How often to reapply the overridden holdings within each window."
            },
            "windows": {
               "description": "Time-windowed override sets for this portfolio.",
               "items": {
                  "$ref": "#/$defs/HoldingsOverrideWindow"
               },
               "title": "Windows",
               "type": "array"
            }
         },
         "required": [
            "windows"
         ],
         "title": "PortfolioOverride",
         "type": "object"
      },
      "RebalanceFrequency": {
         "description": "How often to reapply the overridden holdings.",
         "enum": [
            "daily",
            "weekly",
            "monthly",
            "quarterly",
            "semi-annually",
            "annually",
            "never"
         ],
         "title": "RebalanceFrequency",
         "type": "string"
      }
   },
   "required": [
      "portfolios"
   ]
}

Config:
  • frozen: bool = True

Fields:
  • portfolios (dict[str, bayesline.api._src.equity.report.scenarios.PortfolioOverride])

  • type (Literal['portfolio_holdings'])

field type: Literal['portfolio_holdings'] = 'portfolio_holdings'#
field portfolios: dict[str, PortfolioOverride] [Required]#

Mapping of portfolio_id to its override configuration.