{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usdf-fi/json-schema/usdf-fi-reserve-schema.json",
  "title": "Reserve",
  "description": "The proof of reserve on the primary chain, and each chain's where more than one is served. A figure the stats gate holds is left out, never sent as 0.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usdf-fi-openapi.json#/components/schemas/Reserve",
  "type": "object",
  "properties": {
    "network": {
      "type": "string",
      "description": "The primary chain's network name."
    },
    "chain_id": {
      "type": "integer",
      "description": "The primary chain's id."
    },
    "block": {
      "type": "string",
      "description": "The block the figures were read at, on the primary chain."
    },
    "as_of": {
      "type": "string",
      "description": "When it was read.",
      "format": "date-time"
    },
    "token": {
      "type": "object",
      "description": "USDF on the primary chain: its address, the contract's symbol, name and decimals, usd_per_token (1) and its explorer page."
    },
    "usdg": {
      "type": "object",
      "description": "USDG, the token that backs USDF 1:1.",
      "properties": {
        "address": {
          "type": "string"
        },
        "decimals": {
          "type": "integer"
        }
      },
      "required": [
        "address",
        "decimals"
      ]
    },
    "reserve_usdg": {
      "type": "object",
      "description": "USDG held by the USDF contract. Left out while the stats gate holds the reserve figure (reserve_usd).",
      "properties": {
        "units": {
          "type": "string",
          "description": "USDG base units (6 decimals)."
        },
        "usdg": {
          "type": "string",
          "description": "The same in USDG."
        }
      },
      "required": [
        "units",
        "usdg"
      ]
    },
    "supply": {
      "type": "object",
      "description": "USDF's total supply. Left out while the stats gate holds it (supply_usdf).",
      "properties": {
        "units": {
          "type": "string",
          "description": "USDF base units (6 decimals)."
        },
        "usdf": {
          "type": "string",
          "description": "The same in USDF."
        }
      },
      "required": [
        "units",
        "usdf"
      ]
    },
    "backing_ratio": {
      "type": "string",
      "description": "USDG held over USDF supply, six decimals; n/a while there is no supply."
    },
    "ratio": {
      "type": "string",
      "description": "The backing ratio to two decimals, as 1.00:1."
    },
    "fully_backed": {
      "type": "boolean",
      "description": "Whether the USDG held is at least the USDF supply."
    },
    "custody": {
      "type": "object",
      "description": "The gateway's operating wallets against what its ledger owes.",
      "properties": {
        "description": {
          "type": "string",
          "description": "What the operating wallets hold USDF for."
        },
        "hot": {
          "type": "object",
          "description": "The hot wallet.",
          "properties": {
            "address": {
              "type": "string"
            },
            "units": {
              "type": "string",
              "description": "Left out while the stats gate holds reserve_usd."
            },
            "retired": {
              "type": "array",
              "description": "The hot wallets a key rotation retired, which sent the settlements before it; empty when none.",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "address",
            "retired"
          ]
        },
        "cold": {
          "type": "object",
          "description": "The cold wallet, while one is set; its units left out while the stats gate holds reserve_usd.",
          "properties": {
            "address": {
              "type": "string"
            },
            "units": {
              "type": "string"
            }
          },
          "required": [
            "address"
          ]
        },
        "safe": {
          "type": "object",
          "description": "A custody wallet counted beside the hot wallet, where one is; its units left out while the stats gate holds reserve_usd.",
          "properties": {
            "address": {
              "type": "string"
            },
            "units": {
              "type": "string"
            }
          },
          "required": [
            "address"
          ]
        },
        "total_units": {
          "type": "string",
          "description": "USDF the operating wallets hold, in base units. Left out while the stats gate holds reserve_usd."
        },
        "owed_units": {
          "type": "string",
          "description": "What the ledger owes, in base units. Left out while the stats gate holds reserve_usd."
        },
        "covered": {
          "anyOf": [
            {
              "type": "boolean",
              "description": "Whether custody covers what is owed; null when a chain's figures could not be read."
            },
            {
              "type": "null"
            }
          ]
        },
        "note": {
          "type": "string",
          "description": "With more than one chain: what covered compares."
        }
      },
      "required": [
        "description",
        "hot",
        "covered"
      ]
    },
    "last_settlement": {
      "anyOf": [
        {
          "type": "object",
          "description": "The newest confirmed settlement, as GET /v1/stats names it."
        },
        {
          "type": "null"
        }
      ]
    },
    "reserve_view": {
      "anyOf": [
        {
          "type": "object",
          "description": "The read-only ReserveView contract; null where none is deployed.",
          "properties": {
            "address": {
              "type": "string"
            },
            "function": {
              "type": "string"
            },
            "selector": {
              "type": "string"
            },
            "explorer": {
              "type": "string"
            },
            "note": {
              "type": "string"
            }
          },
          "required": [
            "address",
            "function"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "attestations": {
      "type": "object",
      "description": "Where the signed daily attestations and their signer are read.",
      "properties": {
        "latest": {
          "type": "string"
        },
        "by_date": {
          "type": "string"
        },
        "signer": {
          "type": "string"
        }
      },
      "required": [
        "latest",
        "by_date",
        "signer"
      ]
    },
    "treasury_lending": {
      "type": "object",
      "description": "While treasury lending is on: its state, rule and vault, and while live the position read from the chain (its amounts left out while the stats gate holds reserve_usd)."
    },
    "chains": {
      "type": "array",
      "description": "With more than one chain served: each chain's section (chain_id, name, network, primary, available, block, token, underlying, reserve, supply, backing_ratio, ratio, fully_backed, custody, x402).",
      "items": {
        "type": "object"
      }
    },
    "combined": {
      "type": "object",
      "description": "With more than one chain served: custody on every chain against what the ledger owes (chains, note, custody_total_units, owed_units, covered)."
    },
    "stale": {
      "type": "boolean",
      "description": "true: the last good read, served while the chain does not answer."
    },
    "age_seconds": {
      "type": "integer",
      "description": "A stale answer's age."
    }
  },
  "required": [
    "network",
    "chain_id",
    "block",
    "as_of",
    "token",
    "usdg",
    "backing_ratio",
    "fully_backed",
    "custody",
    "last_settlement",
    "reserve_view",
    "attestations"
  ]
}