{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coinrithm-com/json-schema/coinrithm-com-public-tradfi-reference-detail-schema.json",
  "title": "PublicTradfiReferenceDetail",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coinrithm-com-public-market-data-api-openapi.yml#/components/schemas/PublicTradfiReferenceDetail",
  "type": "object",
  "required": [
    "version",
    "generatedAt",
    "methodology",
    "instrument",
    "availability",
    "freshness",
    "latest",
    "change24h",
    "change7d",
    "range24h",
    "live",
    "history",
    "historyWindow"
  ],
  "properties": {
    "version": {
      "type": "integer"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "methodology": {
      "$ref": "#/$defs/PublicTradfiReferenceMethodology"
    },
    "instrument": {
      "$ref": "#/$defs/PublicTradfiReferenceInstrument"
    },
    "availability": {
      "type": "string",
      "description": "`available` or `unavailable`."
    },
    "freshness": {
      "$ref": "#/$defs/PublicTradfiReferenceFreshness"
    },
    "latest": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceSnapshot"
        },
        {
          "type": "null"
        }
      ]
    },
    "change24h": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceChange"
        },
        {
          "type": "null"
        }
      ]
    },
    "change7d": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceChange"
        },
        {
          "type": "null"
        }
      ]
    },
    "range24h": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceRange"
        },
        {
          "type": "null"
        }
      ]
    },
    "live": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceLive"
        },
        {
          "type": "null"
        }
      ]
    },
    "history": {
      "type": "array",
      "description": "Recorded 15-minute snapshots in the window, oldest first.",
      "items": {
        "$ref": "#/$defs/PublicTradfiReferenceSnapshot"
      }
    },
    "historyWindow": {
      "$ref": "#/$defs/PublicTradfiReferenceHistoryWindow"
    },
    "fundamentals": {
      "description": "Additive (2026-10-14). SEC EDGAR company data for US-listed stocks.\nNull for ETFs, metals, FX, home listings and issuers without SEC\ndata. Refreshed weekly per issuer.\n",
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceFundamentals"
        },
        {
          "type": "null"
        }
      ]
    },
    "week52": {
      "description": "Additive (2026-10-14). High and low over the last 365 UTC days of\nCoinRithm's own daily reference OHLC (rolled up from the 15-minute\nconsensus; history starts 2026-10-08). Null under 5 days of data.\n",
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceWeek52"
        },
        {
          "type": "null"
        }
      ]
    },
    "corporateEvents": {
      "description": "Additive (2026-10-14). Earnings and dividend dates from SEC EDGAR\n8-K filings for US-listed stocks. Null for ETFs, metals, FX, home\nlistings, issuers without SEC data, or when no event was found.\nRead nightly.\n",
      "anyOf": [
        {
          "$ref": "#/$defs/PublicTradfiReferenceCorporateEvents"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "PublicDataStatus": {
      "type": "string",
      "enum": [
        "fresh",
        "stale",
        "unavailable"
      ],
      "description": "Freshness of an upstream dataset CoinRithm re-reads on a schedule.\n`stale` data is still served inside its documented maximum age;\n`unavailable` means no usable copy, never zero or empty truth.\n"
    },
    "PublicTradfiReferenceChange": {
      "type": "object",
      "description": "Change against a validated recorded snapshot at the comparison time (within 30 minutes); never interpolated.",
      "required": [
        "pct",
        "referencePrice",
        "referenceBucketStart"
      ],
      "properties": {
        "pct": {
          "type": "number"
        },
        "referencePrice": {
          "type": "number"
        },
        "referenceBucketStart": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "PublicTradfiReferenceCorporateEvents": {
      "type": "object",
      "required": [
        "lastEarnings",
        "nextEarningsEstimate",
        "dividends",
        "upcomingDividend",
        "source"
      ],
      "properties": {
        "lastEarnings": {
          "description": "Latest Item 2.02 earnings release 8-K, or null.",
          "anyOf": [
            {
              "type": "object",
              "required": [
                "date",
                "timing",
                "url"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date",
                  "description": "US Eastern date of EDGAR acceptance."
                },
                "timing": {
                  "description": "Acceptance time against the 09:30-16:00 ET session; null when unknown.",
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "before_open",
                        "after_close",
                        "during_market"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "url": {
                  "type": "string",
                  "description": "The SEC filing."
                }
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "nextEarningsEstimate": {
          "description": "An ESTIMATE, never an announced date: the last release plus the\nmedian gap, only with at least 3 consecutive releases 80-100 days\napart and while the date is not past. Otherwise null.\n",
          "anyOf": [
            {
              "type": "object",
              "required": [
                "date",
                "basis",
                "fromReleases"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "basis": {
                  "type": "string",
                  "enum": [
                    "quarterly_cadence"
                  ]
                },
                "fromReleases": {
                  "type": "integer",
                  "description": "Releases the cadence was measured from."
                }
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "dividends": {
          "type": "array",
          "maxItems": 4,
          "description": "Up to 4 dividend declarations found in 8-K text, newest first.\nIssuers that announce dividends only by press release (e.g. KO,\nMSFT, JPM) have an empty list.\n",
          "items": {
            "$ref": "#/$defs/PublicTradfiReferenceDividendEvent"
          }
        },
        "upcomingDividend": {
          "description": "The newest declaration whose `payableDate` is today or later, else null.",
          "anyOf": [
            {
              "$ref": "#/$defs/PublicTradfiReferenceDividendEvent"
            },
            {
              "type": "null"
            }
          ]
        },
        "source": {
          "type": "object",
          "required": [
            "name",
            "url"
          ],
          "properties": {
            "name": {
              "type": "string",
              "enum": [
                "SEC EDGAR"
              ]
            },
            "url": {
              "type": "string",
              "description": "The issuer's 8-K filing list."
            }
          }
        }
      }
    },
    "PublicTradfiReferenceDividendEvent": {
      "type": "object",
      "required": [
        "declaredDate",
        "dividendPerShare",
        "recordDate",
        "exDate",
        "exDateDerived",
        "payableDate",
        "url"
      ],
      "properties": {
        "declaredDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "Announcement date stated in the filing, else the SEC filing date."
        },
        "dividendPerShare": {
          "type": "number",
          "description": "USD per common share."
        },
        "recordDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "exDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "exDateDerived": {
          "type": "boolean",
          "description": "true when `exDate` is the record date under T+1 settlement (not stated by the company)."
        },
        "payableDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "url": {
          "type": "string",
          "description": "The SEC document the dates were read from."
        }
      }
    },
    "PublicTradfiReferenceFreshness": {
      "type": "object",
      "required": [
        "status",
        "basis",
        "asOf",
        "ageSeconds",
        "staleAt"
      ],
      "properties": {
        "status": {
          "$ref": "#/$defs/PublicDataStatus"
        },
        "basis": {
          "type": "string",
          "description": "`collection`: CoinRithm's batch collection time, not a venue quote time."
        },
        "asOf": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "ageSeconds": {
          "type": [
            "integer",
            "null"
          ]
        },
        "staleAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "PublicTradfiReferenceFundamentals": {
      "type": "object",
      "description": "Company-reported SEC XBRL data. Each value is null when SEC data\ncannot give it without guessing. Market cap, dividend yield and P/E\nuse the CoinRithm reference price (USDT perp index median, treated as\nUSD), not an exchange quote.\n",
      "required": [
        "marketCapUsd",
        "marketCapBasis",
        "referencePrice",
        "sharesOutstanding",
        "sharesAsOf",
        "sharesSource",
        "dividendPerShareTtm",
        "dividendTtmBasis",
        "dividendTtmPeriodEnd",
        "dividendYieldPct",
        "lastDividendPerShare",
        "lastDividendPeriodEnd",
        "revenueTtmUsd",
        "netIncomeTtmUsd",
        "epsDilutedTtm",
        "peRatio",
        "ttmBasis",
        "ttmPeriodEnd",
        "sector",
        "fiscalYearEnd",
        "latestFiling",
        "fetchedAt",
        "source"
      ],
      "properties": {
        "marketCapUsd": {
          "type": [
            "number",
            "null"
          ],
          "description": "sharesOutstanding x referencePrice."
        },
        "marketCapBasis": {
          "type": "string",
          "enum": [
            "shares x reference price"
          ]
        },
        "referencePrice": {
          "type": [
            "number",
            "null"
          ],
          "description": "The live consensus when present, else the latest stored consensus."
        },
        "sharesOutstanding": {
          "type": [
            "number",
            "null"
          ]
        },
        "sharesAsOf": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "sharesSource": {
          "description": "`dei_cover`: filing cover page; `balance_sheet`: all classes at quarter end.",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "dei_cover",
                "balance_sheet"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "dividendPerShareTtm": {
          "type": [
            "number",
            "null"
          ],
          "description": "Dividends declared per share over the trailing twelve months, USD."
        },
        "dividendTtmBasis": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicTradfiReferenceTtmBasis"
            },
            {
              "type": "null"
            }
          ]
        },
        "dividendTtmPeriodEnd": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "dividendYieldPct": {
          "type": [
            "number",
            "null"
          ],
          "description": "dividendPerShareTtm / referencePrice x 100."
        },
        "lastDividendPerShare": {
          "type": [
            "number",
            "null"
          ],
          "description": "Declared in the latest reported quarter."
        },
        "lastDividendPeriodEnd": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "revenueTtmUsd": {
          "type": [
            "number",
            "null"
          ]
        },
        "netIncomeTtmUsd": {
          "type": [
            "number",
            "null"
          ]
        },
        "epsDilutedTtm": {
          "type": [
            "number",
            "null"
          ]
        },
        "peRatio": {
          "type": [
            "number",
            "null"
          ],
          "description": "referencePrice / epsDilutedTtm; null when EPS <= 0."
        },
        "ttmBasis": {
          "description": "`quarters`: last four reported quarters; `annual`: latest fiscal year.",
          "anyOf": [
            {
              "$ref": "#/$defs/PublicTradfiReferenceTtmBasis"
            },
            {
              "type": "null"
            }
          ]
        },
        "ttmPeriodEnd": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "End of the twelve months behind revenue, net income and EPS."
        },
        "sector": {
          "type": [
            "string",
            "null"
          ],
          "description": "SEC SIC industry description, e.g. Electronic Computers."
        },
        "fiscalYearEnd": {
          "type": [
            "string",
            "null"
          ],
          "description": "MM-DD, e.g. 09-26."
        },
        "latestFiling": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "form",
                "date"
              ],
              "properties": {
                "form": {
                  "type": "string"
                },
                "date": {
                  "type": "string",
                  "format": "date"
                }
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "fetchedAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the aggregator last read SEC."
        },
        "source": {
          "type": "object",
          "required": [
            "name",
            "publisher",
            "url",
            "dataUrl",
            "note"
          ],
          "properties": {
            "name": {
              "type": "string",
              "enum": [
                "SEC EDGAR"
              ]
            },
            "publisher": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "description": "EDGAR filing list of the issuer."
            },
            "dataUrl": {
              "type": "string",
              "description": "The XBRL companyfacts JSON the values were derived from."
            },
            "note": {
              "type": "string"
            }
          }
        }
      }
    },
    "PublicTradfiReferenceHistoryWindow": {
      "type": "object",
      "required": [
        "window",
        "from",
        "to",
        "intervalSeconds"
      ],
      "properties": {
        "window": {
          "type": "string",
          "description": "`24h` or `7d`."
        },
        "from": {
          "type": "string",
          "format": "date-time"
        },
        "to": {
          "type": "string",
          "format": "date-time"
        },
        "intervalSeconds": {
          "type": "integer"
        }
      }
    },
    "PublicTradfiReferenceHomeListing": {
      "type": "object",
      "description": "Home-market listing of an instrument quoted outside the US.",
      "required": [
        "exchange",
        "currency",
        "code"
      ],
      "properties": {
        "exchange": {
          "type": "string",
          "description": "`KRX` or `HKEX`."
        },
        "currency": {
          "type": "string",
          "description": "`KRW` or `HKD`."
        },
        "code": {
          "type": "string",
          "description": "Home-market code without the exchange suffix."
        }
      }
    },
    "PublicTradfiReferenceInstrument": {
      "type": "object",
      "required": [
        "ticker",
        "name",
        "assetClass",
        "unit",
        "venueQuoteAsset",
        "issuer",
        "leverage",
        "homeListing"
      ],
      "properties": {
        "ticker": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "assetClass": {
          "type": "string",
          "description": "Currently equity, etf, metal, commodity or fx."
        },
        "unit": {
          "$ref": "#/$defs/PublicTradfiReferenceUnit"
        },
        "venueQuoteAsset": {
          "type": "string",
          "description": "Contract quote asset (`USDT`)."
        },
        "issuer": {
          "type": [
            "string",
            "null"
          ],
          "description": "Fund issuer, set for leveraged or inverse ETFs."
        },
        "leverage": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicTradfiReferenceLeverage"
            },
            {
              "type": "null"
            }
          ]
        },
        "homeListing": {
          "anyOf": [
            {
              "$ref": "#/$defs/PublicTradfiReferenceHomeListing"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "PublicTradfiReferenceLeverage": {
      "type": "object",
      "required": [
        "factor",
        "underlying"
      ],
      "properties": {
        "factor": {
          "type": "number",
          "description": "Daily target multiple of the underlying's return; negative means inverse."
        },
        "underlying": {
          "type": "string"
        }
      }
    },
    "PublicTradfiReferenceLive": {
      "type": "object",
      "description": "Near-real-time consensus with the same method as `latest`, republished\nabout every 10 seconds. Null when the overlay is off or unavailable,\nfails validation, or is older than `liveMaxAgeSeconds`; `latest` and\nevery derived field are unaffected by it.\n",
      "required": [
        "price",
        "minPrice",
        "maxPrice",
        "venueSpreadPct",
        "venueCount",
        "venues",
        "sourceAt",
        "ageSeconds",
        "change24hPct"
      ],
      "properties": {
        "price": {
          "type": "number"
        },
        "minPrice": {
          "type": "number"
        },
        "maxPrice": {
          "type": "number"
        },
        "venueSpreadPct": {
          "type": "number"
        },
        "venueCount": {
          "type": "integer"
        },
        "venues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PublicTradfiReferenceLiveVenue"
          }
        },
        "sourceAt": {
          "type": "string",
          "format": "date-time",
          "description": "Oldest venue read inside this consensus, the honest age of the price."
        },
        "ageSeconds": {
          "type": "integer"
        },
        "change24hPct": {
          "type": [
            "number",
            "null"
          ],
          "description": "Live price against the same reference as `change24h`."
        }
      }
    },
    "PublicTradfiReferenceLiveVenue": {
      "type": "object",
      "required": [
        "venue",
        "indexPrice"
      ],
      "properties": {
        "venue": {
          "type": "string"
        },
        "indexPrice": {
          "type": "number"
        }
      }
    },
    "PublicTradfiReferenceMethodology": {
      "type": "object",
      "required": [
        "basis",
        "aggregation",
        "minimumVenueCount",
        "maxVenueSpreadPct",
        "collectionIntervalSeconds",
        "freshnessThresholdSeconds",
        "retentionDays",
        "liveMaxAgeSeconds"
      ],
      "properties": {
        "basis": {
          "type": "string"
        },
        "aggregation": {
          "type": "string"
        },
        "minimumVenueCount": {
          "type": "integer"
        },
        "maxVenueSpreadPct": {
          "type": "number"
        },
        "collectionIntervalSeconds": {
          "type": "integer"
        },
        "freshnessThresholdSeconds": {
          "type": "integer"
        },
        "retentionDays": {
          "type": "integer"
        },
        "liveMaxAgeSeconds": {
          "type": "integer",
          "description": "A `live` value older than this is not served."
        }
      }
    },
    "PublicTradfiReferenceRange": {
      "type": "object",
      "description": "Low and high of validated recorded medians in the 24 hours ending at `latest`.",
      "required": [
        "low",
        "high",
        "observations"
      ],
      "properties": {
        "low": {
          "type": "number"
        },
        "high": {
          "type": "number"
        },
        "observations": {
          "type": "integer"
        }
      }
    },
    "PublicTradfiReferenceSnapshot": {
      "type": "object",
      "required": [
        "bucketStart",
        "fetchedAt",
        "consensusPrice",
        "minPrice",
        "maxPrice",
        "venueSpreadPct",
        "venueCount",
        "venues"
      ],
      "properties": {
        "bucketStart": {
          "type": "string",
          "format": "date-time"
        },
        "fetchedAt": {
          "type": "string",
          "format": "date-time"
        },
        "consensusPrice": {
          "type": "number"
        },
        "minPrice": {
          "type": "number"
        },
        "maxPrice": {
          "type": "number"
        },
        "venueSpreadPct": {
          "type": "number"
        },
        "venueCount": {
          "type": "integer"
        },
        "venues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PublicTradfiReferenceVenueQuote"
          }
        }
      }
    },
    "PublicTradfiReferenceTtmBasis": {
      "type": "string",
      "enum": [
        "quarters",
        "annual"
      ]
    },
    "PublicTradfiReferenceUnit": {
      "type": "object",
      "description": "The index denomination is deliberately not inferred; `status` is `unverified`.",
      "required": [
        "status",
        "currency",
        "per"
      ],
      "properties": {
        "status": {
          "type": "string"
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "per": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "PublicTradfiReferenceVenueQuote": {
      "type": "object",
      "required": [
        "venue",
        "symbol",
        "label",
        "assetClass",
        "indexPrice",
        "sourceObservedAt"
      ],
      "properties": {
        "venue": {
          "type": "string",
          "description": "`binance`, `bybit` or `gate`."
        },
        "symbol": {
          "type": "string"
        },
        "label": {
          "type": "string",
          "description": "The venue's own instrument label."
        },
        "assetClass": {
          "type": "string"
        },
        "indexPrice": {
          "type": "number"
        },
        "sourceObservedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Venue observation time; currently always null (not recorded)."
        }
      }
    },
    "PublicTradfiReferenceWeek52": {
      "type": "object",
      "required": [
        "high",
        "low",
        "asOf",
        "days"
      ],
      "properties": {
        "high": {
          "type": "number"
        },
        "low": {
          "type": "number"
        },
        "asOf": {
          "type": "string",
          "format": "date",
          "description": "Latest UTC day included."
        },
        "days": {
          "type": "integer",
          "description": "Days with data in the window (not 365 while history is short)."
        }
      }
    }
  }
}