{
  "$defs": {
    "SettlementCompensationEntry": {
      "additionalProperties": false,
      "description": "One party's compensation-plan entry inside ``settlement.explained``.",
      "properties": {
        "amount": {
          "title": "Amount",
          "type": "integer"
        },
        "exposure_basis": {
          "title": "Exposure Basis",
          "type": "integer"
        },
        "kind": {
          "title": "Kind",
          "type": "string"
        },
        "principal_key": {
          "title": "Principal Key",
          "type": "string"
        }
      },
      "required": [
        "principal_key",
        "amount",
        "exposure_basis",
        "kind"
      ],
      "title": "SettlementCompensationEntry",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Payload for ``settlement.explained``.\n\nEmitted in ``application/commands/settlement.py`` (``_explained_event``)\nalongside every terminal trade event \u2014 ``trade.completed`` or\n``trade.failed``/``trade.compensated`` \u2014 carrying the full settlement\nexplanation record. Per the D0.9 audit (`EVENT-CATALOG.md` \u00a7D), this\npayload is broadcast identically to every trade-wide recipient\n(both sides of the trade), unlike the strict own-side-only\n``GET .../settlement`` REST endpoint \u2014 a pre-existing architectural gap\nflagged there, not fixed by this schema.",
  "properties": {
    "comp": {
      "items": {
        "$ref": "#/$defs/SettlementCompensationEntry"
      },
      "title": "Comp",
      "type": "array"
    },
    "fabrication_flagged": {
      "title": "Fabrication Flagged",
      "type": "boolean"
    },
    "failure_class": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Failure Class"
    },
    "fault_principal_key": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Fault Principal Key"
    },
    "fees": {
      "additionalProperties": true,
      "title": "Fees",
      "type": "object"
    },
    "holds_consumed": {
      "title": "Holds Consumed",
      "type": "integer"
    },
    "policy_version": {
      "title": "Policy Version",
      "type": "string"
    },
    "rebates": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Rebates",
      "type": "array"
    },
    "remainder_to_rebates_pool": {
      "title": "Remainder To Rebates Pool",
      "type": "integer"
    },
    "rule_version": {
      "title": "Rule Version",
      "type": "string"
    },
    "severity_n": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Severity N"
    },
    "slash_amount": {
      "title": "Slash Amount",
      "type": "integer"
    },
    "terminal_state": {
      "title": "Terminal State",
      "type": "string"
    },
    "trade_id": {
      "title": "Trade Id",
      "type": "string"
    }
  },
  "required": [
    "trade_id",
    "terminal_state",
    "slash_amount",
    "comp",
    "remainder_to_rebates_pool",
    "holds_consumed",
    "fees",
    "rebates",
    "policy_version",
    "rule_version",
    "fabrication_flagged"
  ],
  "title": "SettlementExplainedEventPayload",
  "type": "object"
}
