{
  "type": "record",
  "name": "RateUpdated",
  "namespace": "com.plumery.forex.events",
  "doc": "Event emitted when the FX rate for a specific currency pair has changed materially. Both directions of a pair are published as separate events.",
  "fields": [
    {
      "name": "id",
      "type": "string",
      "doc": "Unique identifier for the event."
    },
    {
      "name": "fromCurrency",
      "type": "string",
      "doc": "ISO 4217 alpha-3 code of the source currency."
    },
    {
      "name": "toCurrency",
      "type": "string",
      "doc": "ISO 4217 alpha-3 code of the destination currency."
    },
    {
      "name": "rate",
      "type": {
        "type": "bytes",
        "logicalType": "decimal",
        "precision": 24,
        "scale": 12
      },
      "doc": "Exchange rate expressed as a decimal. Semantics: toAmount = fromAmount * rate."
    },
    {
      "name": "asOf",
      "type": {
        "type": "long",
        "logicalType": "timestamp-millis"
      },
      "doc": "Timestamp when the upstream provider quoted this rate (epoch milliseconds). Consumers use this to enforce monotonic updates against local cache."
    },
    {
      "name": "source",
      "type": [
        "null",
        "string"
      ],
      "default": null,
      "doc": "Identifier of the FX rate provider (e.g. \"currencycloud\"). Optional; may be omitted when the source is unambiguous from deployment context."
    }
  ]
}