{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://fdc3.finos.org/schemas/2.2/context/portfolio.schema.json",
  "type": "object",
  "title": "Portfolio",
  "description": "A financial portfolio made up of multiple positions (holdings) in several instruments. Contrast this with e.g. the [InstrumentList](InstrumentList) type, which is just a list of instruments.\n\nThis is a good example of how types can be composed and extended with extra properties to define more complex types.\n\nThe Portfolio type consists of an array of [Position](Position) types, each of which refers to a single [Instrument](Instrument) and a holding amount for that instrument.\n\nThe portfolio schema does not explicitly include identifiers in the `id` section, as there bis not a common standard for such identifiers. Applications can, however, populate this part of the contract with custom identifiers if so desired.",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "type": {
          "const": "fdc3.portfolio"
        },
        "positions": {
          "type": "array",
          "items": {
            "$ref": "position.schema.json#"
          },
          "title": "Portfolio positions",
          "description": "The List of Positions which make up the Portfolio"
        },
        "id": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "title": "Portfolio Identifiers",
          "description": "One or more identifiers that refer to the portfolio in an OMS, EMS or related system. Specific key names for systems are expected to be standardized in future."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "An optional human-readable name for the portfolio"
        }
      },
      "required": [
        "positions"
      ]
    },
    { "$ref": "context.schema.json#/definitions/BaseContext" }
  ],
  "examples": [
    {
      "type": "fdc3.portfolio",
      "positions": [
        {
          "type": "fdc3.position",
          "instrument": {
            "type": "fdc3.instrument",
            "id": {
              "ticker": "AAPL"
            }
          },
          "holding": 2000000
        },
        {
          "type": "fdc3.position",
          "instrument": {
            "type": "fdc3.instrument",
            "id": {
              "ticker": "MSFT"
            }
          },
          "holding": 1500000
        },
        {
          "type": "fdc3.position",
          "instrument": {
            "type": "fdc3.instrument",
            "id": {
              "ticker": "IBM"
            }
          },
          "holding": 3000000
        }
      ]
    }
  ]
}