{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://api-evangelist.github.io/refinitiv-eikon/json-schema/refinitiv-eikon-instrument-schema.json",
  "title": "Refinitiv Eikon Financial Instrument",
  "description": "Schema representing a financial instrument in the Refinitiv Eikon ecosystem, including pricing, identifiers, and metadata.",
  "type": "object",
  "properties": {
    "instrumentId": {
      "type": "string",
      "description": "Primary instrument identifier."
    },
    "ric": {
      "type": "string",
      "description": "Reuters Instrument Code (RIC) — primary identifier in the Refinitiv ecosystem.",
      "examples": ["AAPL.O", "IBM.N", "MSFT.OQ"]
    },
    "isin": {
      "type": "string",
      "description": "International Securities Identification Number.",
      "pattern": "^[A-Z]{2}[A-Z0-9]{9}[0-9]$"
    },
    "cusip": {
      "type": "string",
      "description": "Committee on Uniform Securities Identification Procedures number.",
      "pattern": "^[0-9A-Z]{9}$"
    },
    "sedol": {
      "type": "string",
      "description": "Stock Exchange Daily Official List identifier."
    },
    "permId": {
      "type": "string",
      "description": "Permanent Identifier (PermID) — globally unique, persistent LSEG identifier."
    },
    "displayName": {
      "type": "string",
      "description": "Human-readable display name for the instrument."
    },
    "assetClass": {
      "type": "string",
      "description": "Asset class of the instrument.",
      "enum": ["Equity", "Bond", "Fund", "Futures", "Options", "FX", "Commodity", "Index"]
    },
    "exchange": {
      "type": "string",
      "description": "Exchange code where the instrument is traded."
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$"
    },
    "pricing": {
      "type": "object",
      "description": "Current pricing data.",
      "properties": {
        "last": {
          "type": "number",
          "description": "Last trade price."
        },
        "open": {
          "type": "number",
          "description": "Opening price."
        },
        "high": {
          "type": "number",
          "description": "Day high price."
        },
        "low": {
          "type": "number",
          "description": "Day low price."
        },
        "bid": {
          "type": "number",
          "description": "Best bid price."
        },
        "ask": {
          "type": "number",
          "description": "Best ask price."
        },
        "volume": {
          "type": "integer",
          "description": "Trading volume."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of the pricing data."
        }
      }
    }
  },
  "required": ["ric"]
}
