{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/blindpay-com/json-schema/blindpay-com-yield-out-schema.json",
  "title": "YieldOut",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/blindpay-com-wallets-api-openapi.yml#/components/schemas/YieldOut",
  "type": "object",
  "properties": {
    "status": {
      "$ref": "#/$defs/YieldStatus"
    },
    "as_of": {
      "type": "string",
      "format": "date-time"
    },
    "fee_bps": {
      "type": "integer",
      "description": "Performance fee on gains, basis points. Charged only on new gains above the previous high-water mark."
    },
    "positions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/YieldPositionOut"
      }
    }
  },
  "required": [
    "status",
    "as_of",
    "fee_bps",
    "positions"
  ],
  "$defs": {
    "YieldPositionOut": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "enum": [
            "USDC",
            "USDT",
            "USDB"
          ]
        },
        "vault": {
          "$ref": "#/$defs/YieldVaultOut"
        },
        "apy": {
          "type": [
            "number",
            "null"
          ],
          "description": "APY the wallet earns after the performance fee, as a fraction. Null when the vault rate is unavailable."
        },
        "gross_amount": {
          "type": "number",
          "description": "Current vault value before fees, in token units"
        },
        "fee_accrued": {
          "type": "number",
          "description": "Performance fee accrued on gains and not yet collected, in token units"
        },
        "earning_amount": {
          "type": "number",
          "description": "Current vault value net of accrued fees, in token units. This is the balance earning yield, not the profit."
        },
        "max_withdrawable": {
          "type": "number",
          "description": "Amount the vault can return right now, in token units"
        },
        "total_deposited": {
          "type": "number",
          "description": "Lifetime deposits into the vault from this wallet, in token units"
        },
        "total_withdrawn": {
          "type": "number",
          "description": "Lifetime withdrawals back to this wallet, excluding fee collections, in token units"
        },
        "lifetime_earned_amount": {
          "type": "number",
          "description": "Lifetime net profit after fees, in token units, across every time yield was enabled on this wallet"
        }
      },
      "required": [
        "token",
        "vault",
        "apy",
        "gross_amount",
        "fee_accrued",
        "earning_amount",
        "max_withdrawable",
        "total_deposited",
        "total_withdrawn",
        "lifetime_earned_amount"
      ]
    },
    "YieldStatus": {
      "type": "string",
      "enum": [
        "disabled",
        "enabled",
        "disabling"
      ],
      "default": "disabled"
    },
    "YieldVaultOut": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "pattern": "^0x[a-fA-F0-9]{40}$"
        },
        "apy": {
          "type": [
            "number",
            "null"
          ],
          "description": "Vault APY before fees, as a fraction. Null when the source is unavailable."
        }
      },
      "required": [
        "address",
        "apy"
      ]
    }
  }
}