{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://402rates.com/schemas/rwa-access-evidence-v1.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "report_version",
    "status",
    "capability",
    "evidence_as_of",
    "data_status",
    "records",
    "sources",
    "limitations",
    "disclaimer"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0.0"
    },
    "report_version": {
      "const": "1.0.0"
    },
    "status": {
      "const": "available"
    },
    "capability": {
      "const": "compass.rwa.access_evidence"
    },
    "evidence_as_of": {
      "type": "string",
      "format": "date"
    },
    "data_status": {
      "const": "dated_documentary_evidence"
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "record_id",
          "record_kind",
          "name",
          "distribution_venue",
          "access_path",
          "manager",
          "underlying_instrument",
          "verification",
          "access",
          "protocol",
          "asset_leg",
          "cash_leg",
          "market_evidence",
          "source_ids",
          "limitations"
        ],
        "properties": {
          "record_id": {
            "type": "string"
          },
          "record_kind": {
            "enum": [
              "distribution_announcement",
              "settlement_protocol"
            ]
          },
          "name": {
            "type": "string"
          },
          "distribution_venue": {
            "type": [
              "string",
              "null"
            ]
          },
          "access_path": {
            "type": "string"
          },
          "manager": {
            "type": [
              "string",
              "null"
            ]
          },
          "underlying_instrument": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "tracked_instrument_id",
              "fund_name",
              "share_class",
              "chain",
              "contract_address",
              "token_symbol"
            ],
            "properties": {
              "status": {
                "enum": [
                  "unresolved",
                  "not_applicable"
                ]
              },
              "tracked_instrument_id": {
                "type": "null"
              },
              "fund_name": {
                "type": "null"
              },
              "share_class": {
                "type": "null"
              },
              "chain": {
                "type": "null"
              },
              "contract_address": {
                "type": "null"
              },
              "token_symbol": {
                "type": "null"
              }
            }
          },
          "verification": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "documentation_reviewed_on",
              "independently_verified_onchain",
              "independently_verified_operationally"
            ],
            "properties": {
              "status": {
                "enum": [
                  "publisher_announced",
                  "publisher_documented"
                ]
              },
              "documentation_reviewed_on": {
                "type": "string",
                "format": "date"
              },
              "independently_verified_onchain": {
                "const": false
              },
              "independently_verified_operationally": {
                "const": false
              }
            }
          },
          "access": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "issuer_stated",
              "source_ids",
              "investor_types",
              "jurisdiction",
              "onboarding",
              "wallet_permissions",
              "minimum_subscription",
              "redemption_terms"
            ],
            "properties": {
              "status": {
                "type": "string"
              },
              "issuer_stated": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "investor_types": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "jurisdiction": {
                "type": "null"
              },
              "onboarding": {
                "type": "null"
              },
              "wallet_permissions": {
                "type": "null"
              },
              "minimum_subscription": {
                "type": "null"
              },
              "redemption_terms": {
                "type": "null"
              }
            }
          },
          "protocol": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "chain",
                  "program_address",
                  "deployment_status",
                  "software_license",
                  "documented_source_revision",
                  "documented_idl_version",
                  "account_name",
                  "account_size_bytes",
                  "upgradeable",
                  "settlement_model",
                  "create_permission",
                  "funding_method",
                  "settlement_signer",
                  "cancel_signer",
                  "reclaim_reject_recover_signers",
                  "blocked_mint_extensions",
                  "token_programs",
                  "source_ids"
                ],
                "properties": {
                  "chain": {
                    "type": "string"
                  },
                  "program_address": {
                    "type": "string"
                  },
                  "deployment_status": {
                    "type": "string"
                  },
                  "software_license": {
                    "type": "string"
                  },
                  "documented_source_revision": {
                    "type": "string"
                  },
                  "documented_idl_version": {
                    "type": "string"
                  },
                  "account_name": {
                    "type": "string"
                  },
                  "account_size_bytes": {
                    "type": "integer"
                  },
                  "upgradeable": {
                    "type": "boolean"
                  },
                  "settlement_model": {
                    "type": "string"
                  },
                  "create_permission": {
                    "type": "string"
                  },
                  "funding_method": {
                    "type": "string"
                  },
                  "settlement_signer": {
                    "type": "string"
                  },
                  "cancel_signer": {
                    "type": "string"
                  },
                  "reclaim_reject_recover_signers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "blocked_mint_extensions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "token_programs": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "source_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            ]
          },
          "asset_leg": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "token",
              "chain",
              "amount",
              "party_field",
              "mint_field",
              "amount_field"
            ],
            "properties": {
              "token": {
                "type": "null"
              },
              "chain": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "amount": {
                "type": "null"
              },
              "party_field": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mint_field": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "amount_field": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "cash_leg": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "token",
              "chain",
              "amount",
              "party_field",
              "mint_field",
              "amount_field"
            ],
            "properties": {
              "token": {
                "type": "null"
              },
              "chain": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "amount": {
                "type": "null"
              },
              "party_field": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mint_field": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "amount_field": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "market_evidence": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "price",
              "yield",
              "liquidity",
              "order_book",
              "executable_quote"
            ],
            "properties": {
              "status": {
                "const": "not_observed"
              },
              "price": {
                "type": "null"
              },
              "yield": {
                "type": "null"
              },
              "liquidity": {
                "type": "null"
              },
              "order_book": {
                "type": "null"
              },
              "executable_quote": {
                "type": "null"
              }
            }
          },
          "source_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "minItems": 1
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_id",
          "publisher",
          "url",
          "kind",
          "published_on",
          "content_as_of",
          "retrieved_on",
          "revision",
          "date_status",
          "note"
        ],
        "properties": {
          "source_id": {
            "type": "string"
          },
          "publisher": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string"
          },
          "published_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "content_as_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "retrieved_on": {
            "type": "string",
            "format": "date"
          },
          "revision": {
            "type": [
              "string",
              "null"
            ]
          },
          "date_status": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "minItems": 1
    },
    "limitations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "disclaimer": {
      "const": "Informational data and calculation service only. Not investment, legal, tax or accounting advice; not an offer, solicitation, recommendation, or determination of eligibility or suitability. Source and onchain data may be inaccurate, incomplete, delayed, stale or conflicting. Verify independently. The caller remains responsible for every decision and action; 402rates.com does not execute investment transactions or hold financial assets on the caller's behalf."
    }
  }
}
