{
  "openapi": "3.1.0",
  "info": {
    "title": "Loopscale Markets API",
    "description": "Public markets API served under https://tars.loopscale.com/v1/markets. All write endpoints accept an optional `Idempotent-Key` header and return the standard error envelope. The `x-request-id` response header carries the correlation id for support.",
    "license": {
      "name": ""
    },
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "https://tars.loopscale.com/v1/markets",
      "description": "Production"
    },
    {
      "url": "/",
      "description": "Local / direct (no ingress prefix)"
    }
  ],
  "paths": {
    "/collateral/holders": {
      "post": {
        "tags": [
          "stats"
        ],
        "operationId": "query_get_active_collateral_summary",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HolderFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Active collateral holder summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CollateralHolderStats"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/collateral/holders/historical": {
      "post": {
        "tags": [
          "stats"
        ],
        "operationId": "query_get_historical_collateral_summary",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HistoricalCollateralHolderFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Historical collateral holder summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HistoricalCollateralHolderStats"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/borrow": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_borrow_principal",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnBorrowPrincipalParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/build": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_build_loan",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoanBuildParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanBuildResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/close_loan": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_close_loan",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnCloseLoanParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/collateral/deposit": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_deposit_collateral",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnDepositCollateralParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/collateral/orca/claim_fees": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_claim_orca_fee",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnClaimFeeParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/collateral/orca/transfer_position": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_transfer_orca_position",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnTransferOrcaPositionParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/collateral/orca/update_liquidity": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_manage_orca_liquidity",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnManageOrcaLiquidityParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/collateral/raydium/transfer_position": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_transfer_raydium_position",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnTransferRaydiumPositionParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/collateral/raydium/update_liquidity": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_manage_raydium_liquidity",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnManageRaydiumLiquidityParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/collateral/withdraw": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_withdraw_collateral",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnWithdrawCollateralParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/create": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_create_loan",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnCreateLoanParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateLoanReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/flash_borrow": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_flash_borrow",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncreaseLeverageTransactionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/lend/build_loopscale": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_build_lender_loopscale",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LenderBuildParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LenderBuildResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/merge_loan": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_merge_loan",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnMergeLoanParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/refinance": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_refinance_ledger",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnRefinanceLedgerParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/repay": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_repay_principal",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnRepayPrincipalParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/repay_simple": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_simple_repay_principal",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnSimpleRepayPrincipalParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/sell": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_sell_ledger",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnSellLedgerParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/creditbook/swap_collateral": {
      "post": {
        "tags": [
          "creditbook"
        ],
        "operationId": "query_swap_collateral",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnSwapCollateralParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanTxnResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/portfolio/chart": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_position_chart",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnPositionChartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn position chart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnPositionChartResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/portfolio/events": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_portfolio_events",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnPortfolioEventsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn portfolio events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EarnPortfolioEventRow"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/portfolio/history": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_position_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnPositionHistoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn position history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EarnPositionHistoryPoint"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/portfolio/positions": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_portfolio_positions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnWalletRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn portfolio positions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EarnVaultPositionResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/portfolio/summary": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_portfolio_summary",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnWalletRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn portfolio summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EarnPortfolioSummaryPosition"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults": {
      "get": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_vaults",
        "responses": {
          "200": {
            "description": "Earn vaults",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EarnVaultWithLatestSnapshot"
                  }
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/acknowledge": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_acknowledge_earn_vault",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnWalletVaultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Acknowledged",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnAcknowledgeResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/activity": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_vault_activity",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnVaultActivityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn vault activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnVaultActivityResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/history": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_vault_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnVaultHistoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn vault history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EarnVaultHistoryPoint"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/positions": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_vault_position",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnWalletVaultRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn vault position",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnVaultPositionResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/queue": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_queue",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnQueueRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn withdrawal queue",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnQueueResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/strategy-positions": {
      "post": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_vault_strategy_positions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EarnVaultPositionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Earn vault strategy positions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnVaultPositionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/{address}": {
      "get": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_vault",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Earn vault address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Earn vault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnVaultWithLatestSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/earn/vaults/{address}/positions": {
      "get": {
        "tags": [
          "earn_data"
        ],
        "operationId": "query_get_earn_vault_position_display_apy",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Earn vault address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-vault positions joined to Display APY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EarnVaultPositionDisplayApyResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/external_yield/info": {
      "get": {
        "tags": [
          "external_yield_data"
        ],
        "summary": "Get the current external yield info. Returns: Vec<ExternalYieldVault>",
        "operationId": "query_get_external_yield_info",
        "responses": {
          "200": {
            "description": "Current external yield vaults",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ExternalYieldVault"
                  }
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/external_yield/paused": {
      "get": {
        "tags": [
          "external_yield_data"
        ],
        "summary": "Get the paused external yield sources. Returns: Vec<u8>",
        "operationId": "query_get_paused_external_yield_sources",
        "responses": {
          "200": {
            "description": "Paused external yield source ids",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "format": "int32",
                    "minimum": 0
                  }
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/access": {
      "get": {
        "tags": [
          "lending_vaults_data"
        ],
        "summary": "Tells the caller whether their connected wallet is allowed to access the\ngiven vault. The frontend calls this when its vault gate is enabled: a\nwallet is allowed only if its `wallet_policies` carry a `vault_allowed`\nentry for that specific vault address.",
        "operationId": "query_vault_access",
        "parameters": [
          {
            "name": "vaultAddress",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Whether the wallet may access the vault",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultAccessReturn"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/allocation/{vault_address}": {
      "get": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_fetch_lending_vaults_allocation",
        "parameters": [
          {
            "name": "vault_address",
            "in": "path",
            "description": "Vault account address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-collateral allocation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LendingVaultAllocation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/create": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_create_lend_vault",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryCreateLendVaultParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/deposit": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_lend_vault_deposit",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LendVaultDepositQueryParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LendVaultDepositResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/deposit_summary": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_get_user_position_deposit_summary",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPositionDepositSummaryParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Per-vault deposit/withdrawal summary keyed by vault address",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/VaultDepositSummary"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/deposits": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_get_vault_positions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserLendingVaultFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VaultDeposits"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/deposits/edit": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_edit_lend_vault_deposits",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditLendVaultDepositsQueryParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/fee/claim": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_claim_lend_vault_fee",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimLendVaultFeeQueryParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/history": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "summary": "Get lending vaults history. Returns: Vec<LendingVaultsHistory>",
        "operationId": "query_get_lending_vaults_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FetchLendVaultsHistoryParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Vault history series",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PartialLendingVaultsHistory"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/info": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "summary": "Get lending vaults info. Returns: LendVaultsInfoResponse",
        "description": "Set `includeStrategySummaries` to attach each vault's `strategySummary`\n(per-strategy USD/APY: TVL, deployed, blended APY, …) — the same numbers\n`POST /strategy/summaries` returns — so the FE can render APY/TVL without a\nsecond call.\n\nExample request (offset/page mode):\n```json\n{\n  \"page\": 0,\n  \"pageSize\": 25,\n  \"sortType\": 0,\n  \"sortDirection\": 1,\n  \"includeRewards\": false,\n  \"includeStrategySummaries\": true\n}\n```\n\nExample response (offset/page mode):\n```json\n{\n  \"lendVaults\": [],\n  \"total\": 120\n}\n```",
        "operationId": "query_get_lending_vaults",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FetchLendVaultsInfoParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Paginated lend vaults",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LendVaultsInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/ix/mint_lp": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_vault_mint_lp_instructions",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VaultDepositWithQuoteParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Instructions + LUTs + quote built",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstructionWithLutsAndQuote"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/ix/redeem_lp": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_vault_redeem_lp_instructions",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VaultWithdrawWithQuoteParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Instructions + LUTs + quote built",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstructionWithLutsAndQuote"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/metadata/update": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_update_vault_metadata",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVaultMetadataParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/pnl/rewards": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_get_user_external_rewards_pnl",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserExternalRewardsFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "object",
                      "additionalProperties": {
                        "$ref": "#/components/schemas/UserExternalRewardsPnlInfo"
                      },
                      "propertyNames": {
                        "type": "string"
                      }
                    },
                    "propertyNames": {
                      "type": "string"
                    }
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/rewards/claim": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_claim_lend_vault_rewards",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimLendVaultRewardsParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionedTransactionReturn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/rewards/claim/all": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_claim_all_vault_rewards",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimAllVaultRewardsParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimAllVaultRewardsReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/rewards/schedule/create": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_create_lend_vault_rewards_schedule",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRewardsScheduleTxnParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/rewards/schedule/edit": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_edit_lend_vault_rewards_schedule",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRewardsScheduleTxnParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/stats": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "summary": "Get lending vaults info. Returns: LendVaultsInfoResponse",
        "operationId": "query_get_lending_vault_stats",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FetchLendVaultsInfoParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Per-vault stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LendingVaultStats"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/summary": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "summary": "Summary variant of `query_get_lending_vaults`. Same request/response shape\n(`FetchLendVaultsInfoParams` → `LendVaultsInfoResponse`) but skips the\n`market_information_asset_data` / `strategy_collateral_terms` joins, so each\nvault's `vaultStrategy.terms.assetTerms` comes back empty. Mirrors\n`POST /strategy/summaries`.",
        "operationId": "query_get_lending_vault_summary",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FetchLendVaultsInfoParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Lend vaults + aggregates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LendVaultsSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/timelock/cancel": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_cancel_timelock",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/QueryCancelTimelockParams"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionedTransactionReturn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/timelock/create": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_create_timelocks",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitLendingVaultTimelockTxnParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionedTransactionReturn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/user": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "summary": "Filter-scoped, snapshot-consistent vault deposits with per-item USD + APY\nbreakdown + a full-filter aggregate. See `VaultDepositsV2Response`.\nBody: `UserLendingVaultFilter` with `userAddress` set on the filter (no\nauth-header fallback — matches the filter-only convention of the other v2\nendpoints like `/strategy/infos`).",
        "operationId": "route_get_user_positions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserLendingVaultFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Paginated vault positions + aggregates (also served at /lending_vaults/user/v2)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiVaultDepositV2Response"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/user_positions": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_get_user_lending_vault_stake_positions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserLendingVaultFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserVaultStakePositionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/user_positions/active_stats": {
      "get": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_get_user_lend_vault_active_stats",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/UserLendVaultActiveStats"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/lending_vaults/withdraw": {
      "post": {
        "tags": [
          "lending_vaults"
        ],
        "operationId": "query_lend_vault_withdraw",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LendVaultWithdrawQueryParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LendVaultWithdrawResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/historical": {
      "post": {
        "tags": [
          "loans_data"
        ],
        "summary": "Closed-loan listing for the \"Past Loans\" portfolio view. Reads pre-built\nsnapshots from `closed_ledger_summary` so we don't rebuild the picture\nfrom raw events on every request. Body must scope by `borrower` or\n`loanAddresses`. Filtering by principal/collateral mint and pagination\nrun in-process against the user's full history.",
        "operationId": "route_get_historical_loans",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HistoricalLoansFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Closed-loan history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoricalLoansResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/info": {
      "post": {
        "tags": [
          "loans_data"
        ],
        "summary": "Filter-scoped, snapshot-consistent loan infos with per-item USD + a\nfull-filter summary. See `LoanSummary`. Body: `LoanFilter` (flat —\n`page`/`pageSize` live on the filter).",
        "operationId": "route_get_loan_infos",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoanFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Filter-scoped loan infos + aggregate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanSummary"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/pnl": {
      "post": {
        "tags": [
          "loans_data"
        ],
        "operationId": "route_get_loan_pnl",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoanPnlFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Loan PnL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/LoanPnlDetails"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/pnl/history": {
      "post": {
        "tags": [
          "loans_data"
        ],
        "operationId": "route_get_loan_pnl_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoanPnlHistoryFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Loan PnL history series",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/LoanPnlDetails"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/refinance_constraint": {
      "post": {
        "tags": [
          "loans_data"
        ],
        "summary": "Set a loan's refinance liquidation-threshold floor (signed, borrower-only).",
        "operationId": "route_set_refinance_constraint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRefinanceConstraintParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Floor stored"
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/toggle_position": {
      "post": {
        "tags": [
          "loans_data"
        ],
        "operationId": "route_toggle_loan_position",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToggleLoanPositionParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Toggled"
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/{address}": {
      "get": {
        "tags": [
          "loans_data"
        ],
        "summary": "Get one loan with full event and matrix timelines plus per-loan USD/risk\nfields stamped from the request's pinned oracle snapshot. Pass\n`?includePnl=true` to also stamp the rich PnL breakdown (graph series stay\non `/loans/pnl/history`).",
        "operationId": "route_get_loan_by_address",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Loan account address",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includePnl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Loan detail: base summary + past ledgers, parsed events, weight-matrix updates, and closed-loan lifetime summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoanDetail"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loans/{address}/refinance_constraint": {
      "get": {
        "tags": [
          "loans_data"
        ],
        "summary": "Read a loan's configured refinance liquidation-threshold floor (public).",
        "operationId": "route_get_refinance_constraint",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "description": "Loan account address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The loan's floor (minLiquidationThreshold is null when unset)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefinanceConstraintResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loop/collateral_yield/latest/mints": {
      "post": {
        "tags": [
          "loops_data"
        ],
        "summary": "get latest collateral yield by mints. returns HashMap<String, f64>",
        "operationId": "query_get_latest_collateral_yield_pcts",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Latest collateral yield pct by mint",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "number",
                    "format": "double"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loop/collateral_yield/latest/{mint}": {
      "get": {
        "tags": [
          "loops_data"
        ],
        "summary": "get latest collateral yield. returns percentage",
        "operationId": "query_get_latest_collateral_yield_pct",
        "parameters": [
          {
            "name": "mint",
            "in": "path",
            "description": "Collateral mint address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Latest collateral yield pct",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loop/collateral_yield/range": {
      "post": {
        "tags": [
          "loops_data"
        ],
        "summary": "get collateral yield in range. returns HashMap<String, Vec<CollateralYieldHistory>> sorted by timestamp",
        "operationId": "query_get_collateral_yields_in_range",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollateralYieldRangeQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Collateral yields in range",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/CollateralYieldHistory"
                    }
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loop/history": {
      "post": {
        "tags": [
          "loops_data"
        ],
        "summary": "fetch loop vault borrow rate",
        "operationId": "query_get_loop_vaults_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoopVaultBorrowRateQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Loop vault borrow rate history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HistoricalLoopVaultBorrowRate"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/loop/info": {
      "post": {
        "tags": [
          "loops_data"
        ],
        "summary": "get loop vaults info. returns LoopVaultsInfo",
        "operationId": "query_get_loop_vaults_info",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoopVaultsInfoQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Loop vaults info",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/LoopVaultInfo"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/oracles/data/market_informations": {
      "post": {
        "tags": [
          "oracles_data"
        ],
        "operationId": "query_market_informations",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketInformationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Market informations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ParsedMarketInformationWithLtvInfo"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/oracles/prices/history": {
      "post": {
        "tags": [
          "oracles_data"
        ],
        "operationId": "query_oracle_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OHLCFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Oracle price history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/OracleOHLC"
                    }
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/portfolio/rewards": {
      "post": {
        "tags": [
          "stats"
        ],
        "operationId": "query_get_portfolio_rewards",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortfolioRewardsFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Portfolio rewards grouped by source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioRewards"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "get raw quotes",
        "operationId": "route_get_quote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RawQuoteFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Raw quotes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RawQuoteOffer"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/apy": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "get raw quotes",
        "operationId": "route_get_quote_at_apy",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RawQuoteFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Raw quotes at APY",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RawQuoteOffer"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/best": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "get get best quote",
        "operationId": "route_get_best_quote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BestQuoteFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Best quote",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/BestQuote"
                    }
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/increase_credit/{loan}": {
      "get": {
        "tags": [
          "quotes"
        ],
        "summary": "get transfer credit quote",
        "operationId": "route_get_quote_for_increase_credit",
        "parameters": [
          {
            "name": "loan",
            "in": "path",
            "description": "Loan account address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Increase-credit quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferCreditQuote"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/loop": {
      "post": {
        "tags": [
          "quotes"
        ],
        "operationId": "route_get_best_loop_quote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BestLoopQuoteQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Best loop quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BestLoopQuoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/max": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "get max borrow quote",
        "operationId": "route_get_max_quote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaxQuoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Max borrow quote",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MaxQuoteResponse"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/merge_plan": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "get merge-plan quote (ranked merge options from offline planner)",
        "operationId": "route_get_merge_plan_quote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergePlanQuoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Ranked merge-plan options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergePlannerRankedResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/refinance": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "get get refiance quote quote",
        "operationId": "route_get_estimated_refinance_info",
        "parameters": [
          {
            "name": "loanAddress",
            "in": "query",
            "description": "Optional loan address; scopes the estimate to this loan's stored floor.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "propertyNames": {
                  "type": "string"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Estimated refinance info per collateral mint",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/EstimatedRefinanceInfo"
                    }
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/sell/v2": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "Greedy multi-loan sell quote. Quotes each loan in order while accounting\nfor the cumulative capacity each strategy has committed to earlier\nmatches in the batch. Capped at `MAX_LOANS_PER_SELL_QUOTE` for latency.",
        "operationId": "route_get_quote_for_loan_sales",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MultiSellLoanQuoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Batch loan-sale quotes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MultiSellLoanQuoteEntry"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/quote/sell/{loan}": {
      "get": {
        "tags": [
          "quotes"
        ],
        "operationId": "route_get_quote_for_loan_sale",
        "parameters": [
          {
            "name": "loan",
            "in": "path",
            "description": "Loan account address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Loan-sale quote",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SellLoanQuote"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/rates/history": {
      "post": {
        "tags": [
          "stats"
        ],
        "operationId": "query_fetch_rate_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RatesHistoryQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Historical market rates, keyed by market type",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/HistoricalMarketRate"
                    }
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/rates/principal_collateral/history": {
      "post": {
        "tags": [
          "stats"
        ],
        "summary": "fetch principal-collateral pair borrow rate history",
        "operationId": "query_get_principal_collateral_rate_history",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrincipalCollateralBorrowRateQuery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Per-collateral + aggregate borrow-rate history for a principal mint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrincipalCollateralRateHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/stats": {
      "post": {
        "tags": [
          "stats"
        ],
        "summary": "Unified market stats endpoint.",
        "description": "Served through the SWR envelope cache: fresh hits return the cached\nresponse, stale hits return it too while a singleflighted background task\nrecomputes, and only a fully-evicted key pays the fan-out inline.\n`force=true` skips the cache entirely.",
        "operationId": "query_get_unified_market_stats",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnifiedStatsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Unified market stats; each block present only when its include_* flag was set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnifiedStatsResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/close/{strategy}": {
      "post": {
        "tags": [
          "strategy"
        ],
        "operationId": "route_close_strategy",
        "parameters": [
          {
            "name": "strategy",
            "in": "path",
            "description": "Strategy account address to close",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/create": {
      "post": {
        "tags": [
          "strategy"
        ],
        "operationId": "query_create_strategy",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnCreateStrategyParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionedTransactionReturn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/deposit": {
      "post": {
        "tags": [
          "strategy"
        ],
        "operationId": "query_deposit_strategy",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnDepositStrategyParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/infos": {
      "post": {
        "tags": [
          "strategy_data"
        ],
        "summary": "Filter-scoped, snapshot-consistent strategy infos with per-item USD +\na full-filter aggregate. See `StrategyInfoResponse`. Body:\n`LendingStrategyFilter`.",
        "operationId": "route_get_strategy_info",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LendingStrategyFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Filter-scoped strategy infos + aggregate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStrategyInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/min_principal": {
      "post": {
        "tags": [
          "strategy_data"
        ],
        "summary": "Get the minimum amount for a principal mint. Returns a map of principal mint to minimum amount.",
        "operationId": "route_get_min_amount_for_principal_mints",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Min principal amount per mint",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/summaries": {
      "post": {
        "tags": [
          "strategy_data"
        ],
        "summary": "Summary variant of `route_get_strategy_info`. Same request/response shape but\nskips the `market_information_asset_data` and `strategy_collateral_terms`\njoins — `terms.asset_terms` is always empty in the response.",
        "operationId": "route_get_strategy_summaries",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LendingStrategyFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Strategy summaries (asset terms omitted) + aggregate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiStrategyInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/update": {
      "post": {
        "tags": [
          "strategy"
        ],
        "operationId": "query_update_strategy",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStrategyQueryParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionedTransactionReturn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/strategy/withdraw": {
      "post": {
        "tags": [
          "strategy"
        ],
        "operationId": "query_withdraw_strategy",
        "parameters": [
          {
            "name": "Idempotent-Key",
            "in": "header",
            "description": "Optional idempotency key; a retried write with the same key replays the original response",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TxnWithdrawStrategyParams"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Transaction(s) built successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionedTransactionReturn"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency-Key reused with a different request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/timelock/list": {
      "post": {
        "tags": [
          "strategy_data"
        ],
        "summary": "Fetch timelocks with filtering and pagination.",
        "operationId": "route_get_timelocks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimeLockFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Filtered, paginated timelocks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedTimeLockResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tvl/balances": {
      "get": {
        "tags": [
          "stats"
        ],
        "operationId": "query_historical_token_balances",
        "parameters": [
          {
            "name": "timestamp",
            "in": "query",
            "description": "optional ts",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Historical token balances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BalanceResponse"
                  }
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/user/genesis": {
      "get": {
        "tags": [
          "lending_vaults_data"
        ],
        "operationId": "query_get_is_whitelisted",
        "responses": {
          "200": {
            "description": "Whether the wallet is whitelisted",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/user/loans": {
      "post": {
        "tags": [
          "loans_data"
        ],
        "summary": "Portfolio overview for the borrower. Switches on `order_funding_types`:\n`Loop` (default) returns `loopGroups` keyed by\n`(collateralIdentifier, collateralMint)` with per-row healths,\nnet-position token amount, and all-time pnl %; anything else returns\n`loanGroups` keyed by principal mint with borrowed token amount + per-row\nhealths. The top-level `aggregate` is filter-scoped (not just the page).\nNo per-loan items — the FE loads rows via `POST /loans/info` narrowed to\nthe borrower + the group's mint/collateral.",
        "operationId": "route_get_user_loans",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserLoansFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "User loan groups + aggregate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUserLoansResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/user/strategies": {
      "post": {
        "tags": [
          "strategy_data"
        ],
        "summary": "Portfolio overview grouped by `principalMint`. Returns one group per mint\nfor the requested page, each with its own `StrategiesAggregate`, plus a\nfilter-scoped overall aggregate. No per-strategy items — the FE\nlazy-fetches those via `POST /strategy/infos` with\n`principalMints: [mint]` on row expand.",
        "operationId": "route_get_user_strategies",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserStrategiesFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "User strategy groups + aggregate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUserStrategiesResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/user/vaults": {
      "post": {
        "tags": [
          "lending_vaults_data"
        ],
        "summary": "Portfolio overview grouped by `principal_mint`. One group per mint for\nthe requested page, each carrying its own `VaultDepositsAggregate` plus\nraw native totals (no decimals applied) in the principal mint, plus a\nfilter-scoped overall aggregate. No per-row items — the FE loads the\nunderlying (vault, user) rows lazily via `POST /lending_vaults/user/v2`\nwith `principalMints` narrowed to the mint when a group expands.",
        "operationId": "route_get_user_vaults",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserVaultsFilter"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Portfolio overview grouped by principal mint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUserVaultsResponse"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddCollateralArgs": {
        "type": "object",
        "required": [
          "durationsAndApys"
        ],
        "properties": {
          "durationsAndApys": {
            "type": "object",
            "description": "Request map of serialized-duration → apy, both as strings.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "externalMarketInformationAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketInformation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ParsedUpdateAssetDataParams",
                "description": "Parsed asset-data params (ignored for base vaults / custom strategy)."
              }
            ]
          }
        }
      },
      "ApiLoanEventActionMetadata": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "addCollateral"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "removeCollateral"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedBorrowPrincipalMetadata"
              },
              "type": {
                "type": "string",
                "enum": [
                  "borrowPrincipal"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedRepayPrincipalMetadata"
              },
              "type": {
                "type": "string",
                "enum": [
                  "repayPrincipal"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedRefinanceLedgerMetadata"
              },
              "type": {
                "type": "string",
                "enum": [
                  "refinanceLedger"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedSellLedgerMetadata"
              },
              "type": {
                "type": "string",
                "enum": [
                  "sellLedger"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedLiquidateLedgerMetadata"
              },
              "type": {
                "type": "string",
                "enum": [
                  "liquidate"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedMigrateLedgerMetadata"
              },
              "type": {
                "type": "string",
                "enum": [
                  "migrate"
                ]
              }
            }
          }
        ],
        "description": "API-specific representation of loan event metadata (adjacently-tagged:\n`{ \"type\": <action>, \"params\": <metadata> }`)."
      },
      "ApiStrategyInfoResponse": {
        "type": "object",
        "required": [
          "items",
          "pageInfo",
          "aggregate",
          "snapshotTs"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/StrategiesAggregate"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StrategyDetail"
            }
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "snapshotTs": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ApiTimeLockUpdateParams": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "updateStrategyMarketInformation"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedAddCollateralTimelockArgs"
              },
              "type": {
                "type": "string",
                "enum": [
                  "addCollateral"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedUpdateAssetDataParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "updateLtv"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedCollateralTerms"
              },
              "type": {
                "type": "string",
                "enum": [
                  "removeCollateral"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedCollateralTerms"
              },
              "type": {
                "type": "string",
                "enum": [
                  "updateApy"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedUpdateStrategySettingsParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "updateStrategySettings"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedUpdateVaultSettingsParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "updateVaultSettings"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedApiUpdateCapsParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "updateCaps"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/ParsedUpdateAssetDataParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "updateCollateralAllocationPct"
                ]
              }
            }
          }
        ],
        "description": "Used ONLY for API responses (adjacently-tagged as { type, params })."
      },
      "ApiUserLoanGroup": {
        "type": "object",
        "description": "One **non-loop** loan group, keyed by `principal_mint`. `aggregate.count`\nis the number of loans in the group. `borrowedTokenAmount` is the raw\noutstanding principal (no decimals applied) summed across loans —\nsuitable for direct token-amount display without USD conversion.\n\n`rowHealths` is page-scoped (filled only for groups on the visible page).",
        "required": [
          "principalMint",
          "borrowedTokenAmount",
          "aggregate",
          "rowHealths"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/LoansAggregate",
            "description": "Filter-scoped `LoansAggregate` restricted to this principal mint.\nCollateral-side fields cover the collateral backing this group's\nloans. A loan borrowing two different mints fans its collateral out\nto both groups, so group collateral can overlap across groups; the\ntop-level `aggregate` remains the dedup'd filter-wide total."
          },
          "borrowedTokenAmount": {
            "type": "string",
            "description": "Sum of `principal_due − principal_repaid` across active ledgers in the\ngroup, in raw base units of `principalMint`. No decimals applied —\nencoded as a decimal string on the wire so JS can keep full\nprecision."
          },
          "principalMint": {
            "type": "string",
            "description": "SPL mint of the principal token the loans in this group are\nborrowing (e.g. USDC mint). The group key."
          },
          "rowHealths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiUserLoanRowHealth"
            },
            "description": "Per-loan LTV breakdown (`ltv`, `strategyLtv`, `liquidationThreshold`,\n`healthRatio`) for the loans in this group on the visible page.\nEmpty for groups outside the page (filling it requires per-loan\nsnapshots, which we only do for visible rows)."
          }
        }
      },
      "ApiUserLoanRowHealth": {
        "type": "object",
        "description": "One loan in a group with the LTV components needed to render its current\nrisk position. All ratios are fractional (0.85 = 85%) and computed against\nthe same pinned oracle snapshot as the group's weighted averages.",
        "required": [
          "loanAddress",
          "ltv",
          "strategyLtv",
          "liquidationThreshold",
          "healthRatio"
        ],
        "properties": {
          "healthRatio": {
            "type": "number",
            "format": "double",
            "description": "Liquidation health ratio in [0, 1]: `1 − ltv / liquidationThreshold`,\nclamped. 1 = fully healthy, 0 = at LQT. Retained alongside the LTV\nfields so existing consumers keep working."
          },
          "liquidationThreshold": {
            "type": "number",
            "format": "double",
            "description": "Liquidation threshold (fractional), collateral-USD-weighted. The LTV\nat which liquidation becomes possible — strictly greater than\n`strategyLtv`."
          },
          "loanAddress": {
            "type": "string",
            "description": "On-chain `loans.address` — the loan account this row describes."
          },
          "ltv": {
            "type": "number",
            "format": "double",
            "description": "Current LTV: `totalOwedAtRisk / collateralAtRisk` (fractional). Uses\noracle uncertainty bias to surface the worst-case ratio the loan would\nbe liquidated at right now."
          },
          "strategyLtv": {
            "type": "number",
            "format": "double",
            "description": "Strategy's max LTV (fractional), collateral-USD-weighted across the\nloan's positions. The borrow-side cap configured per\n(market, collateral) — i.e. the max LTV the borrower could ever have\ndrawn under at origination/refi."
          }
        }
      },
      "ApiUserLoansResponse": {
        "type": "object",
        "description": "Wire response for `POST /user/loans`. Exactly one of `loanGroups` /\n`loopGroups` carries the page payload — the other is always empty,\ndetermined by `order_funding_types`. The top-level `aggregate` is\nfilter-scoped across every matched loan (not just the page).\n`snapshot_ts` pins oracle/RPC pricing for USD fields.",
        "required": [
          "loanGroups",
          "loopGroups",
          "pageInfo",
          "aggregate",
          "snapshotTs"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/LoansAggregate",
            "description": "Filter-scoped aggregate across every matched loan, regardless of\nshape. Not page-scoped. Collateral-side fields are populated even\nfor the non-loop shape (the filter-wide collateral total is still\nmeaningful)."
          },
          "loanGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiUserLoanGroup"
            },
            "description": "Non-loop groups for the requested page, keyed by `principalMint` and\nsorted by `aggregate.principalUsd`. Empty when the filter resolves\nto `order_funding_types = Loop`."
          },
          "loopGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiUserLoopGroup"
            },
            "description": "Loop groups for the requested page, keyed by\n`(collateralIdentifier, collateralMint)` and sorted by net position\nUSD. Empty when the filter resolves to `order_funding_types ≠ Loop`."
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo",
            "description": "Pagination envelope. `totalItems` is the count of *distinct groups*\nin the active shape (mints for non-loop, collateral pairs for loop)."
          },
          "snapshotTs": {
            "type": "integer",
            "format": "int64",
            "description": "Snapshot timestamp in **milliseconds** since the epoch. Pins the\noracle + RPC prices used to derive every USD field in the response."
          }
        }
      },
      "ApiUserLoopGroup": {
        "type": "object",
        "description": "One **loop** group, keyed by `(collateralIdentifier, collateralMint)`.\n`aggregate.count` is the number of loans in the group.\n\n- `wAvgHealth` / `wAvgNetApy` use the existing loop-specific weighting\n  (debt-at-risk and net-capital, respectively).\n- `netPositionTokenAmount` is the raw collateral total for the group in\n  the collateral mint's native base units — every loop in the group\n  shares the same collateral mint so summing is coherent.\n- `pnlPctChange` is all-time: `pnl_usd / net_inflow_usd`. Zero when net\n  inflow is non-positive (no meaningful cost basis to normalize against).\n- `rowHealths` is page-scoped (visible page only).",
        "required": [
          "collateralMint",
          "collateralIdentifier",
          "netPositionTokenAmount",
          "pnlPctChange",
          "aggregate",
          "wAvgHealth",
          "wAvgNetApy",
          "rowHealths"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/LoansAggregate",
            "description": "Filter-scoped `LoansAggregate` restricted to this collateral group.\nAll loop-relevant fields populated (both collateral and principal\nsides)."
          },
          "collateralIdentifier": {
            "type": "string",
            "description": "`loan_collateral.asset_identifier` — distinct from `collateralMint`\nfor LP/pool collateral (mint = NFT mint, identifier = pool address).\nOther part of the group key."
          },
          "collateralMint": {
            "type": "string",
            "description": "SPL mint of the collateral asset for every loop in this group.\nPart of the group key."
          },
          "netPositionTokenAmount": {
            "type": "string",
            "description": "Sum of `loan_collateral.amount` across the group's loans, in raw\nbase units of `collateralMint`. No decimals applied — encoded as a\ndecimal string on the wire. The user's \"position size\" in the\ncollateral asset for this group."
          },
          "pnlPctChange": {
            "type": "number",
            "format": "double",
            "description": "All-time PnL as a fraction: `aggregate.pnlUsd / Σ netInflowUsd`,\nwhere net inflow is the borrower's cumulative dollar contribution\n(cached event-time USD from `account_balance_changes`). `0.0` when\nnet inflow is non-positive (no meaningful cost basis)."
          },
          "rowHealths": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiUserLoanRowHealth"
            },
            "description": "Per-loan LTV breakdown (`ltv`, `strategyLtv`, `liquidationThreshold`,\n`healthRatio`) for the loops in this group on the visible page.\nEmpty for groups outside the page."
          },
          "wAvgHealth": {
            "type": "number",
            "format": "double",
            "description": "Weighted-average health *ratio* in \\[0,1\\], matching FE's `calculateLoanHealth().health`.\nWeighting is by the loan's current USD debt-at-risk\n(`collateralUsd − principalUsd − interestAccruedUsd`, floored at 0).\nPage-scoped: only computed for groups on the visible page."
          },
          "wAvgNetApy": {
            "type": "number",
            "format": "double",
            "description": "Weighted-average loop net APY (same formula as FE `calculateNetApyLive`),\nweighted by net capital (`collateralUsd − principalUsd`). Page-scoped."
          }
        }
      },
      "ApiUserStrategiesResponse": {
        "type": "object",
        "description": "Wire response for `POST /user/strategies`.\n\n`groups` carries per-mint roll-ups for the requested page (no per-strategy\nitems). The top-level `aggregate` is filter-scoped (sums every matched\nstrategy across all mints, not just the page) — same semantics as v2's\n`aggregate`. `snapshot_ts` pins all USD pricing to a single oracle read.",
        "required": [
          "groups",
          "pageInfo",
          "aggregate",
          "snapshotTs"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/StrategiesAggregate",
            "description": "Filter-scoped aggregate over every matched strategy across all mints.\nNot page-scoped."
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiUserStrategyGroup"
            },
            "description": "Per-mint groups for the requested page, sorted by\n`aggregate.totalSupplyUsd` in the direction set by `sortDirection`."
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo",
            "description": "Pagination envelope. `totalItems` is the count of *distinct principal\nmints* in the filter scope (not strategies)."
          },
          "snapshotTs": {
            "type": "integer",
            "format": "int64",
            "description": "Snapshot timestamp in **milliseconds** since the epoch. Pins the\noracle prices used to derive every USD field in the response."
          }
        }
      },
      "ApiUserStrategyGroup": {
        "type": "object",
        "description": "One principal-mint group on the response. The aggregate is scoped to this\nmint only — `aggregate.count` is the strategy count for the group.\n`*Native` fields are raw base units (no decimals applied) summed across\nevery strategy in the group, so callers can render token totals without\ngoing through the USD pricing snapshot.",
        "required": [
          "principalMint",
          "principalDeployedNative",
          "strategyBalanceNative",
          "totalSupplyNative",
          "aggregate"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/StrategiesAggregate",
            "description": "Per-group `StrategiesAggregate`: count, USD totals, lifetime interest,\nweighted APY, expected 24h interest — all scoped to this mint."
          },
          "principalDeployedNative": {
            "type": "integer",
            "format": "int64",
            "description": "Sum of `principal_deployed` (live ledger principal) across the group\nin raw base units of `principalMint`. Encoded as a decimal string.",
            "minimum": 0
          },
          "principalMint": {
            "type": "string",
            "description": "SPL mint of the principal token every strategy in this group lends\n(e.g. USDC mint). The group key."
          },
          "strategyBalanceNative": {
            "type": "integer",
            "format": "int64",
            "description": "Idle principal across the group — `token_balance` (sitting in the\nstrategy's token account) plus `external_yield_balance` (parked in\nexternal yield vaults like Kamino). Raw base units of `principalMint`.\nEncoded as a decimal string.",
            "minimum": 0
          },
          "totalSupplyNative": {
            "type": "integer",
            "format": "int64",
            "description": "`principalDeployedNative + strategyBalanceNative` — total principal\nthe user has supplied to this mint across the group, regardless of\nwhere it currently sits. Raw base units; decimal string on the wire.",
            "minimum": 0
          }
        }
      },
      "ApiUserVaultGroup": {
        "type": "object",
        "description": "One principal-mint group. `aggregate` is scoped to deposits in this mint\nonly — `aggregate.count` is the number of (vault, user) rows in the\ngroup. `*ValueNative` fields are raw base units (no decimals applied) in\nthe principal mint, summed across every vault the user holds in that\nmint — coherent because every row in the group shares one set of\ndecimals.",
        "required": [
          "principalMint",
          "totalValueNative",
          "availableValueNative",
          "collateralValueNative",
          "aggregate"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/VaultDepositsAggregate",
            "description": "Per-group `VaultDepositsAggregate`: count, USD totals, weighted APYs,\nexpected 24h interest, and lifetime PnL — all scoped to this mint."
          },
          "availableValueNative": {
            "type": "integer",
            "format": "int64",
            "description": "Subset of `totalValueNative` that is unlocked (staked, not pledged as\nloan collateral). Native base units. Encoded as a decimal string.",
            "minimum": 0
          },
          "collateralValueNative": {
            "type": "integer",
            "format": "int64",
            "description": "Subset of `totalValueNative` currently pledged as loan collateral\n(vault LP held in `loan_collateral` rows). Native base units.\nEncoded as a decimal string.",
            "minimum": 0
          },
          "principalMint": {
            "type": "string",
            "description": "SPL mint of the principal token that every vault in this group\ndenominates deposits in (e.g. USDC mint). The group key."
          },
          "totalValueNative": {
            "type": "integer",
            "format": "int64",
            "description": "Sum of `position_value_native` across the group's rows — total user\nLP-share value expressed in the principal mint's native base units.\nIncludes both staked (unlocked) and collateralized LP. Encoded as a\ndecimal string on the wire.",
            "minimum": 0
          }
        }
      },
      "ApiUserVaultsResponse": {
        "type": "object",
        "description": "Wire response for `POST /user/vaults`.\n\n`groups` carries per-mint roll-ups for the requested page (no per-row\nitems). The top-level `aggregate` is filter-scoped across every matched\nrow (same semantics as `POST /lending_vaults/user/v2`). `snapshot_ts` pins\noracle pricing for USD fields.",
        "required": [
          "groups",
          "pageInfo",
          "aggregate",
          "snapshotTs"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/VaultDepositsAggregate",
            "description": "Filter-scoped aggregate over every matched (vault, user) row across\nall mints — same semantics as `POST /lending_vaults/user/v2`'s\ntop-level `aggregate`. Not page-scoped."
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiUserVaultGroup"
            },
            "description": "Per-mint groups for the requested page, sorted by\n`aggregate.totalValueUsd` in the direction set by `sortDirection`."
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo",
            "description": "Pagination envelope. `totalItems` is the count of *distinct principal\nmints* in the filter scope (not vault rows)."
          },
          "snapshotTs": {
            "type": "integer",
            "format": "int64",
            "description": "Snapshot timestamp in **milliseconds** since the epoch. Pins the\noracle prices used to derive every USD field in the response."
          }
        }
      },
      "ApiVaultDepositV2": {
        "type": "object",
        "required": [
          "vaultAddress",
          "userAddress",
          "principalMint",
          "lpMint",
          "totalLpShares",
          "availableLpShares",
          "collateralLpShares",
          "startTime",
          "lastInteractedTime",
          "positionValueUsd",
          "availableValueUsd",
          "collateralValueUsd",
          "deployedValueUsd",
          "pnlUsd",
          "pnlNative",
          "unrealizedPnlUsd",
          "unrealizedPnlNative",
          "baseApy",
          "rewardApy",
          "collateralYieldApy",
          "totalApy"
        ],
        "properties": {
          "availableLpShares": {
            "type": "string"
          },
          "availableValueUsd": {
            "type": "number",
            "format": "double"
          },
          "baseApy": {
            "type": "number",
            "format": "double"
          },
          "collateralLpShares": {
            "type": "string"
          },
          "collateralValueUsd": {
            "type": "number",
            "format": "double"
          },
          "collateralYieldApy": {
            "type": "number",
            "format": "double"
          },
          "deployedValueUsd": {
            "type": "number",
            "format": "double"
          },
          "lastInteractedTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lpMint": {
            "type": "string"
          },
          "pnlNative": {
            "type": "number",
            "format": "double"
          },
          "pnlUsd": {
            "type": "number",
            "format": "double"
          },
          "positionValueUsd": {
            "type": "number",
            "format": "double"
          },
          "principalMint": {
            "type": "string"
          },
          "rewardApy": {
            "type": "number",
            "format": "double"
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "totalApy": {
            "type": "number",
            "format": "double"
          },
          "totalLpShares": {
            "type": "string"
          },
          "unrealizedPnlNative": {
            "type": "number",
            "format": "double"
          },
          "unrealizedPnlUsd": {
            "type": "number",
            "format": "double"
          },
          "userAddress": {
            "type": "string"
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "ApiVaultDepositV2Response": {
        "type": "object",
        "required": [
          "items",
          "pageInfo",
          "aggregate",
          "aggregatesByMint",
          "snapshotTs"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/VaultDepositsAggregate"
          },
          "aggregatesByMint": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VaultDepositsMintAggregate"
            },
            "description": "Per-principal-mint rollup over the user's full position set."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiVaultDepositV2"
            }
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "snapshotTs": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AssetDataInfo": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "Spl"
            ],
            "properties": {
              "Spl": {
                "$ref": "#/components/schemas/SplData"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "StakedSol"
            ],
            "properties": {
              "StakedSol": {
                "$ref": "#/components/schemas/StakedSolData"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "Orca"
            ],
            "properties": {
              "Orca": {
                "$ref": "#/components/schemas/OrcaPositionData"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "Meteora"
            ],
            "properties": {
              "Meteora": {
                "$ref": "#/components/schemas/MeteoraDlmmPositionData"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "Raydium"
            ],
            "properties": {
              "Raydium": {
                "$ref": "#/components/schemas/RaydiumPositionData"
              }
            }
          }
        ],
        "description": "Collateral asset identification, tagged by collateral kind (SPL token,\nstaked SOL, or a CLMM LP position on Orca / Meteora / Raydium)."
      },
      "AssetTerms": {
        "type": "object",
        "required": [
          "durationAndApys",
          "allocationInfo"
        ],
        "properties": {
          "allocationInfo": {
            "$ref": "#/components/schemas/ParsedCollateralCaps"
          },
          "durationAndApys": {
            "type": "array",
            "items": {},
            "description": "Positional `[duration, apy]` pairs — a heterogeneous 2-tuple array, so it's\ntyped as an array of JSON values rather than a named element type."
          }
        }
      },
      "BalanceResponse": {
        "type": "object",
        "description": "A historical token-balance sample: mint, balance (native units), and unix timestamp.",
        "required": [
          "mint",
          "balance",
          "timestamp"
        ],
        "properties": {
          "balance": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "mint": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "BasePortfolioReward": {
        "type": "object",
        "required": [
          "rewardId",
          "reward",
          "pointsPerSecond",
          "accruedTimeStamp",
          "lastUpdateValue",
          "usdValue",
          "isActive",
          "isLenderReward",
          "multiplier"
        ],
        "properties": {
          "accruedTimeStamp": {
            "type": "integer",
            "format": "int64"
          },
          "endTime": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "isActive": {
            "type": "boolean"
          },
          "isLenderReward": {
            "type": "boolean"
          },
          "lastUpdateValue": {
            "type": "number",
            "format": "double"
          },
          "multiplier": {
            "type": "number",
            "format": "double"
          },
          "pointsPerSecond": {
            "type": "number",
            "format": "double"
          },
          "reward": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "rewardId": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "usdValue": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "BestLoopQuoteQuery": {
        "type": "object",
        "required": [
          "principalMint",
          "collateralInfo",
          "leverageMultiplier",
          "duration"
        ],
        "properties": {
          "collateralInfo": {
            "$ref": "#/components/schemas/QuoteCollateralInfo",
            "description": "`amount` must be > 0; a set `priceOverride` must be finite, > 0, and <= 1e12."
          },
          "duration": {
            "$ref": "#/components/schemas/StrategyDuration"
          },
          "excludedExternalYield": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "leverageMultiplier": {
            "type": "number",
            "format": "double",
            "description": "Must be finite, > 1, and <= 100; out-of-range values are rejected with 400."
          },
          "principalMint": {
            "type": "string"
          }
        }
      },
      "BestLoopQuoteResponse": {
        "type": "object",
        "required": [
          "bestQuote",
          "netApyPct"
        ],
        "properties": {
          "bestQuote": {
            "$ref": "#/components/schemas/BestQuote"
          },
          "netApyPct": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "BestQuote": {
        "type": "object",
        "required": [
          "duration",
          "durationType",
          "apy",
          "lendingStrategyAddress",
          "marketInformation",
          "principalAvailable",
          "ltv",
          "liquidationThreshold"
        ],
        "properties": {
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "durationType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "isVerifiedVaultStrategy": {
            "type": "boolean"
          },
          "lendingStrategyAddress": {
            "type": "string"
          },
          "liquidationThreshold": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "marketInformation": {
            "type": "string"
          },
          "principalAvailable": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "BestQuoteFilter": {
        "type": "object",
        "required": [
          "collateralToInfo",
          "principalMint",
          "durations",
          "minPrincipalAmount"
        ],
        "properties": {
          "collateralToInfo": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/QuoteCollateralInfo"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "durations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StrategyDuration"
            }
          },
          "excludedExternalYield": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "loanAddress": {
            "type": [
              "string",
              "null"
            ],
            "description": "When set, raises `min_lqt` to the loan's stored floor so sub-floor\nstrategies aren't surfaced. Omit to skip the lookup."
          },
          "minPrincipalAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "refinanceParams": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RefinanceParams"
              }
            ]
          },
          "showSelf": {
            "type": "boolean"
          }
        }
      },
      "BestSellQuote": {
        "type": "object",
        "required": [
          "duration",
          "durationType",
          "apy",
          "principalAvailable",
          "ltv",
          "liquidationThreshold",
          "lendingStrategyAddress"
        ],
        "properties": {
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "durationType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lendingStrategyAddress": {
            "type": "string"
          },
          "liquidationThreshold": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "minPrice": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "principalAvailable": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "BorrowCap": {
        "type": "object",
        "required": [
          "principalMint",
          "perLoan",
          "global"
        ],
        "properties": {
          "global": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "perLoan": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          }
        }
      },
      "BorrowPrincipalParamsSchema": {
        "type": "object",
        "description": "Params for borrowing principal against an existing loan (`borrow_principal`).",
        "required": [
          "amount",
          "assetIndexGuidance",
          "duration",
          "expectedLoanValues",
          "skipSolUnwrap"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Principal amount to borrow, in the principal mint's native units.",
            "minimum": 0
          },
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral oracle asset-index guidance."
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "description": "Index into the strategy's offered durations for this ledger.",
            "minimum": 0
          },
          "expectedLoanValues": {
            "$ref": "#/components/schemas/ExpectedLoanValuesSchema"
          },
          "skipSolUnwrap": {
            "type": "boolean",
            "description": "When true, keep borrowed SOL wrapped instead of unwrapping to native SOL."
          }
        }
      },
      "BorrowPrincipalRequested": {
        "type": "object",
        "required": [
          "ledgerIndex",
          "principalAmount",
          "principalMint",
          "strategy",
          "durationIndex",
          "expectedLoanValues"
        ],
        "properties": {
          "durationIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "expectedLoanValues": {
            "$ref": "#/components/schemas/ExpectedLoanValuesSchema"
          },
          "ledgerIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "principalAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "strategy": {
            "type": "string"
          }
        }
      },
      "ChartDataMarker": {
        "type": "object",
        "description": "Chart annotation: timestamp + marker kind + optional payload (not nested on series rows).",
        "required": [
          "date",
          "type"
        ],
        "properties": {
          "date": {
            "type": "integer",
            "format": "int64"
          },
          "metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ChartMarkerMetadata"
              }
            ]
          },
          "type": {
            "$ref": "#/components/schemas/ChartMarkerType"
          }
        }
      },
      "ChartMarkerMetadata": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ChartMarkerMetadataRollover"
          }
        ],
        "description": "Marker payload union (untagged so we don't duplicate the top-level `type` discriminator)."
      },
      "ChartMarkerMetadataRollover": {
        "type": "object",
        "description": "Optional payload for chart markers (payload only; marker kind lives on `ChartDataMarker.type`).",
        "required": [
          "previousCollateralMint",
          "newCollateralMint"
        ],
        "properties": {
          "newCollateralMint": {
            "type": "string"
          },
          "previousCollateralMint": {
            "type": "string"
          }
        }
      },
      "ChartMarkerType": {
        "type": "string",
        "description": "Marker type for charts.",
        "enum": [
          "rollover"
        ]
      },
      "ClaimAllVaultRewardsParams": {
        "type": "object",
        "required": [
          "vaultAddress",
          "rewardMints"
        ],
        "properties": {
          "rewardMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "ClaimAllVaultRewardsReturn": {
        "type": "object",
        "required": [
          "failedUserClaims"
        ],
        "properties": {
          "failedUserClaims": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ClaimLendVaultFeeQueryParams": {
        "type": "object",
        "required": [
          "lendVaultAddress"
        ],
        "properties": {
          "lendVaultAddress": {
            "type": "string"
          }
        }
      },
      "ClaimLendVaultRewardsParams": {
        "type": "object",
        "required": [
          "vaultAddress"
        ],
        "properties": {
          "rewardMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unclaimedStakeAccounts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "ClosedLedgerSummary": {
        "type": "object",
        "description": "Snapshotted view of a closed loan's lifetime, computed once on close by\nwalking the loan's events. See `migrations/2026-05-06-000001_closed_ledger_summary`.",
        "required": [
          "loanAddress",
          "principal",
          "collateral",
          "avgLtv",
          "avgLqt",
          "startTime",
          "endTime"
        ],
        "properties": {
          "avgLqt": {
            "type": "number",
            "format": "double",
            "description": "Loan-level lifetime-averaged liquidation threshold, same construction\nas `avg_ltv`."
          },
          "avgLtv": {
            "type": "number",
            "format": "double",
            "description": "Loan-level lifetime-averaged LTV — outstanding+time-weighted across\nevery ledger that ever had debt. Fractional (0.85 = 85%). 0.0 when\nthe loan never had matrix data alongside outstanding debt."
          },
          "collateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClosedLedgerSummaryCollateral"
            }
          },
          "endTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "loanAddress": {
            "type": "string"
          },
          "principal": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClosedLedgerSummaryPrincipal"
            }
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ClosedLedgerSummaryCollateral": {
        "type": "object",
        "required": [
          "collateral",
          "avgBalance",
          "avgBalanceUsd"
        ],
        "properties": {
          "avgBalance": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "avgBalanceUsd": {
            "type": "number",
            "format": "double"
          },
          "collateral": {
            "type": "string"
          }
        }
      },
      "ClosedLedgerSummaryPrincipal": {
        "type": "object",
        "required": [
          "principal",
          "avgBalance",
          "avgBalanceUsd",
          "avgApy"
        ],
        "properties": {
          "avgApy": {
            "type": "number",
            "format": "double"
          },
          "avgBalance": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "avgBalanceUsd": {
            "type": "number",
            "format": "double"
          },
          "principal": {
            "type": "string"
          }
        }
      },
      "CollateralAllocationUpdateArgs": {
        "type": "object",
        "required": [
          "assetIdentifier",
          "maxAllocationPct"
        ],
        "properties": {
          "assetIdentifier": {
            "type": "string"
          },
          "maxAllocationPct": {
            "type": "string"
          }
        }
      },
      "CollateralBreakdown": {
        "type": "object",
        "required": [
          "assetIdentifier",
          "usd"
        ],
        "properties": {
          "assetIdentifier": {
            "type": "string"
          },
          "usd": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "CollateralFilter": {
        "type": "object",
        "required": [
          "amount",
          "assetData"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "assetData": {
            "$ref": "#/components/schemas/AssetDataInfo"
          },
          "priceOverride": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "CollateralHolderStats": {
        "type": "object",
        "description": "Active-holder summary for one collateral mint: total deposits plus a\nper-holder (wallet → amount) breakdown.",
        "required": [
          "collateralMint",
          "totalDeposits",
          "userDeposits"
        ],
        "properties": {
          "collateralMint": {
            "type": "string"
          },
          "totalDeposits": {
            "type": "number",
            "format": "double"
          },
          "userDeposits": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "CollateralParamsUpdateArgs": {
        "type": "object",
        "properties": {
          "apyUpdate": {
            "type": [
              "object",
              "null"
            ],
            "description": "Request map of serialized-duration → apy, both as strings.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "ltvUpdate": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ParsedUpdateAssetDataParams",
                "description": "Parsed asset-data params."
              }
            ]
          }
        }
      },
      "CollateralTermsIndicesSchema": {
        "type": "object",
        "description": "A single (collateral, duration) slot the strategy offers terms for.",
        "required": [
          "collateralIndex",
          "durationIndex"
        ],
        "properties": {
          "collateralIndex": {
            "type": "integer",
            "format": "int32",
            "description": "Index into the market's collateral map.",
            "minimum": 0
          },
          "durationIndex": {
            "type": "integer",
            "format": "int32",
            "description": "Index into the strategy's offered durations.",
            "minimum": 0
          }
        }
      },
      "CollateralYieldHistory": {
        "type": "object",
        "required": [
          "id",
          "collateralMint",
          "apy",
          "timestamp"
        ],
        "properties": {
          "apy": {
            "type": "number",
            "format": "double"
          },
          "collateralMint": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CollateralYieldRangeQuery": {
        "type": "object",
        "required": [
          "collateralMints",
          "startTime",
          "endTime"
        ],
        "properties": {
          "collateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "endTime": {
            "type": "integer",
            "format": "int64"
          },
          "startTime": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CreateLoanReturn": {
        "type": "object",
        "required": [
          "transaction",
          "loanAddress"
        ],
        "properties": {
          "loanAddress": {
            "type": "string"
          },
          "transaction": {
            "$ref": "#/components/schemas/VersionedTransactionReturn"
          }
        }
      },
      "CreateRewardsScheduleTxnParams": {
        "type": "object",
        "required": [
          "vaultAddress",
          "amountToDeposit",
          "rewardMint",
          "rewardStartTime",
          "rewardEndTime",
          "durationStakeWeights"
        ],
        "properties": {
          "amountToDeposit": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "durationStakeWeights": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "rewardEndTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "rewardMint": {
            "type": "string"
          },
          "rewardStartTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "DepositCollateralInput": {
        "type": "object",
        "required": [
          "collateralAmount",
          "collateralAssetData"
        ],
        "properties": {
          "collateralAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "collateralAssetData": {
            "$ref": "#/components/schemas/AssetDataInfo"
          },
          "loanCreationParams": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LoanCreationParams"
              }
            ]
          },
          "weightMatrixUpdate": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        }
      },
      "DurationToWAvgBorrowApy": {
        "type": "object",
        "required": [
          "duration",
          "durationType",
          "wAvgApy",
          "principalDue"
        ],
        "properties": {
          "duration": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "durationType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "principalDue": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "wAvgApy": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "EarnAcknowledgeResponse": {
        "type": "object",
        "description": "Response for `POST /earn/vaults/acknowledge`.",
        "required": [
          "acknowledged"
        ],
        "properties": {
          "acknowledged": {
            "type": "boolean"
          }
        }
      },
      "EarnChartCostPoint": {
        "type": "object",
        "description": "A step on the user's avg cost-per-share line. `is_anchor` marks the synthetic\nwindow-start (carry-in) and \"now\" points that make the line span the full window.\nA `cost_per_share_e18` of \"0\" marks a closed position (no shares) — the FE breaks the\ncost line and hides PnL there. `event_kind`/`assets_delta` describe the underlying\nposition event for non-anchor points (used to label activity markers); None for anchors.",
        "required": [
          "timestamp",
          "costPerShareE18",
          "isAnchor",
          "shareBalance"
        ],
        "properties": {
          "assetsDelta": {
            "type": [
              "string",
              "null"
            ]
          },
          "costPerShareE18": {
            "type": "string"
          },
          "eventKind": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "isAnchor": {
            "type": "boolean"
          },
          "shareBalance": {
            "type": "string",
            "description": "Share balance in effect at this point, so the FE can value unrealized PnL in $."
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "EarnChartNavPoint": {
        "type": "object",
        "description": "A point on the vault NAV-per-share line of the position chart.",
        "required": [
          "timestamp",
          "navPerShareE18"
        ],
        "properties": {
          "navPerShareE18": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "EarnPortfolioEventRow": {
        "type": "object",
        "required": [
          "id",
          "earnVaultAddress",
          "userWallet",
          "eventKind",
          "txSignature",
          "blockSlot",
          "blockTs",
          "sharesDelta",
          "assetsDelta",
          "feesAssets",
          "navPerShareE18AtEvent",
          "costBasisAfter",
          "realizedPnlDelta"
        ],
        "properties": {
          "assetsDelta": {
            "type": "string"
          },
          "blockSlot": {
            "type": "string"
          },
          "blockTs": {
            "type": "string"
          },
          "costBasisAfter": {
            "type": "string"
          },
          "earnVaultAddress": {
            "type": "string"
          },
          "eventKind": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "feesAssets": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "navPerShareE18AtEvent": {
            "type": "string"
          },
          "realizedPnlDelta": {
            "type": "string"
          },
          "sharesDelta": {
            "type": "string"
          },
          "txSignature": {
            "type": "string"
          },
          "userWallet": {
            "type": "string"
          }
        }
      },
      "EarnPortfolioEventsRequest": {
        "type": "object",
        "required": [
          "wallet"
        ],
        "properties": {
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "offset": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "vaultAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "wallet": {
            "type": "string"
          }
        }
      },
      "EarnPortfolioSummaryPosition": {
        "type": "object",
        "description": "Per-deposit-mint rollup of a user's earn positions. Asset amounts are in the\ndeposit mint's native units; `apy_bps` is the position-value-weighted blend of\neach vault's realized return (7d, falling back to 24h then 30d) plus rewards APY.",
        "required": [
          "depositMint",
          "vaultAddresses",
          "positionValueAssets",
          "positionValueUsd",
          "costBasisAssets",
          "unrealizedPnlAssets",
          "realizedPnlAssets"
        ],
        "properties": {
          "apyBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "costBasisAssets": {
            "type": "string"
          },
          "depositMint": {
            "type": "string"
          },
          "positionValueAssets": {
            "type": "string"
          },
          "positionValueUsd": {
            "type": "number",
            "format": "double"
          },
          "realizedPnlAssets": {
            "type": "string"
          },
          "unrealizedPnlAssets": {
            "type": "string"
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "EarnPositionChartRequest": {
        "type": "object",
        "required": [
          "address",
          "wallet",
          "timeLookback"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "sampleIntervalSecs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Sampling interval for the NAV series only; the cost step series is never sampled.",
            "minimum": 0
          },
          "timeLookback": {
            "type": "integer",
            "format": "int64"
          },
          "wallet": {
            "type": "string"
          }
        }
      },
      "EarnPositionChartResponse": {
        "type": "object",
        "description": "Position-vs-NAV chart payload: the vault NAV line and the user's avg cost-per-share\nstep line on one e18 axis. The gap between them at any time is unrealized PnL per share.",
        "required": [
          "navSeries",
          "costSeries"
        ],
        "properties": {
          "costSeries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EarnChartCostPoint"
            }
          },
          "navSeries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EarnChartNavPoint"
            }
          }
        }
      },
      "EarnPositionHistoryPoint": {
        "type": "object",
        "required": [
          "timestamp",
          "blockSlot",
          "txSignature",
          "eventKind",
          "sharesDelta",
          "assetsDelta",
          "shareBalance",
          "positionAssets",
          "navPerShareE18",
          "costBasisAssets",
          "realizedPnlAssets",
          "feesAssets"
        ],
        "properties": {
          "assetsDelta": {
            "type": "string"
          },
          "blockSlot": {
            "type": "string"
          },
          "costBasisAssets": {
            "type": "string"
          },
          "eventKind": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "feesAssets": {
            "type": "string"
          },
          "navPerShareE18": {
            "type": "string"
          },
          "positionAssets": {
            "type": "string"
          },
          "realizedPnlAssets": {
            "type": "string"
          },
          "shareBalance": {
            "type": "string"
          },
          "sharesDelta": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          },
          "txSignature": {
            "type": "string"
          }
        }
      },
      "EarnPositionHistoryRequest": {
        "type": "object",
        "required": [
          "address",
          "wallet",
          "timeLookback"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "sampleIntervalSecs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "timeLookback": {
            "type": "integer",
            "format": "int64"
          },
          "wallet": {
            "type": "string"
          }
        }
      },
      "EarnQueueRequest": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "includeClosed": {
            "type": "boolean"
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "sortDirection": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Sort direction: `0` = ascending, `1` = descending.",
            "minimum": 0
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "wallet": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EarnQueueResponse": {
        "type": "object",
        "required": [
          "openRequests",
          "pageInfo",
          "depthShares",
          "fulfilledUnclaimedShares"
        ],
        "properties": {
          "depthShares": {
            "type": "string"
          },
          "fulfilledUnclaimedShares": {
            "type": "string"
          },
          "openRequests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EarnWithdrawalRequest"
            },
            "description": "Open withdrawal requests in the vault's queue."
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "EarnStats": {
        "type": "object",
        "required": [
          "tvlUsd"
        ],
        "properties": {
          "tvlUsd": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "EarnUserPosition": {
        "type": "object",
        "description": "Materialized Earn user position cache.",
        "required": [
          "earnVaultAddress",
          "userWallet",
          "shareBalance",
          "costBasisAssets",
          "realizedPnlAssets",
          "feesPaidAssets",
          "lastSyncedSlot"
        ],
        "properties": {
          "acknowledgedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "risk acknowledgment timestamp"
          },
          "costBasisAssets": {
            "type": "string",
            "description": "current cost basis in deposit-asset units"
          },
          "earnVaultAddress": {
            "type": "string",
            "description": "vault address"
          },
          "feesPaidAssets": {
            "type": "string",
            "description": "lifetime fees paid in deposit-asset units"
          },
          "lastSyncedSlot": {
            "type": "string",
            "description": "latest synchronized slot"
          },
          "realizedPnlAssets": {
            "type": "string",
            "description": "lifetime realized PnL in deposit-asset units"
          },
          "shareBalance": {
            "type": "string",
            "description": "current share balance"
          },
          "userWallet": {
            "type": "string",
            "description": "user wallet"
          }
        }
      },
      "EarnVault": {
        "type": "object",
        "description": "Earn managed vault metadata plus cached parsed provider state.",
        "required": [
          "address",
          "providerKind",
          "shareMint",
          "acceptedAssetMint",
          "managerAuthority",
          "metadataJson",
          "status",
          "queueEnabled",
          "instantEnabled",
          "cancelEnabled",
          "requiresAcknowledgment",
          "parsedAccountJson",
          "createdAt"
        ],
        "properties": {
          "acceptedAssetMint": {
            "type": "string",
            "description": "accepted deposit asset mint"
          },
          "address": {
            "type": "string",
            "description": "on-chain vault address"
          },
          "cancelEnabled": {
            "type": "boolean",
            "description": "user cancellation supported"
          },
          "createdAt": {
            "type": "string",
            "description": "row creation timestamp"
          },
          "instantEnabled": {
            "type": "boolean",
            "description": "instant withdrawals supported"
          },
          "lastUpdatedSlot": {
            "type": [
              "string",
              "null"
            ],
            "description": "latest applied slot"
          },
          "lastUpdatedTs": {
            "type": [
              "string",
              "null"
            ],
            "description": "latest applied timestamp"
          },
          "managerAuthority": {
            "type": "string",
            "description": "curator or manager authority"
          },
          "metadataJson": {
            "type": "object",
            "description": "off-chain display/product metadata",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "parsedAccountJson": {
            "type": "object",
            "description": "cached ParsedEarnVault JSON",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "providerKind": {
            "type": "integer",
            "format": "int32",
            "description": "provider enum discriminant",
            "minimum": 0
          },
          "queueEnabled": {
            "type": "boolean",
            "description": "queued withdrawals supported"
          },
          "requiresAcknowledgment": {
            "type": "boolean",
            "description": "deposit flow acknowledgment required"
          },
          "shareMint": {
            "type": "string",
            "description": "provider share mint"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "vault status enum discriminant",
            "minimum": 0
          }
        }
      },
      "EarnVaultActivityItem": {
        "type": "object",
        "required": [
          "id",
          "timestamp",
          "earnVaultAddress",
          "userWallet",
          "eventKind",
          "status",
          "feesAssets"
        ],
        "properties": {
          "assets": {
            "type": [
              "string",
              "null"
            ]
          },
          "earnVaultAddress": {
            "type": "string"
          },
          "eventKind": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "feesAssets": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "navPerShareE18": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "shares": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          },
          "txSignature": {
            "type": [
              "string",
              "null"
            ]
          },
          "userWallet": {
            "type": "string"
          }
        }
      },
      "EarnVaultActivityRequest": {
        "type": "object",
        "required": [
          "address"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "sortDirection": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Sort direction: `0` = ascending, `1` = descending.",
            "minimum": 0
          },
          "wallet": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EarnVaultActivityResponse": {
        "type": "object",
        "required": [
          "items",
          "pageInfo"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EarnVaultActivityItem"
            }
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "EarnVaultHistoryPoint": {
        "type": "object",
        "required": [
          "timestamp",
          "snapshotSlot",
          "shareSupply",
          "navPerShareE18",
          "totalAumAssets",
          "pendingWithdrawalsAssets"
        ],
        "properties": {
          "displayApyBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Forward-looking headline vault APY, mirrored from the snapshot. Signed\nbasis points; `null` when coverage is insufficient at that snapshot."
          },
          "leverageX100": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "navPerShareE18": {
            "type": "string"
          },
          "pendingWithdrawalsAssets": {
            "type": "string"
          },
          "realizedApyBps24h": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "DEPRECATED — use `realizedReturnBps24h`."
          },
          "realizedApyBps30d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "DEPRECATED — use `realizedReturnBps30d`. Mirrored for one release cycle."
          },
          "realizedApyBps7d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "DEPRECATED — use `realizedReturnBps7d`."
          },
          "realizedReturnBps24h": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Backward-looking NAV-delta return over the trailing 24h, in basis points."
          },
          "realizedReturnBps30d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Backward-looking NAV-delta return over the trailing 30d, in basis points."
          },
          "realizedReturnBps7d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Backward-looking NAV-delta return over the trailing 7d, in basis points."
          },
          "rewardsApyBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "shareSupply": {
            "type": "string"
          },
          "snapshotSlot": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          },
          "totalAumAssets": {
            "type": "string"
          },
          "utilizationBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "EarnVaultHistoryRequest": {
        "type": "object",
        "required": [
          "address",
          "timeLookback"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "sampleIntervalSecs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "timeLookback": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "EarnVaultPosition": {
        "type": "object",
        "description": "Materialized Earn vault strategy position cache.",
        "required": [
          "earnVaultAddress",
          "positionIndex",
          "positionType",
          "typeLabel",
          "aumBase",
          "aumUsd",
          "shareOfAum",
          "exposuresJson",
          "updatedAt"
        ],
        "properties": {
          "aumBase": {
            "type": "integer",
            "format": "int64",
            "description": "position AUM in vault-underlying base units",
            "minimum": 0
          },
          "aumUsd": {
            "type": "number",
            "format": "double",
            "description": "position AUM in USD"
          },
          "earnVaultAddress": {
            "type": "string",
            "description": "earn vault address"
          },
          "exposuresJson": {
            "type": "array",
            "items": {},
            "description": "per-mint exposure list for compound positions"
          },
          "lastUpdatedSlot": {
            "type": [
              "string",
              "null"
            ],
            "description": "slot of the vault account snapshot this row came from"
          },
          "mint": {
            "type": [
              "string",
              "null"
            ],
            "description": "primary mint reported by position AUM calculation"
          },
          "positionIndex": {
            "type": "integer",
            "format": "int32",
            "description": "provider-local output index from position AUM calculation",
            "minimum": 0
          },
          "positionType": {
            "type": "string",
            "description": "provider position type"
          },
          "rawPositionJson": {
            "type": [
              "object",
              "null"
            ],
            "description": "raw provider strategy position when index mapping is available",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "shareOfAum": {
            "type": "number",
            "format": "double",
            "description": "position share of vault AUM as decimal ratio"
          },
          "symbol": {
            "type": [
              "string",
              "null"
            ],
            "description": "token symbol for mint"
          },
          "typeLabel": {
            "type": "string",
            "description": "display label for the position type"
          },
          "updatedAt": {
            "type": "string",
            "description": "row update timestamp"
          }
        }
      },
      "EarnVaultPositionDisplayApyItem": {
        "type": "object",
        "description": "One row per logical leg of a vault position, joined to `position_display_apy`\nby the handler-derived `position_id`. Kamino obligations fan out into a\nlend and a borrow leg, each with its own row; the borrow leg carries the\nnegated `display_apy_bps` (storage is canonical lender-side, sign flips on\nread).",
        "required": [
          "positionIndex",
          "positionType",
          "typeLabel",
          "aumBase",
          "aumUsd",
          "shareOfAum",
          "positionId"
        ],
        "properties": {
          "aumBase": {
            "type": "string",
            "description": "Position AUM in vault-underlying base units. Unchanged when the position\nfans out into multiple legs — legs are distinguished by `positionId`."
          },
          "aumUsd": {
            "type": "number",
            "format": "double",
            "description": "Position AUM in USD."
          },
          "displayApyBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Display APY in signed basis points. `null` when no\n`position_display_apy` row exists yet. Borrow legs are negated relative\nto the stored canonical (lender-side) value."
          },
          "displayApySource": {
            "type": [
              "string",
              "null"
            ],
            "description": "Source label copied from `position_display_apy.source`; `null` when the\nAPY row is absent."
          },
          "mint": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary mint of the underlying position (unchanged from the position row)."
          },
          "positionId": {
            "type": "string",
            "description": "Handler-derived canonical position id (`token:<mint>`,\n`kam_reserve:<addr>:lend`, etc.). Two legs of the same underlying\nposition row are disambiguated here."
          },
          "positionIndex": {
            "type": "integer",
            "format": "int32",
            "description": "Vault-local position index the leg was extracted from.",
            "minimum": 0
          },
          "positionType": {
            "type": "string",
            "description": "Provider position type (e.g. `tokenAccount`, `kaminoObligation`)."
          },
          "shareOfAum": {
            "type": "number",
            "format": "double",
            "description": "Position share of vault AUM as a decimal ratio."
          },
          "symbol": {
            "type": [
              "string",
              "null"
            ],
            "description": "Token symbol for `mint`, if resolved."
          },
          "typeLabel": {
            "type": "string",
            "description": "Display label from the underlying position row."
          }
        }
      },
      "EarnVaultPositionDisplayApyResponse": {
        "type": "object",
        "description": "Response for `GET /earn/vaults/:address/positions`.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EarnVaultPositionDisplayApyItem"
            },
            "description": "One row per logical leg. Ordered by `positionIndex` ascending, then\n`positionId` ascending for deterministic pagination-free reads."
          }
        }
      },
      "EarnVaultPositionResponse": {
        "type": "object",
        "required": [
          "vault",
          "openWithdrawalRequests"
        ],
        "properties": {
          "openWithdrawalRequests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EarnWithdrawalRequest"
            },
            "description": "Open withdrawal requests for this user + vault."
          },
          "position": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EarnUserPosition",
                "description": "User's earn position (share balance, cost basis, realized PnL)."
              }
            ]
          },
          "vault": {
            "$ref": "#/components/schemas/EarnVaultWithLatestSnapshot"
          }
        }
      },
      "EarnVaultPositionsRequest": {
        "type": "object",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "mint": {
            "type": [
              "string",
              "null"
            ]
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "positionType": {
            "type": [
              "string",
              "null"
            ]
          },
          "sortDirection": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Sort direction: `0` = ascending, `1` = descending.",
            "minimum": 0
          }
        }
      },
      "EarnVaultPositionsResponse": {
        "type": "object",
        "required": [
          "items",
          "pageInfo"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StrategyPositionItem"
            },
            "description": "Vault strategy positions (per-position AUM breakdown)."
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          }
        }
      },
      "EarnVaultReward": {
        "type": "object",
        "required": [
          "baseReward",
          "earnVaultAddress",
          "acceptedAssetMint",
          "shareBalance",
          "vaultMetadata"
        ],
        "properties": {
          "acceptedAssetMint": {
            "type": "string"
          },
          "baseReward": {
            "$ref": "#/components/schemas/BasePortfolioReward"
          },
          "earnVaultAddress": {
            "type": "string"
          },
          "shareBalance": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vaultMetadata": {
            "type": "object",
            "description": "Off-chain earn-vault metadata (provider-defined key/value object).",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "EarnVaultSnapshotResponse": {
        "type": "object",
        "required": [
          "snapshotSlot",
          "snapshotTs",
          "shareSupply",
          "navPerShareE18",
          "totalAumAssets",
          "pendingWithdrawalsAssets"
        ],
        "properties": {
          "displayApyBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Forward-looking headline vault APY: share-of-AUM-weighted sum of the\nper-position `display_apy_bps` rows this vault holds. Signed, in basis\npoints. `null` when Display APY coverage is insufficient."
          },
          "leverageX100": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "navPerShareE18": {
            "type": "string"
          },
          "pendingWithdrawalsAssets": {
            "type": "string"
          },
          "realizedApyBps24h": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "DEPRECATED — use `realizedReturnBps24h`."
          },
          "realizedApyBps30d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "DEPRECATED — use `realizedReturnBps30d`. Mirrored for one release cycle\nto give SDK / FE consumers time to migrate; will be removed in a\nfollow-up PR."
          },
          "realizedApyBps7d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "DEPRECATED — use `realizedReturnBps7d`."
          },
          "realizedReturnBps24h": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Backward-looking NAV-delta return over the trailing 24h, in basis points."
          },
          "realizedReturnBps30d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Backward-looking NAV-delta return over the trailing 30d, in basis points.\nDistinct from `display_apy_bps` (forward-looking, from underlyings)."
          },
          "realizedReturnBps7d": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Backward-looking NAV-delta return over the trailing 7d, in basis points."
          },
          "rewardsApyBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          },
          "shareSupply": {
            "type": "string"
          },
          "snapshotSlot": {
            "type": "string"
          },
          "snapshotTs": {
            "type": "string"
          },
          "totalAumAssets": {
            "type": "string"
          },
          "utilizationBps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "EarnVaultWithLatestSnapshot": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EarnVault",
            "description": "Earn vault account (DB projection of the on-chain/provider state)."
          },
          {
            "type": "object",
            "properties": {
              "latestSnapshot": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/EarnVaultSnapshotResponse"
                  }
                ]
              }
            }
          }
        ]
      },
      "EarnWalletRequest": {
        "type": "object",
        "required": [
          "wallet"
        ],
        "properties": {
          "wallet": {
            "type": "string"
          }
        }
      },
      "EarnWalletVaultRequest": {
        "type": "object",
        "required": [
          "address",
          "wallet"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "wallet": {
            "type": "string"
          }
        }
      },
      "EarnWithdrawalRequest": {
        "type": "object",
        "description": "Cached Earn withdrawal-request lifecycle state.",
        "required": [
          "onChainRequestAddr",
          "earnVaultAddress",
          "userWallet",
          "sharesRequested",
          "sharesFilled",
          "sharesClaimed",
          "requestedAt",
          "status"
        ],
        "properties": {
          "cancelledAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "cancellation timestamp"
          },
          "earnVaultAddress": {
            "type": "string",
            "description": "vault address"
          },
          "fulfilledAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "full-fill timestamp"
          },
          "onChainRequestAddr": {
            "type": "string",
            "description": "withdrawal request PDA"
          },
          "requestedAt": {
            "type": "string",
            "description": "request creation timestamp"
          },
          "sharesClaimed": {
            "type": "string",
            "description": "claimed shares"
          },
          "sharesFilled": {
            "type": "string",
            "description": "filled shares"
          },
          "sharesRequested": {
            "type": "string",
            "description": "requested shares"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "request status enum discriminant",
            "minimum": 0
          },
          "userWallet": {
            "type": "string",
            "description": "user wallet"
          }
        }
      },
      "EcosystemStats": {
        "type": "object",
        "required": [
          "partnerCount"
        ],
        "properties": {
          "partnerCount": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "EditLendVaultDepositsQueryParams": {
        "type": "object",
        "required": [
          "lendVaultAddress",
          "depositsEnabled"
        ],
        "properties": {
          "depositsEnabled": {
            "type": "boolean"
          },
          "lendVaultAddress": {
            "type": "string"
          }
        }
      },
      "EditStrategySettingsArgs": {
        "type": "object",
        "properties": {
          "externalYieldSource": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalYieldSourceParams"
              }
            ]
          },
          "interestFee": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "liquidityBuffer": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "originationCap": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "originationFee": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "originationsEnabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "principalFee": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "EditVaultArgs": {
        "type": "object",
        "required": [
          "maxEarlyUnstakeFeeCbps"
        ],
        "properties": {
          "maxEarlyUnstakeFeeCbps": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ErrorDetails": {
        "type": "object",
        "description": "Inner detail of the [`ErrorResponse`] envelope.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "description": "HTTP status code, mirrored in the response status line",
            "example": 400,
            "minimum": 0
          },
          "message": {
            "type": "string",
            "description": "human-readable, client-safe message (sensitive data redacted)",
            "example": "Request could not be processed."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "description": "Canonical error envelope for every endpoint. The `x-request-id` response\nheader carries the correlation id for the failing request.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetails",
            "description": "error detail"
          }
        }
      },
      "EstimatedRefinanceInfo": {
        "type": "object",
        "required": [
          "collateralMint",
          "ltv",
          "liquidationThreshold"
        ],
        "properties": {
          "collateralMint": {
            "type": "string"
          },
          "liquidationThreshold": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "ExpectedLoanValuesSchema": {
        "type": "object",
        "description": "Expected loan economics the borrower signs off on, checked on-chain against the\nfreshly-priced values to bound slippage.",
        "required": [
          "expectedApy",
          "expectedLqt"
        ],
        "properties": {
          "expectedApy": {
            "type": "integer",
            "format": "int64",
            "description": "Expected loan APY, in basis points of a hundredth (cbps).",
            "minimum": 0
          },
          "expectedLqt": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Expected per-ledger liquidation threshold, one entry per ledger slot."
          }
        }
      },
      "ExternalYieldInfo": {
        "type": "object",
        "required": [
          "externalYieldSource",
          "balance",
          "apy",
          "yieldAccount",
          "lastUpdateTime"
        ],
        "properties": {
          "apy": {
            "type": "string"
          },
          "balance": {
            "type": "string"
          },
          "externalYieldSource": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lastUpdateTime": {
            "type": "integer",
            "format": "int64"
          },
          "yieldAccount": {
            "type": "string"
          }
        }
      },
      "ExternalYieldReward": {
        "type": "object",
        "required": [
          "baseReward",
          "strategyAddress",
          "externalYieldSource",
          "principalMint"
        ],
        "properties": {
          "baseReward": {
            "$ref": "#/components/schemas/BasePortfolioReward"
          },
          "externalYieldSource": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "strategyAddress": {
            "type": "string"
          }
        }
      },
      "ExternalYieldSourceParams": {
        "type": "object",
        "required": [
          "newExternalYieldSource"
        ],
        "properties": {
          "newExternalYieldSource": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "ExternalYieldVault": {
        "type": "object",
        "required": [
          "yieldSourceVault",
          "principalMint",
          "yieldSource",
          "totalAssetShares",
          "valuePerShare",
          "apy",
          "lastUpdateTime"
        ],
        "properties": {
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lastUpdateTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "totalAssetShares": {
            "type": "number",
            "format": "double"
          },
          "valuePerShare": {
            "type": "number",
            "format": "double"
          },
          "yieldSource": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "yieldSourceVault": {
            "type": "string"
          }
        }
      },
      "FetchLendVaultsHistoryParams": {
        "type": "object",
        "required": [
          "vaultAddress",
          "timeLookback"
        ],
        "properties": {
          "sampleIntervalSecs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "timeLookback": {
            "type": "integer",
            "format": "int64"
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "FetchLendVaultsInfoParams": {
        "type": "object",
        "required": [
          "page",
          "pageSize"
        ],
        "properties": {
          "depositsEnabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "featured": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "includeRewards": {
            "type": "boolean"
          },
          "includeStrategySummaries": {
            "type": "boolean",
            "description": "When true, enrich each returned vault with `strategySummary` (the same\nper-strategy USD/APY numbers as `POST /strategy/summaries`), letting the\nFE render APY/TVL without a second call."
          },
          "lpMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mintEnabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sortDirection": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "sortType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vaultIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "GenericParsedLoanEvent": {
        "type": "object",
        "description": "A parsed loan lifecycle event with action-specific metadata in `actionMetadata`.",
        "required": [
          "id",
          "loan",
          "assetIdentifier",
          "amount",
          "action",
          "actionMetadata",
          "eventTime",
          "eventTxn"
        ],
        "properties": {
          "action": {
            "$ref": "#/components/schemas/LoanEventType"
          },
          "actionMetadata": {
            "$ref": "#/components/schemas/ApiLoanEventActionMetadata"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "assetIdentifier": {
            "type": "string"
          },
          "assetMint": {
            "type": [
              "string",
              "null"
            ]
          },
          "eventTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "eventTxn": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loan": {
            "type": "string"
          },
          "newLender": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalLender": {
            "type": [
              "string",
              "null"
            ]
          },
          "usdPrice": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "HistoricalCollateralHolderFilter": {
        "type": "object",
        "required": [
          "mint",
          "rangeStart",
          "rangeEnd"
        ],
        "properties": {
          "mint": {
            "type": "string"
          },
          "pdas": {
            "type": "boolean"
          },
          "rangeEnd": {
            "type": "integer",
            "format": "int64"
          },
          "rangeStart": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "HistoricalCollateralHolderStats": {
        "type": "object",
        "description": "Historical holder summary for one collateral mint over `[rangeStart,\nrangeEnd]`: per-holder deposit-seconds (time-weighted exposure).",
        "required": [
          "collateralMint",
          "rangeStart",
          "rangeEnd",
          "userDepositSeconds"
        ],
        "properties": {
          "collateralMint": {
            "type": "string"
          },
          "rangeEnd": {
            "type": "integer",
            "format": "int64"
          },
          "rangeStart": {
            "type": "integer",
            "format": "int64"
          },
          "userDepositSeconds": {
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "HistoricalLoanItem": {
        "type": "object",
        "required": [
          "loanAddress",
          "borrower",
          "startTime",
          "endTime",
          "principal",
          "collateral",
          "avgLtv",
          "avgLqt"
        ],
        "properties": {
          "avgLqt": {
            "type": "number",
            "format": "double",
            "description": "Loan-level lifetime-averaged liquidation threshold, same construction."
          },
          "avgLtv": {
            "type": "number",
            "format": "double",
            "description": "Loan-level lifetime-averaged LTV. See `ClosedLedgerSummary` for the\nweighting construction. 0.0 when the loan never had matrix data\nalongside outstanding debt."
          },
          "borrower": {
            "type": "string"
          },
          "collateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClosedLedgerSummaryCollateral"
            }
          },
          "endTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "loanAddress": {
            "type": "string"
          },
          "principal": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClosedLedgerSummaryPrincipal"
            }
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "HistoricalLoansFilter": {
        "type": "object",
        "description": "Body for `POST /loans/historical`. At least one of `borrower`,\n`lenders`, or `loanAddresses` must be set. When multiple are set the\nfilters intersect (e.g. borrower + lender = loans where this borrower\ntook a loan from this strategy).",
        "properties": {
          "borrower": {
            "type": [
              "string",
              "null"
            ]
          },
          "collateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Match if any returned collateral entry's mint is in this list."
          },
          "lenders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Strategy addresses, lender-side. Matches loans where any of these\nstrategies appeared as a lender at any point in the loan's history\n(covers loan sales / refinances mid-life)."
          },
          "loanAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "orderFundingTypes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Optional `LoanType` filter (`0` = Generic, `2` = Loop). Matches the\n`orderFundingTypes` field on `LoanFilter` for `/loans/info` so the\nFE can pull a borrower's past *loops* with the same filter shape it\nalready uses for active loops.",
            "minimum": 0
          },
          "page": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Match if any returned principal entry's mint is in this list."
          },
          "sortSide": {
            "type": "integer",
            "format": "int32",
            "description": "`0` = newest end_time first (default), `1` = oldest first.",
            "minimum": 0
          }
        }
      },
      "HistoricalLoansResponse": {
        "type": "object",
        "required": [
          "items",
          "pageInfo",
          "principalMints",
          "collateralMints"
        ],
        "properties": {
          "collateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Distinct collateral mints across the unfiltered user history."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoricalLoanItem"
            }
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Distinct principal mints across the *unfiltered* user history — feeds\nthe FE filter dropdown without forcing a second round trip."
          }
        }
      },
      "HistoricalLoopVaultBorrowRate": {
        "type": "object",
        "required": [
          "id",
          "loopVaultIdentifier",
          "borrowRate",
          "timestamp"
        ],
        "properties": {
          "avgLoopApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "borrowRate": {
            "type": "number",
            "format": "double"
          },
          "collateralRate": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loopVaultIdentifier": {
            "type": "string"
          },
          "principalBaseRate": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "HistoricalMarketRate": {
        "type": "object",
        "description": "One historical market-rate sample (borrow/lend APY %, optionally per duration).",
        "required": [
          "id",
          "marketType",
          "principalMint",
          "timestamp",
          "borrowApy",
          "lendApy"
        ],
        "properties": {
          "borrowApy": {
            "type": "number",
            "format": "float"
          },
          "duration": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "durationType": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lendApy": {
            "type": "number",
            "format": "float"
          },
          "marketType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          },
          "weightedAvgApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "float"
          }
        }
      },
      "HolderFilter": {
        "type": "object",
        "description": "asset filter",
        "required": [
          "mints"
        ],
        "properties": {
          "mints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "assets"
          },
          "pdas": {
            "type": "boolean",
            "description": "Return the PDAs holding the assets, if false it returns the borrower"
          }
        }
      },
      "IncreaseLeverageTransactionInput": {
        "type": "object",
        "required": [
          "principalRequested",
          "depositCollateral"
        ],
        "properties": {
          "cpiIxs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedInstruction"
            },
            "description": "Caller-supplied CPI instructions spliced into the built transaction."
          },
          "cpiLuts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cpiSigners": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "depositCollateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositCollateralInput"
            },
            "description": "Collateral to deposit alongside the borrow."
          },
          "isLoop": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "loanAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "nonce": {
            "type": [
              "string",
              "null"
            ]
          },
          "principalRequested": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BorrowPrincipalRequested"
            },
            "description": "Per-ledger principal borrow requests."
          },
          "refinanceParams": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RefinanceLedgerParamsSchema",
                "description": "Optional on-chain refinance params."
              }
            ]
          },
          "setupIxs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedInstruction"
            },
            "description": "Setup instructions run before the main instructions."
          },
          "setupLuts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "setupSigners": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unifySetup": {
            "type": "boolean"
          }
        }
      },
      "InitLendingVaultTimelockTxnParams": {
        "type": "object",
        "required": [
          "vaultAddress"
        ],
        "properties": {
          "collateralUpdates": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StrategyCollateralUpdates"
              }
            ]
          },
          "editStrategyArgs": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EditStrategySettingsArgs"
              }
            ]
          },
          "editVaultArgs": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EditVaultArgs"
              }
            ]
          },
          "updatePrincipalCaps": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PrincipalCapsUpdateArgs"
              }
            ]
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "InstructionAccountMeta": {
        "type": "object",
        "description": "instructino account metadata",
        "required": [
          "pubkey",
          "isSigner",
          "isWritable"
        ],
        "properties": {
          "isSigner": {
            "type": "boolean",
            "description": "True if an `Instruction` requires a `Transaction` signature matching `pubkey`."
          },
          "isWritable": {
            "type": "boolean",
            "description": "True if the account data or metadata may be mutated during program execution."
          },
          "pubkey": {
            "type": "string",
            "description": "An account's public key."
          }
        }
      },
      "InstructionWithLutsAndQuote": {
        "type": "object",
        "description": "Response type for vault LP mint/redeem instruction endpoints\nContains instructions, lookup tables, and quote information",
        "required": [
          "instructions",
          "luts",
          "quote"
        ],
        "properties": {
          "instructions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionInstruction"
            }
          },
          "luts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "quote": {
            "$ref": "#/components/schemas/LoopRouteQuote"
          },
          "setupIxs": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/TransactionInstruction"
            }
          },
          "setupSigners": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "signers": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Ledger": {
        "type": "object",
        "required": [
          "ledgerIndex",
          "loan",
          "status",
          "strategy",
          "principalMint",
          "marketInformation",
          "principalDue",
          "principalRepaid",
          "interestOutstanding",
          "lastInterestUpdatedTime",
          "interestPerSecond",
          "duration",
          "durationType",
          "startTime",
          "endTime",
          "apy",
          "weights",
          "ltvRatios",
          "lqtRatios",
          "lastInteractedTime",
          "lastInteractedTxn"
        ],
        "properties": {
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "durationType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "endTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "interestOutstanding": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "interestPerSecond": {
            "type": "number",
            "format": "double"
          },
          "isLoop": {
            "type": "integer",
            "format": "int32"
          },
          "lastInteractedTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lastInteractedTxn": {
            "type": "string"
          },
          "lastInterestUpdatedTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "ledgerIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loan": {
            "type": "string"
          },
          "lqtRatios": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral liquidation thresholds (cbps), same index order as `weights`."
          },
          "ltvRatios": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral loan-to-value ratios (cbps), same index order as `weights`."
          },
          "marketInformation": {
            "type": "string"
          },
          "principalDue": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "principalRepaid": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "strategy": {
            "type": "string"
          },
          "weights": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Weight matrix: per-collateral weight (cbps), indexed by the market's\ncollateral map. Drives how each collateral backs this ledger's principal."
          },
          "writeVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "LedgerReward": {
        "type": "object",
        "required": [
          "baseReward",
          "loanCollateralAssetIdentifiers",
          "principalMint",
          "loanAddress",
          "strategyAddress"
        ],
        "properties": {
          "baseReward": {
            "$ref": "#/components/schemas/BasePortfolioReward"
          },
          "loanAddress": {
            "type": "string"
          },
          "loanCollateralAssetIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "principalMint": {
            "type": "string"
          },
          "strategyAddress": {
            "type": "string"
          }
        }
      },
      "LendVaultDepositQueryParams": {
        "type": "object",
        "required": [
          "vault",
          "principalAmount",
          "minLpAmount"
        ],
        "properties": {
          "depositOnly": {
            "type": "boolean"
          },
          "minLpAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vault": {
            "type": "string"
          }
        }
      },
      "LendVaultDepositResponse": {
        "type": "object",
        "required": [
          "transaction",
          "stakeAccount"
        ],
        "properties": {
          "preTransactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionedTransactionReturn"
            },
            "description": "Unstake-only transactions that must be executed before the main transaction\nwhen consolidating more positions than fit in a single transaction."
          },
          "stakeAccount": {
            "type": "string"
          },
          "transaction": {
            "$ref": "#/components/schemas/VersionedTransactionReturn"
          }
        }
      },
      "LendVaultMintAggregate": {
        "type": "object",
        "description": "One per-principal-mint rollup over the lend vaults matched by\n`POST /lending_vaults/summary`. Nests `LendVaultsAggregate`, mirroring the\nshape of `VaultDepositsMintAggregate` on the user-portfolio endpoint.",
        "required": [
          "principalMint",
          "aggregate"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/LendVaultsAggregate"
          },
          "principalMint": {
            "type": "string"
          }
        }
      },
      "LendVaultWithdrawQueryParams": {
        "type": "object",
        "required": [
          "vault",
          "amountPrincipal",
          "maxAmountLp",
          "withdrawAll"
        ],
        "properties": {
          "amountPrincipal": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "maxAmountLp": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vault": {
            "type": "string"
          },
          "withdrawAll": {
            "type": "boolean"
          },
          "withdrawOnly": {
            "type": "boolean"
          }
        }
      },
      "LendVaultWithdrawResponse": {
        "type": "object",
        "required": [
          "transaction",
          "stakeAccount"
        ],
        "properties": {
          "preTransactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionedTransactionReturn"
            },
            "description": "Unstake-only transactions that must be executed before the main transaction\nwhen consolidating more positions than fit in a single transaction."
          },
          "stakeAccount": {
            "type": "string"
          },
          "transaction": {
            "$ref": "#/components/schemas/VersionedTransactionReturn"
          }
        }
      },
      "LendVaultsAggregate": {
        "type": "object",
        "description": "Rollup over a set of lend vaults. Used both as the top-level full-filter\naggregate on `LendVaultsSummaryResponse` and (nested) per principal mint in\n`LendVaultMintAggregate`. USD figures use the current oracle snapshot; APYs\nare fractional (0.085 = 8.5%), TVL-weighted and rounded the same way as the\nstrategy summary aggregate. PnL is net of the manager `interest_fee`.",
        "required": [
          "vaultCount",
          "totalDepositsUsd",
          "totalDeployedUsd",
          "wAvgApy",
          "wAvgRewardsApy",
          "realizedPnlUsd",
          "unrealizedPnlUsd"
        ],
        "properties": {
          "realizedPnlUsd": {
            "type": "number",
            "format": "double",
            "description": "Lifetime interest the vaults have booked, in USD (Σ\n`cumulative_interest_accrued`), net of the manager `interest_fee`."
          },
          "totalDeployedUsd": {
            "type": "number",
            "format": "double",
            "description": "Sum of currently-deployed principal in USD."
          },
          "totalDepositsUsd": {
            "type": "number",
            "format": "double",
            "description": "Sum of net asset value (TVL, fee-inclusive) in USD."
          },
          "unrealizedPnlUsd": {
            "type": "number",
            "format": "double",
            "description": "Interest accrued on outstanding loans but not yet booked, in USD\n(Σ `outstanding_interest_amount` + live per-second accrual), net of fee."
          },
          "vaultCount": {
            "type": "integer",
            "format": "int64",
            "description": "Number of vaults folded into the rollup (priced vaults only — a vault\nwith no oracle price or unknown decimals is skipped).",
            "minimum": 0
          },
          "wAvgApy": {
            "type": "number",
            "format": "double",
            "description": "TVL-weighted base APY (deployed + external-yield blend, net of fee)."
          },
          "wAvgRewardsApy": {
            "type": "number",
            "format": "double",
            "description": "TVL-weighted external rewards APY."
          }
        }
      },
      "LendVaultsInfoResponse": {
        "type": "object",
        "required": [
          "lendVaults",
          "total"
        ],
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Whether more vaults exist beyond the current page."
          },
          "lendVaults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LendingVaultInfo"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total matched vaults across the full filter (not page-scoped).",
            "minimum": 0
          }
        }
      },
      "LendVaultsSummaryResponse": {
        "type": "object",
        "description": "Response for `POST /lending_vaults/summary`. Same `lendVaults` + `total` as\n`LendVaultsInfoResponse`, plus `aggregate` (full-filter rollup over every\nmatched vault, independent of pagination) and `aggregatesByMint` (the same\nrollup split per principal mint, also full-filter).",
        "required": [
          "lendVaults",
          "total",
          "aggregate",
          "aggregatesByMint"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/LendVaultsAggregate"
          },
          "aggregatesByMint": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LendVaultMintAggregate"
            }
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether more vaults exist beyond the current page."
          },
          "lendVaults": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LendingVaultInfo"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "LenderBuildParams": {
        "type": "object",
        "required": [
          "steps"
        ],
        "properties": {
          "steps": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/LenderBuildStep"
              }
            },
            "description": "Batches of build steps, executed batch by batch."
          }
        }
      },
      "LenderBuildResponse": {
        "type": "object",
        "required": [
          "transactions"
        ],
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionedTransactionReturn"
            }
          }
        }
      },
      "LenderBuildStep": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/TxnSellLedgerParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "sell"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/TxnDepositStrategyParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "strategyDeposit"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/TxnWithdrawStrategyParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "strategyWithdraw"
                ]
              }
            }
          }
        ],
        "description": "One lender-side build step, adjacently-tagged by `type` with the step's own\ntransaction params under `params`."
      },
      "LendingStrategyFilter": {
        "type": "object",
        "description": "lending strategy filter",
        "properties": {
          "addresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "collateralTermsAssetFilter": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "When non-empty on the summary endpoint, run a secondary query to fetch\n`terms.asset_terms` only for these collateral mints. Empty (default) =\n`terms.asset_terms` stays empty, no secondary query is run. Ignored by\nthe full `/strategy/infos` endpoint."
          },
          "overridePageSize": {
            "type": "boolean"
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "showArchived": {
            "type": "boolean"
          },
          "sortDirection": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "sortType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "userAddress": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LendingVaultAllocation": {
        "type": "object",
        "required": [
          "collateralMint",
          "activeLoanCount",
          "totalPrincipalDeployed",
          "wAvgApy",
          "collateralDepositedUsd"
        ],
        "properties": {
          "activeLoanCount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "collateralDepositedUsd": {
            "type": "number",
            "format": "double"
          },
          "collateralMint": {
            "type": "string"
          },
          "totalPrincipalDeployed": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "wAvgApy": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LendingVaultInfo": {
        "type": "object",
        "required": [
          "vault",
          "vaultStrategy",
          "vaultRewardsSchedules"
        ],
        "properties": {
          "strategySummary": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StrategyInfoUsdFields",
                "description": "Strategy's USD/APY summary (TVL, deployed, blended APY, …), populated only\nwhen `/lending_vaults/info` is called with `includeStrategySummaries`."
              }
            ]
          },
          "totalOutstandingLoanCollateralValueUsd": {
            "type": "number",
            "format": "double"
          },
          "vault": {
            "$ref": "#/components/schemas/ParsedLendingVault"
          },
          "vaultMetadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LendingVaultMetadata",
                "description": "Off-chain vault metadata."
              }
            ]
          },
          "vaultRewardsEmittedAmounts": {
            "type": [
              "object",
              "null"
            ],
            "description": "Map of schedule index (as string) → emitted amount (claimed + pending across active stakes).",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "vaultRewardsSchedules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedVaultRewardsSchedule"
            },
            "description": "Active rewards schedules."
          },
          "vaultStrategy": {
            "$ref": "#/components/schemas/StrategyInfo",
            "description": "Underlying strategy info."
          }
        }
      },
      "LendingVaultMetadata": {
        "type": "object",
        "description": "Off-chain vault display/product metadata.",
        "required": [
          "name",
          "description",
          "managerName",
          "managerImage"
        ],
        "properties": {
          "bannerImage": {
            "type": [
              "string",
              "null"
            ]
          },
          "comingSoonBanner": {
            "type": [
              "string",
              "null"
            ]
          },
          "depositCap": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "description": {
            "type": "string"
          },
          "managerImage": {
            "type": "string"
          },
          "managerName": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "notifyFormUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "themeColor": {
            "type": [
              "string",
              "null"
            ]
          },
          "tokenImage": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LendingVaultStats": {
        "type": "object",
        "required": [
          "vaultAddress",
          "vaultSymbol",
          "vaultName",
          "principalMint",
          "principalDepositsUsd",
          "principalDeployedUsd",
          "apy",
          "rewardsApy",
          "rewardsMints"
        ],
        "properties": {
          "apy": {
            "type": "number",
            "format": "double"
          },
          "principalDeployedUsd": {
            "type": "number",
            "format": "double"
          },
          "principalDepositsUsd": {
            "type": "number",
            "format": "double"
          },
          "principalMint": {
            "type": "string"
          },
          "rewardsApy": {
            "type": "number",
            "format": "double"
          },
          "rewardsMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vaultAddress": {
            "type": "string"
          },
          "vaultName": {
            "type": "string"
          },
          "vaultSymbol": {
            "type": "string"
          }
        }
      },
      "LiquidityParamsSchema": {
        "type": "object",
        "description": "CLMM liquidity-management params (slippage bound), used by Orca/Raydium\n`manage_liquidity`.",
        "required": [
          "slippageToleranceBps"
        ],
        "properties": {
          "slippageToleranceBps": {
            "type": "integer",
            "format": "int32",
            "description": "Slippage tolerance, in basis points.",
            "minimum": 0
          }
        }
      },
      "Loan": {
        "type": "object",
        "required": [
          "address",
          "bump",
          "loanStatus",
          "nonce",
          "borrower",
          "startTime",
          "closed",
          "lastInteractedTime",
          "lastInteractedTxn",
          "writeVersion"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "borrower": {
            "type": "string"
          },
          "bump": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "closed": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lastInteractedTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lastInteractedTxn": {
            "type": "string"
          },
          "loanStatus": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "nonce": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "writeVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "LoanBuildParams": {
        "type": "object",
        "required": [
          "steps"
        ],
        "properties": {
          "loan": {
            "type": [
              "string",
              "null"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoanBuildStep"
            },
            "description": "Ordered build steps."
          }
        }
      },
      "LoanBuildResponse": {
        "type": "object",
        "required": [
          "loan",
          "transactions"
        ],
        "properties": {
          "loan": {
            "type": "string"
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionedTransactionReturn"
            }
          }
        }
      },
      "LoanBuildStep": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/TxnRepayPrincipalParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "repay"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/IncreaseLeverageTransactionInput"
              },
              "type": {
                "type": "string",
                "enum": [
                  "flashBorrow"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "params",
              "type"
            ],
            "properties": {
              "params": {
                "$ref": "#/components/schemas/TxnSwapCollateralParams"
              },
              "type": {
                "type": "string",
                "enum": [
                  "swapCollateral"
                ]
              }
            }
          }
        ],
        "description": "One step of a composed loan build, adjacently-tagged by `type` with the\nstep's own transaction params under `params`."
      },
      "LoanCollateral": {
        "type": "object",
        "required": [
          "loan",
          "index",
          "assetType",
          "assetIdentifier",
          "assetMint",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "assetIdentifier": {
            "type": "string"
          },
          "assetMint": {
            "type": "string"
          },
          "assetType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "index": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lastInteractedTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lastInteractedTxn": {
            "type": "string"
          },
          "loan": {
            "type": "string"
          },
          "writeVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "LoanCreationParams": {
        "oneOf": [
          {
            "type": "string",
            "enum": [
              "Default"
            ]
          },
          {
            "type": "object",
            "required": [
              "OrcaPositionCreate"
            ],
            "properties": {
              "OrcaPositionCreate": {
                "$ref": "#/components/schemas/OrcaPositionCreateParams"
              }
            }
          }
        ],
        "description": "Optional collateral-specific loan-creation params (e.g. opening an Orca CLMM\nposition as collateral); `Default` for a plain loan."
      },
      "LoanDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LoanSummaryItem"
          },
          {
            "type": "object",
            "properties": {
              "closedSummary": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ClosedLedgerSummary"
                  }
                ]
              },
              "events": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GenericParsedLoanEvent"
                }
              },
              "matrixUpdates": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LoanMatrixEvent"
                }
              },
              "pastLedgers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Ledger"
                }
              }
            }
          }
        ],
        "description": "Per-loan detail response: a `LoanSummaryItem` (snapshot + USD/risk fields)\nextended with the event/matrix/past-ledger timelines that only the detail\npage needs. Events are serialized as adjacently-tagged `{ type, params }`.\n\n`closed_summary` is set only when `loans.closed = true`. The FE uses this\nto render the \"Past Loans\" detail view (avg principal/collateral/APY over\nthe loan's lifetime) without re-walking events on every read."
      },
      "LoanEventType": {
        "type": "string",
        "enum": [
          "addCollateral",
          "removeCollateral",
          "borrowPrincipal",
          "repayPrincipal",
          "refinanceLedger",
          "sellLedger",
          "liquidate"
        ]
      },
      "LoanFilter": {
        "type": "object",
        "properties": {
          "assetTypes": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "borrowers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "loan borrower"
          },
          "collateralIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "collateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "excludeCollateralIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "excludeCollateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Filters on `loan_collateral.asset_mint`, complementing\n`exclude_collateral_identifiers` (which filters on `asset_identifier`).\nFor plain SPL collateral the two columns are equal; for LP/pool\ncollateral `asset_identifier` is the pool_id, so excluding by mint\nalone won't catch those rows. Set both to cover both cases."
          },
          "excludePrincipalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "filterType": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "filter type enum",
            "minimum": 0
          },
          "includePnl": {
            "type": "boolean",
            "description": "When true, `/loans/info` runs the PnL pipeline against the page's loans\nin parallel with the list-side pricing pass and stamps a\n`LoanPnlDetails` onto each `LoanSummaryItem`. Off by default so the\ndropdown/filter-edit calls that don't render PnL stay cheap."
          },
          "lenders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "loan lender"
          },
          "loanAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "loan address"
          },
          "loopVaultPrincipalCollateralPairs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrincipalCollateralPair"
            }
          },
          "orderFundingTypes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "page": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "principal"
          },
          "sortSide": {
            "type": "integer",
            "format": "int32",
            "description": "Sort direction: `0` = ascending, `1` = descending.",
            "minimum": 0
          },
          "sortType": {
            "type": "integer",
            "format": "int32",
            "description": "Sort key (see `LoanInfoSorting` discriminants).",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "LoanInfo": {
        "type": "object",
        "required": [
          "loan",
          "loanType",
          "ledgers",
          "collateral",
          "collateralYieldPct",
          "principalYieldPct"
        ],
        "properties": {
          "collateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoanCollateral"
            }
          },
          "collateralYieldPct": {
            "type": "number",
            "format": "double"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenericParsedLoanEvent"
            }
          },
          "ledgers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ledger"
            }
          },
          "loan": {
            "$ref": "#/components/schemas/Loan"
          },
          "loanType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "matrixUpdates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoanMatrixEvent"
            }
          },
          "pastLedgers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ledger"
            }
          },
          "principalYieldPct": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LoanInfoSnapshot": {
        "type": "object",
        "required": [
          "loan",
          "loanType",
          "ledgers",
          "collateral",
          "collateralYieldPct",
          "principalYieldPct"
        ],
        "properties": {
          "collateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoanCollateral"
            }
          },
          "collateralYieldPct": {
            "type": "number",
            "format": "double"
          },
          "ledgers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ledger"
            }
          },
          "loan": {
            "$ref": "#/components/schemas/Loan"
          },
          "loanType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "principalYieldPct": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "LoanMatrixEvent": {
        "type": "object",
        "description": "A recorded weight-matrix update on a loan: the new per-collateral weight / LTV\n/ LQT matrices at a point in time (one row per `update_weight_matrix`).",
        "required": [
          "loan",
          "weights",
          "lqtRatios",
          "ltvRatios",
          "timestamp",
          "txnSignature",
          "ledgerIndex",
          "writeVersion"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ledgerIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "loan": {
            "type": "string"
          },
          "lqtRatios": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral liquidation thresholds (cbps) after this update."
          },
          "ltvRatios": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral loan-to-value ratios (cbps) after this update."
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "txnSignature": {
            "type": "string"
          },
          "weights": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Weight matrix (per-collateral weight, cbps) after this update."
          },
          "writeVersion": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "LoanPnlDetails": {
        "type": "object",
        "properties": {
          "collateralPnl": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "collateralPnlPctChange": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "initialUserCollateralContribution": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "initialUserCollateralContributionUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "markers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChartDataMarker"
            },
            "description": "Rollover and other chart annotations (same list for all charts; derived from PnL series)."
          },
          "netCollateralInflow": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "netCollateralUsdInflow": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "netPrincipalInflow": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "netPrincipalUsdInflow": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "pnlData": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PnLGraphData"
              }
            ]
          },
          "positionValueData": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PositionValueGraphData"
              }
            ]
          },
          "rateHistoryData": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RateHistoryGraphData"
              }
            ]
          },
          "tokenUsdPnl": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "In-kind PnL re-priced at the **current** collateral spot price\n(`collateralPnl_ui × currentCollateralPrice`) — the value the loop\nposition card shows for non-leverage loops. `Some` only for loop loans\nwith single-token collateral and an available current price; `None` for\nnon-loop loans, CLMM/LP collateral, or missing price (FE falls back to\n`usdPnl`). Leverage loops carry it too, but the card uses `usdPnl`."
          },
          "usdPnl": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "usdPnlPctChange": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "LoanPnlFilter": {
        "type": "object",
        "required": [
          "loans"
        ],
        "properties": {
          "endTimestamp": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "includePnl": {
            "type": "boolean"
          },
          "intervalSeconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "loans": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxPoints": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "projectionSeconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "startTimestamp": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "LoanPnlHistoryFilter": {
        "type": "object",
        "description": "Request filter for the `/loans/pnl/history` endpoint.\n\nReturns cached historical PnL data points from the database, backfilling\nany missing intervals on demand. Use `interval_seconds` to control the\ndensity of returned data points (minimum 900s / 15 minutes).",
        "required": [
          "loans"
        ],
        "properties": {
          "endTimestamp": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "intervalSeconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Granularity between data points in seconds. Minimum 900 (15 minutes),\ndefaults to 86400 (24 hours). Use this to control the number of\nreturned points rather than a separate max_points parameter."
          },
          "loans": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "projectionSeconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "If set, appends projected future data points for this many seconds\nbeyond the current time.",
            "minimum": 0
          },
          "startTimestamp": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "LoanSummary": {
        "type": "object",
        "required": [
          "items",
          "pageInfo",
          "aggregate",
          "snapshotTs",
          "principalMints",
          "collateralMints"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/LoansAggregate"
          },
          "collateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoanSummaryItem"
            },
            "description": "Per-loan items (each flattens the loan snapshot + USD/risk fields)."
          },
          "pageInfo": {
            "$ref": "#/components/schemas/PageInfo"
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "snapshotTs": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "LoanSummaryItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LoanInfoSnapshot"
          },
          {
            "type": "object",
            "required": [
              "collateralUsd",
              "principalUsd",
              "interestAccruedUsd",
              "collateralUsdRisk",
              "principalUsdRisk",
              "collateralBreakdown",
              "pendingYieldUsd",
              "pnlUsd"
            ],
            "properties": {
              "collateralBreakdown": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CollateralBreakdown"
                }
              },
              "collateralUsd": {
                "type": "number",
                "format": "double"
              },
              "collateralUsdRisk": {
                "type": "number",
                "format": "double"
              },
              "interestAccruedUsd": {
                "type": "number",
                "format": "double"
              },
              "pendingYieldUsd": {
                "type": "number",
                "format": "double"
              },
              "pnl": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/LoanPnlDetails",
                    "description": "Populated only when the request set `LoanFilter.include_pnl=true`. Same\nper-loan breakdown the standalone `/loans/pnl` endpoint returns\n(omitting graph series, which only the detail page uses)."
                  }
                ]
              },
              "pnlUsd": {
                "type": "number",
                "format": "double"
              },
              "principalUsd": {
                "type": "number",
                "format": "double"
              },
              "principalUsdRisk": {
                "type": "number",
                "format": "double"
              }
            }
          }
        ]
      },
      "LoanTxnResponse": {
        "type": "object",
        "required": [
          "transactions",
          "expectedLoanInfo"
        ],
        "properties": {
          "expectedLoanInfo": {
            "$ref": "#/components/schemas/LoanInfo",
            "description": "Projected loan state after the transactions land."
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionedTransactionReturn"
            },
            "description": "Built, ready-to-sign versioned transactions."
          }
        }
      },
      "LoansAggregate": {
        "type": "object",
        "description": "Filter-scoped aggregate over the full matched loan set. USD fields use the\nrequest's pinned oracle snapshot. APYs are returned in fractional form\n(0.085 = 8.5%), not cbps.\n\n`dailyInterestUsd`, `dailyCollateralYieldUsd`, and `dailyPrincipalYieldUsd`\nare role-neutral primitives. The FE composes role-specific composites:\n  - Borrower daily net carry: `dailyCollateralYieldUsd − dailyInterestUsd`\n  - Lender daily net carry:   `dailyInterestUsd`\n  - Loop net daily yield:     `dailyCollateralYieldUsd − dailyInterestUsd − dailyPrincipalYieldUsd`\n    (loops borrow yield-bearing principals like JLP/mSOL where the borrowed\n    asset itself appreciates — that appreciation is a real cost on the debt\n    leg captured by `dailyPrincipalYieldUsd`).\n\n**`interestEarnedAllTimeUsd` is currently always 0** on this endpoint —\nclosed loans have `interest_outstanding = 0` so a SUM-by-mint approach can't\nrecover the realized interest. Lender lifetime interest should be sourced\nfrom `/strategy/infos` (which uses `strategy.cumulative_interest_accrued`).\nBorrower lifetime interest is not currently computable; revisit by parsing\n`loan_events_v1.action_metadata` for `RepayPrincipal` events if needed.\n\n`pnlUsd` is computed as `collateralUsd − principalUsd − interestAccruedUsd\n− Σ netInflowUsd` where net inflow is the borrower's net dollar contribution\nfrom `account_balance_changes` (cached event-time USD). Reflects realized +\nunrealized PnL combined.",
        "required": [
          "count",
          "collateralUsd",
          "principalUsd",
          "interestAccruedUsd",
          "interestEarnedAllTimeUsd",
          "wAvgApy",
          "wAvgCollateralApy",
          "pendingYieldUsd",
          "dailyInterestUsd",
          "dailyCollateralYieldUsd",
          "dailyPrincipalYieldUsd"
        ],
        "properties": {
          "collateralUsd": {
            "type": "number",
            "format": "double",
            "description": "Sum of `loan_collateral.amount × snapshot_price` across the rows in\nscope, priced at the snapshot. Zero on non-loop *group* aggregates —\nsee `ApiUserLoanGroup.aggregate` for the rationale."
          },
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of loans folded into this aggregate (dedup'd by `loans.address`).",
            "minimum": 0
          },
          "dailyCollateralYieldUsd": {
            "type": "number",
            "format": "double",
            "description": "Borrower's daily collateral-yield carry in USD across the rows in\nscope = `Σ(collateralUsd × cyl.apy) / 365`. Same unrounded-numerator\napproach as `dailyInterestUsd`."
          },
          "dailyInterestUsd": {
            "type": "number",
            "format": "double",
            "description": "Borrower's daily interest carry in USD across the rows in scope =\n`Σ(principalUsd × apy) / 365`. Computed off the unrounded weighted\nnumerator (not `principalUsd × wAvgApy`) to avoid post-rounding drift."
          },
          "dailyPrincipalYieldUsd": {
            "type": "number",
            "format": "double",
            "description": "Daily yield foregone on the borrowed principal (when principal mint is\nyield-bearing). Zero for plain USDC/etc. borrows. Used to compute loop\nnet APY; safe to ignore for non-loop filters."
          },
          "interestAccruedUsd": {
            "type": "number",
            "format": "double",
            "description": "Sum of `interest_outstanding` (accrued-but-unpaid) across active\nledgers in scope, priced at the snapshot."
          },
          "interestEarnedAllTimeUsd": {
            "type": "number",
            "format": "double",
            "description": "Always 0 on this endpoint — see struct doc comment."
          },
          "pendingYieldUsd": {
            "type": "number",
            "format": "double",
            "description": "Pending unclaimed LP fees in USD for CLMM-style collateral positions\n(sum of `lp_fees_usd` over matching `asset_mint`s in scope). Zero for\nnon-LP collateral."
          },
          "pnlUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "`collateralUsd − principalUsd − interestAccruedUsd − Σ netInflowUsd`.\nNegative = net loss (including borrower's cost basis from collateral\ndeposits). Positive = net gain. See struct doc for full details.\n\n`Option` only to allow omission in edge cases; in practice always set.\nFor loop aggregates this is the cost-basis `usdPnl` (Σ per-loan); paired\nwith `tokenUsdPnl` (in-kind), the FE picks which to display per its\nleverage rule."
          },
          "principalUsd": {
            "type": "number",
            "format": "double",
            "description": "Sum of outstanding principal `(principal_due − principal_repaid)`\nacross active ledgers in scope, priced at the snapshot."
          },
          "tokenUsdPnl": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Σ of per-loan `tokenUsdPnl` (in-kind collateral PnL re-priced at the\ncurrent collateral price) across the loop loans in scope. `Some` for\nloop aggregates; `None` when no loop loan contributed a value (e.g. all\nCLMM/LP collateral — FE falls back to `pnlUsd`)."
          },
          "wAvgApy": {
            "type": "number",
            "format": "double",
            "description": "USD-weighted average of `ledgers.apy` (borrow rate), weighted by\n`principalUsd`."
          },
          "wAvgCollateralApy": {
            "type": "number",
            "format": "double",
            "description": "USD-weighted average of collateral yield APY (`cyl.apy`), weighted by\n`collateralUsd`."
          }
        }
      },
      "LoopRateInfo": {
        "type": "object",
        "required": [
          "loopAddress",
          "loopMaxApy",
          "collateralApyPct",
          "maxLeverage"
        ],
        "properties": {
          "borrowRate": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "collateralApyPct": {
            "type": "number",
            "format": "double"
          },
          "loopAddress": {
            "type": "string"
          },
          "loopMaxApy": {
            "type": "number",
            "format": "double"
          },
          "maxLeverage": {
            "type": "number",
            "format": "double"
          },
          "principalApyPct": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "LoopRouteQuote": {
        "type": "object",
        "description": "Loop Route Quote - contains quote information for LP mint/redeem operations",
        "required": [
          "inputAmount",
          "inputMint",
          "minOutputAmount",
          "outputMint",
          "priceImpactDecimals",
          "feeDecimals"
        ],
        "properties": {
          "exchangeName": {
            "type": [
              "string",
              "null"
            ]
          },
          "feeDecimals": {
            "type": "number",
            "format": "double"
          },
          "inputAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "inputMint": {
            "type": "string"
          },
          "minOutputAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "outputMint": {
            "type": "string"
          },
          "priceImpactDecimals": {
            "type": "number",
            "format": "double"
          },
          "requestId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "LoopVaultBorrowRateQuery": {
        "type": "object",
        "required": [
          "loopVaultIdentifier",
          "timeLookback"
        ],
        "properties": {
          "loopVaultIdentifier": {
            "type": "string"
          },
          "timeLookback": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "LoopVaultInfo": {
        "type": "object",
        "required": [
          "collateralMint",
          "principalMint",
          "collateralDeposited",
          "collateralApyPct",
          "maxLeverage",
          "name",
          "maxLeveragedApyPct",
          "principalAmountAvailable",
          "routeType",
          "quoteFetchParams",
          "collateralDepositedUsd",
          "feVisible"
        ],
        "properties": {
          "aumLimit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "collateralApyPct": {
            "type": "number",
            "format": "double"
          },
          "collateralDeposited": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "collateralDepositedUsd": {
            "type": "number",
            "format": "double"
          },
          "collateralMint": {
            "type": "string"
          },
          "creationTime": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "feVisible": {
            "type": "boolean"
          },
          "featured": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "maxCollateralAmount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "maxLeverage": {
            "type": "number",
            "format": "double"
          },
          "maxLeveragedApyPct": {
            "type": "number",
            "format": "double"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "oneWeekCollateralDepositsUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "principalAmountAvailable": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "quoteFetchParams": {
            "type": "object",
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "rolloverId": {
            "type": [
              "string",
              "null"
            ]
          },
          "routeType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "statsLastUpdated": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "tags": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalCollateralAmount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "totalPrincipalDeployed": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "totalPrincipalDeployedUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "wAvgApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "wAvgLeverage": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "LoopVaultsInfoQuery": {
        "type": "object",
        "properties": {
          "loopVaults": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ManageLiquidityParamsSchema": {
        "type": "object",
        "description": "Params for managing Orca CLMM collateral liquidity (`manage_orca_liquidity`).",
        "required": [
          "collateralIndex",
          "liquidityAmount",
          "transferParams",
          "assetIndexGuidance"
        ],
        "properties": {
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "collateralIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "liquidityAmount": {
            "type": "integer",
            "minimum": 0
          },
          "transferParams": {
            "$ref": "#/components/schemas/TransferTypeParamsSchema"
          }
        }
      },
      "ManageRaydiumLiquidityParamsSchema": {
        "type": "object",
        "description": "Params for managing Raydium CLMM collateral liquidity (`manage_raydium_liquidity`).",
        "required": [
          "collateralIndex",
          "liquidityAmount",
          "manageParams",
          "assetIndexGuidance"
        ],
        "properties": {
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "collateralIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "liquidityAmount": {
            "type": "integer",
            "minimum": 0
          },
          "manageParams": {
            "$ref": "#/components/schemas/TokenAmountsParamsSchema"
          }
        }
      },
      "MarketInformationAssetData": {
        "type": "object",
        "required": [
          "assetIdentifier",
          "marketInformation",
          "index",
          "quoteMint",
          "oracleAccount",
          "oracleType",
          "maxUncertainty",
          "maxAge",
          "decimals",
          "ltv",
          "liquidationThreshold",
          "maxCollateralAllocationPct",
          "currentAllocationAmount",
          "lastInteractedTime",
          "lastInteractedTxn",
          "writeVersion"
        ],
        "properties": {
          "assetIdentifier": {
            "type": "string"
          },
          "currentAllocationAmount": {
            "type": "string"
          },
          "decimals": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "index": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lastInteractedTime": {
            "type": "string"
          },
          "lastInteractedTxn": {
            "type": "string"
          },
          "liquidationThreshold": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "marketInformation": {
            "type": "string"
          },
          "maxAge": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "maxCollateralAllocationPct": {
            "type": "string"
          },
          "maxUncertainty": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "oracleAccount": {
            "type": "string"
          },
          "oracleType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "quoteMint": {
            "type": "string"
          },
          "writeVersion": {
            "type": "string"
          }
        }
      },
      "MarketInformationFilter": {
        "type": "object",
        "properties": {
          "addresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "MarketInformationsRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MarketInformationFilter"
          },
          {
            "type": "object",
            "properties": {
              "includeAssetInfo": {
                "type": "boolean",
                "description": "When `false`, omit the heavy per-asset `marketInformationAssetInfo` from\neach market (it dominates the payload at ~87%). `oracleMapping` is still\nreturned — it's computed from the asset data during assembly, so the\nslim response loses nothing the oracle cache prefetch needs."
              }
            }
          }
        ],
        "description": "Request body for `/oracles/data/market_informations`. Flattens the DB\n`MarketInformationFilter` so existing callers send the same shape, plus an\noptional `includeAssetInfo` projection flag (default `true`)."
      },
      "MaxQuoteRequest": {
        "type": "object",
        "required": [
          "collateralFilter",
          "principalMint",
          "duration",
          "durationType"
        ],
        "properties": {
          "collateralFilter": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollateralFilter"
            }
          },
          "duration": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "durationType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "excludedExternalYield": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "principalMint": {
            "type": "string"
          },
          "strategyCredit": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "MaxQuoteResponse": {
        "type": "object",
        "required": [
          "apy",
          "strategy",
          "collateralIdentifier",
          "ltv",
          "lqt",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "collateralIdentifier": {
            "type": "string"
          },
          "lqt": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "strategy": {
            "type": "string"
          }
        }
      },
      "MergeCall": {
        "type": "object",
        "required": [
          "mergeTarget",
          "mergeFrom"
        ],
        "properties": {
          "mergeFrom": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mergeTarget": {
            "type": "string"
          }
        }
      },
      "MergeOptionGroup": {
        "type": "object",
        "required": [
          "mergeTarget",
          "targetStrategy",
          "targetStrategyApy",
          "mergeFrom",
          "totalDebt",
          "totalCollateral",
          "mergedDebt",
          "mergedLoanCount"
        ],
        "properties": {
          "mergeFrom": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mergeTarget": {
            "type": "string"
          },
          "mergedDebt": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "mergedLoanCount": {
            "type": "integer",
            "minimum": 0
          },
          "targetStrategy": {
            "type": "string"
          },
          "targetStrategyApy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "totalCollateral": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "totalDebt": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "MergeOptionMetrics": {
        "type": "object",
        "required": [
          "totalDebt",
          "mergedDebt",
          "unchangedDebt",
          "originalLoanCount",
          "mergedLoanCount",
          "survivingLoanCount",
          "unchangedLoanCount",
          "mergeCallCount",
          "weightedSavingsRaw"
        ],
        "properties": {
          "mergeCallCount": {
            "type": "integer",
            "minimum": 0
          },
          "mergedDebt": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "mergedLoanCount": {
            "type": "integer",
            "minimum": 0
          },
          "originalLoanCount": {
            "type": "integer",
            "minimum": 0
          },
          "survivingLoanCount": {
            "type": "integer",
            "minimum": 0
          },
          "totalDebt": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "unchangedDebt": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "unchangedLoanCount": {
            "type": "integer",
            "minimum": 0
          },
          "weightedSavingsRaw": {
            "type": "integer",
            "description": "Approximate debt-weighted interest saved in cbps * raw principal units.\nUseful for debugging/sorting; not intended as display currency."
          }
        }
      },
      "MergePlanQuoteRequest": {
        "type": "object",
        "description": "POST `/quote/merge_plan` JSON body.",
        "required": [
          "loans"
        ],
        "properties": {
          "loans": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MergePlannerRankedResponse": {
        "type": "object",
        "required": [
          "weightedApyBefore",
          "lowestApyOption",
          "fewestRemainingLoansOption"
        ],
        "properties": {
          "fewestRemainingLoansOption": {
            "$ref": "#/components/schemas/RankedMergeOption",
            "description": "Best option by:\n1. fewest surviving loans\n2. lowest resulting weighted APY\n3. fewest merge calls\n4. most merged debt"
          },
          "lowestApyOption": {
            "$ref": "#/components/schemas/RankedMergeOption",
            "description": "Best option by:\n1. lowest resulting weighted APY\n2. fewest surviving loans\n3. fewest merge calls\n4. most merged debt"
          },
          "weightedApyBefore": {
            "type": "integer",
            "format": "int64",
            "description": "Debt-weighted APY before any merges, in cbps.",
            "minimum": 0
          }
        }
      },
      "MeteoraDlmmPositionData": {
        "type": "object",
        "required": [
          "positionAddress",
          "lbPair"
        ],
        "properties": {
          "lbPair": {
            "type": "string"
          },
          "positionAddress": {
            "type": "string"
          },
          "tokenProgram": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MultiCollateralTermsUpdateParamsSchema": {
        "type": "object",
        "description": "One APY applied across a set of (collateral, duration) slots\n(`update_multi_collateral_terms`).",
        "required": [
          "apy",
          "indices"
        ],
        "properties": {
          "apy": {
            "type": "integer",
            "format": "int64",
            "description": "APY in basis points of a hundredth (cbps).",
            "minimum": 0
          },
          "indices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollateralTermsIndicesSchema"
            },
            "description": "(collateral, duration) slots this APY applies to."
          }
        }
      },
      "MultiSellLoanQuoteEntry": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SellLoanQuote"
          },
          {
            "type": "object",
            "required": [
              "loan"
            ],
            "properties": {
              "loan": {
                "type": "string"
              }
            }
          }
        ]
      },
      "MultiSellLoanQuoteRequest": {
        "type": "object",
        "required": [
          "loans"
        ],
        "properties": {
          "loans": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "OHLCFilter": {
        "type": "object",
        "required": [
          "mints",
          "startTimestamp"
        ],
        "properties": {
          "endTimestamp": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "mints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "startTimestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "OracleOHLC": {
        "type": "object",
        "required": [
          "startTimestamp",
          "endTimestamp",
          "oracle",
          "assetMint",
          "openPrice",
          "highPrice",
          "lowPrice",
          "closePrice",
          "avgPrice",
          "numUpdates",
          "avgUncertainty"
        ],
        "properties": {
          "assetMint": {
            "type": "string"
          },
          "avgPrice": {
            "type": "number",
            "format": "double"
          },
          "avgUncertainty": {
            "type": "number",
            "format": "double"
          },
          "closePrice": {
            "type": "number",
            "format": "double"
          },
          "endTimestamp": {
            "type": "integer",
            "format": "int64"
          },
          "highPrice": {
            "type": "number",
            "format": "double"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lowPrice": {
            "type": "number",
            "format": "double"
          },
          "numUpdates": {
            "type": "integer",
            "format": "int32"
          },
          "openPrice": {
            "type": "number",
            "format": "double"
          },
          "oracle": {
            "type": "string"
          },
          "startTimestamp": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "OrcaPositionCreateParams": {
        "type": "object",
        "required": [
          "upperTick",
          "lowerTick",
          "tickSpacing",
          "whirlpool",
          "tokenMintA",
          "tokenMintB"
        ],
        "properties": {
          "lowerTick": {
            "type": "integer",
            "format": "int32"
          },
          "tickSpacing": {
            "type": "integer",
            "format": "int32"
          },
          "tokenMintA": {
            "type": "string"
          },
          "tokenMintB": {
            "type": "string"
          },
          "upperTick": {
            "type": "integer",
            "format": "int32"
          },
          "whirlpool": {
            "type": "string"
          }
        }
      },
      "OrcaPositionData": {
        "type": "object",
        "required": [
          "positionMint",
          "whirlpool"
        ],
        "properties": {
          "positionMint": {
            "type": "string"
          },
          "tokenProgram": {
            "type": [
              "string",
              "null"
            ]
          },
          "whirlpool": {
            "type": "string"
          }
        }
      },
      "PageInfo": {
        "type": "object",
        "description": "Pagination envelope shared across paginated listing endpoints\n(`/loans/info`, `/strategy/infos`, `/loop/info/v2`, `/lending_vaults/user/v2`).\n`totalItems` / `totalPages` are filter-scoped, not page-scoped.",
        "required": [
          "page",
          "pageSize",
          "totalItems",
          "totalPages"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "format": "int64",
            "description": "0-indexed page number echoed back from the request.",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "description": "Maximum item count per page applied by the server (may differ from\nthe request's `pageSize` if the request was 0 or above the cap).",
            "minimum": 0
          },
          "totalItems": {
            "type": "integer",
            "format": "int64",
            "description": "Total item count across the *filter* scope (not just this page).\nWhat \"item\" counts as depends on the endpoint — for grouped\nendpoints this is the count of distinct groups, not loans/rows.",
            "minimum": 0
          },
          "totalPages": {
            "type": "integer",
            "format": "int64",
            "description": "`ceil(totalItems / pageSize)`.",
            "minimum": 0
          }
        }
      },
      "PaginatedTimeLockResponse": {
        "type": "object",
        "required": [
          "timeLocks",
          "total"
        ],
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "Whether more timelocks exist beyond the current page."
          },
          "timeLocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedTimeLock"
            },
            "description": "Parsed timelock accounts."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ParsedAccountMeta": {
        "type": "object",
        "description": "One account reference of a parsed Solana instruction.",
        "required": [
          "pubkey",
          "isSigner",
          "isWritable"
        ],
        "properties": {
          "isSigner": {
            "type": "boolean",
            "description": "whether the account must sign"
          },
          "isWritable": {
            "type": "boolean",
            "description": "whether the account is written"
          },
          "pubkey": {
            "type": "string",
            "description": "account pubkey (base58)"
          }
        }
      },
      "ParsedAddCollateralTimelockArgs": {
        "type": "object",
        "required": [
          "collateralTerms",
          "updateAssetDataParams"
        ],
        "properties": {
          "collateralTerms": {
            "$ref": "#/components/schemas/ParsedCollateralTerms"
          },
          "updateAssetDataParams": {
            "$ref": "#/components/schemas/ParsedUpdateAssetDataParams"
          }
        }
      },
      "ParsedApiPrincipalCaps": {
        "type": "object",
        "required": [
          "max1hr",
          "max24hr",
          "maxOutstanding"
        ],
        "properties": {
          "max1hr": {
            "type": "string"
          },
          "max24hr": {
            "type": "string"
          },
          "maxOutstanding": {
            "type": "string"
          }
        }
      },
      "ParsedApiUpdateCapsParams": {
        "type": "object",
        "properties": {
          "borrowCaps": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ParsedApiPrincipalCaps"
              }
            ]
          },
          "supplyCaps": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ParsedApiPrincipalCaps"
              }
            ]
          },
          "withdrawCaps": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ParsedApiPrincipalCaps"
              }
            ]
          }
        }
      },
      "ParsedBorrowPrincipalMetadata": {
        "type": "object",
        "required": [
          "preBorrowPrincipalLedgerState",
          "postBorrowPrincipalLedgerState"
        ],
        "properties": {
          "postBorrowPrincipalLedgerState": {
            "$ref": "#/components/schemas/ParsedEventLedger"
          },
          "preBorrowPrincipalLedgerState": {
            "$ref": "#/components/schemas/ParsedEventLedger"
          }
        }
      },
      "ParsedCapMonitor": {
        "type": "object",
        "required": [
          "startTime1hr",
          "startTime24hr",
          "principal1hr",
          "principal24hr"
        ],
        "properties": {
          "principal1hr": {
            "type": "string"
          },
          "principal24hr": {
            "type": "string"
          },
          "startTime1hr": {
            "type": "string"
          },
          "startTime24hr": {
            "type": "string"
          }
        }
      },
      "ParsedCollateralCaps": {
        "type": "object",
        "required": [
          "maxAllocationPct",
          "currentAllocationAmount"
        ],
        "properties": {
          "currentAllocationAmount": {
            "type": "string"
          },
          "maxAllocationPct": {
            "type": "string"
          }
        }
      },
      "ParsedCollateralTerms": {
        "type": "object",
        "required": [
          "mint",
          "terms"
        ],
        "properties": {
          "mint": {
            "type": "string"
          },
          "terms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Per-duration terms, each serialized as a string."
          }
        }
      },
      "ParsedEventLedger": {
        "type": "object",
        "description": "Snapshot of a ledger's state captured in an event's before/after metadata.",
        "required": [
          "status",
          "strategy",
          "principalMint",
          "marketInformation",
          "principalDue",
          "principalRepaid",
          "duration",
          "interestPerSecond",
          "apy",
          "endTime",
          "startTime"
        ],
        "properties": {
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "duration": {
            "$ref": "#/components/schemas/StrategyDuration"
          },
          "endTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "interestOutstanding": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "interestPerSecond": {
            "type": "number",
            "format": "double"
          },
          "lastInterestUpdatedTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "ledgerIndex": {
            "type": "integer",
            "minimum": 0
          },
          "marketInformation": {
            "type": "string"
          },
          "principalDue": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "principalRepaid": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "strategy": {
            "type": "string"
          }
        }
      },
      "ParsedExternalYieldSourceArgs": {
        "type": "object",
        "required": [
          "newExternalYieldSource"
        ],
        "properties": {
          "externalYieldVault": {
            "type": "string"
          },
          "newExternalYieldSource": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "ParsedInstruction": {
        "type": "object",
        "description": "A parsed Solana instruction (program id, ordered account metas, and base58\ninstruction data) spliced verbatim into a built transaction as a CPI.",
        "required": [
          "programId",
          "accounts",
          "data"
        ],
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedAccountMeta"
            },
            "description": "ordered account metas"
          },
          "data": {
            "type": "string",
            "description": "base58-encoded instruction data"
          },
          "programId": {
            "type": "string",
            "description": "program id (base58)"
          }
        }
      },
      "ParsedLendVaultBalanceChange": {
        "type": "object",
        "required": [
          "actionType",
          "amount",
          "timestamp",
          "vaultAddress",
          "transactionSignature"
        ],
        "properties": {
          "actionType": {
            "$ref": "#/components/schemas/UserVaultActionType"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "transactionSignature": {
            "type": "string"
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "ParsedLendingVault": {
        "type": "object",
        "required": [
          "address",
          "nonce",
          "manager",
          "principalMint",
          "lpMint",
          "lpSupply",
          "cumulativePrincipalDeposited",
          "maxEarlyUnstakeFee",
          "depositsEnabled",
          "featured",
          "mintEnabled"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "cumulativePrincipalDeposited": {
            "type": "string"
          },
          "depositsEnabled": {
            "type": "boolean"
          },
          "featured": {
            "type": "boolean"
          },
          "lpMint": {
            "type": "string"
          },
          "lpSupply": {
            "type": "string"
          },
          "manager": {
            "type": "string"
          },
          "maxEarlyUnstakeFee": {
            "type": "string"
          },
          "mintEnabled": {
            "type": "boolean"
          },
          "nonce": {
            "type": "string"
          },
          "principalMint": {
            "type": "string"
          },
          "tags": {
            "type": [
              "string",
              "null"
            ]
          },
          "vaultIdentifier": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ParsedLiquidateLedgerMetadata": {
        "type": "object",
        "required": [
          "ledgerIndex",
          "isTimeBasedLiquidation",
          "collateralTransfers",
          "liquidationFee"
        ],
        "properties": {
          "collateralTransfers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedLiquidatedCollateralMetadata"
            }
          },
          "isTimeBasedLiquidation": {
            "type": "boolean"
          },
          "ledgerIndex": {
            "type": "integer",
            "minimum": 0
          },
          "liquidationFee": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ParsedLiquidatedCollateralMetadata": {
        "type": "object",
        "required": [
          "assetMint",
          "amount",
          "toLiquidator",
          "price"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "assetMint": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "double"
          },
          "toLiquidator": {
            "type": "boolean"
          }
        }
      },
      "ParsedMarketInformation": {
        "type": "object",
        "required": [
          "address",
          "authority",
          "delegate",
          "principalMint",
          "max1hrBorrow",
          "max24hrBorrow",
          "maxOutstandingBorrow",
          "max1hrSupply",
          "max24hrSupply",
          "maxOutstandingSupply",
          "max1hrWithdraw",
          "max24hrWithdraw",
          "maxOutstandingWithdraw",
          "version",
          "lastInteractedTime",
          "lastInteractedTxn",
          "verified",
          "writeVersion",
          "isDefault",
          "numeraireSymbol"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "authority": {
            "type": "string"
          },
          "delegate": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "isDefault": {
            "type": "boolean"
          },
          "lastInteractedTime": {
            "type": "string"
          },
          "lastInteractedTxn": {
            "type": "string"
          },
          "max1hrBorrow": {
            "type": "string"
          },
          "max1hrSupply": {
            "type": "string"
          },
          "max1hrWithdraw": {
            "type": "string"
          },
          "max24hrBorrow": {
            "type": "string"
          },
          "max24hrSupply": {
            "type": "string"
          },
          "max24hrWithdraw": {
            "type": "string"
          },
          "maxOutstandingBorrow": {
            "type": "string"
          },
          "maxOutstandingSupply": {
            "type": "string"
          },
          "maxOutstandingWithdraw": {
            "type": "string"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {},
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "numeraireSymbol": {
            "type": "string",
            "description": "The symbol the market's sentinel represents (\"USD\" by default)."
          },
          "principalMint": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "writeVersion": {
            "type": "string"
          }
        }
      },
      "ParsedMarketInformationWithLtvInfo": {
        "type": "object",
        "required": [
          "marketInformation",
          "marketInformationAssetInfo",
          "oracleMapping"
        ],
        "properties": {
          "marketInformation": {
            "$ref": "#/components/schemas/ParsedMarketInformation"
          },
          "marketInformationAssetInfo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketInformationAssetData"
            }
          },
          "oracleMapping": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ParsedMigrateLedgerMetadata": {
        "type": "object",
        "required": [
          "lockboxAddr"
        ],
        "properties": {
          "lockboxAddr": {
            "type": "string"
          }
        }
      },
      "ParsedPrincipalCaps": {
        "type": "object",
        "description": "Parsed principal supply/borrow/withdraw caps: rolling 1h and 24h ceilings plus\nthe max concurrent outstanding, all in the principal mint's native units.",
        "required": [
          "max1hr",
          "max24hr",
          "maxOutstanding"
        ],
        "properties": {
          "max1hr": {
            "type": "string"
          },
          "max24hr": {
            "type": "string"
          },
          "maxOutstanding": {
            "type": "string"
          }
        }
      },
      "ParsedRefinanceLedgerMetadata": {
        "type": "object",
        "required": [
          "preRefinanceLedgerState",
          "postRefinanceLedgerState"
        ],
        "properties": {
          "postRefinanceLedgerState": {
            "$ref": "#/components/schemas/ParsedEventLedger"
          },
          "preRefinanceLedgerState": {
            "$ref": "#/components/schemas/ParsedEventLedger"
          }
        }
      },
      "ParsedRepayPrincipalMetadata": {
        "type": "object",
        "required": [
          "preRepaymentPrincipalLedgerState",
          "postRepaymentPrincipalLedgerState"
        ],
        "properties": {
          "postRepaymentPrincipalLedgerState": {
            "$ref": "#/components/schemas/ParsedEventLedger"
          },
          "preRepaymentPrincipalLedgerState": {
            "$ref": "#/components/schemas/ParsedEventLedger"
          }
        }
      },
      "ParsedSellLedgerMetadata": {
        "type": "object",
        "required": [
          "buyer",
          "seller"
        ],
        "properties": {
          "buyer": {
            "type": "string"
          },
          "seller": {
            "type": "string"
          }
        }
      },
      "ParsedTimeLock": {
        "type": "object",
        "description": "A parsed governance timelock account: the pending vault/strategy `update`\nplus its init/execution timestamps and status.",
        "required": [
          "address",
          "vaultAddress",
          "principalMint",
          "initializationTimestamp",
          "executionTimestamp",
          "status",
          "update"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "executionTimestamp": {
            "type": "integer",
            "format": "int64"
          },
          "initializationTimestamp": {
            "type": "integer",
            "format": "int64"
          },
          "principalMint": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "update": {
            "$ref": "#/components/schemas/ApiTimeLockUpdateParams"
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "ParsedUpdateAssetDataParams": {
        "type": "object",
        "description": "Parsed per-collateral asset-data / oracle config update (LTV, liquidation\nthreshold, oracle account/type, allocation cap).",
        "required": [
          "assetIdentifier"
        ],
        "properties": {
          "assetIdentifier": {
            "type": "string"
          },
          "liquidationThreshold": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "maxAge": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "maxCollateralAllocationPct": {
            "type": [
              "string",
              "null"
            ]
          },
          "maxUncertainty": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "oracleAccount": {
            "type": [
              "string",
              "null"
            ]
          },
          "oracleType": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "quoteMint": {
            "type": [
              "string",
              "null"
            ]
          },
          "removeCollateral": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "ParsedUpdateStrategySettingsParams": {
        "type": "object",
        "properties": {
          "externalYieldSourceArgs": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ParsedExternalYieldSourceArgs"
              }
            ]
          },
          "interestFee": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "liquidityBuffer": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "marketInformation": {
            "type": [
              "string",
              "null"
            ]
          },
          "originationCap": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "originationFee": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "originationsEnabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "principalFee": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ParsedUpdateVaultSettingsParams": {
        "type": "object",
        "required": [
          "maxEarlyUnstakeFeeCbps"
        ],
        "properties": {
          "maxEarlyUnstakeFeeCbps": {
            "type": "string"
          }
        }
      },
      "ParsedUserVaultStake": {
        "type": "object",
        "required": [
          "address",
          "vaultAddress",
          "amountStaked",
          "startTime",
          "maxUnstakeFee",
          "endTime",
          "wAvgApy"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "amountStaked": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "endTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "maxUnstakeFee": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "startTime": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "unstakeFeeApplied": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "unstakeTime": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "vaultAddress": {
            "type": "string"
          },
          "wAvgApy": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ParsedVaultPosition": {
        "type": "object",
        "required": [
          "userAddress",
          "amountSupplied"
        ],
        "properties": {
          "amountSupplied": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "userAddress": {
            "type": "string"
          }
        }
      },
      "ParsedVaultRewardsSchedule": {
        "type": "object",
        "description": "A vault rewards emission schedule (per reward mint): emission rate, window,\ncumulative totals, and per-duration stake weights.",
        "required": [
          "id",
          "vaultAddress",
          "rewardMint",
          "totalWeightedStakeSupply",
          "rewardStartTime",
          "rewardEndTime",
          "emissionsPerSecond",
          "totalEmissionsAmount",
          "rewardIndex",
          "scheduleIndex",
          "emissionsClaimed",
          "createdAt",
          "lastRewardIndexUpdateTime",
          "durationStakeWeights"
        ],
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "durationStakeWeights": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "emissionsClaimed": {
            "type": "string"
          },
          "emissionsPerSecond": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "lastRewardIndexUpdateTime": {
            "type": "string"
          },
          "rewardEndTime": {
            "type": "string"
          },
          "rewardIndex": {
            "type": "string"
          },
          "rewardMint": {
            "type": "string"
          },
          "rewardStartTime": {
            "type": "string"
          },
          "scheduleIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "totalEmissionsAmount": {
            "type": "string"
          },
          "totalWeightedStakeSupply": {
            "type": "string"
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "PartialLendingVaultsHistory": {
        "type": "object",
        "required": [
          "timestamp",
          "utilizationRate"
        ],
        "properties": {
          "activeLoanCount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "aggregateLtv": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "avgLoanSize": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "cumulativeLoanCount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "cumulativeLoanVolume": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "depositorHhi": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "effectiveDepositors": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "externalRewardsApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "hhi": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "marketSize": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "netAssetValue": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "portfolioVariance": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "portfolioVolatility": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "principalDeployed": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          },
          "top10Share": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "utilizationRate": {
            "type": "number",
            "format": "double"
          },
          "wAvgApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "PnLDataPoint": {
        "type": "object",
        "required": [
          "date"
        ],
        "properties": {
          "collateralPrice": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Collateral token price in USD at this timestamp"
          },
          "collateralValueUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Collateral value in USD"
          },
          "date": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp"
          },
          "isProjection": {
            "type": "boolean",
            "description": "Whether this is a projection"
          },
          "netCollateralTransferTokenAmount": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Net collateral transfer in collateral token amount (UI amount)"
          },
          "netCollateralTransferUsdAmount": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Net collateral transfer USD amount (cost basis)"
          },
          "netPositionValueTokenAmount": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Net position value in collateral token amount (UI amount)"
          },
          "netPositionValueUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Net position value in USD"
          },
          "principalValueUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Principal value in USD"
          },
          "tokenPnl": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Token PnL (in collateral token base units)"
          },
          "usdPnl": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "USD PnL"
          }
        }
      },
      "PnLGraphData": {
        "type": "object",
        "description": "PnL graph data",
        "required": [
          "dataPoints"
        ],
        "properties": {
          "dataPoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PnLDataPoint"
            }
          }
        }
      },
      "PortfolioRewards": {
        "type": "object",
        "description": "A user's rewards portfolio, grouped by source (strategy deposits, loans,\nvault stakes, earn vaults, loops). Each map is keyed by the source address.",
        "required": [
          "strategies",
          "loans",
          "vaultStakes",
          "earnVaults",
          "loops"
        ],
        "properties": {
          "earnVaults": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/EarnVaultReward"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "loans": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/LedgerReward"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "loops": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/LedgerReward"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "strategies": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/StrategyRewards"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "vaultStakes": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/VaultReward"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "PortfolioRewardsFilter": {
        "type": "object",
        "properties": {
          "earnVaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "isActive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "loanAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stakeAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "strategyAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PositionValueDataPoint": {
        "type": "object",
        "required": [
          "date",
          "collateralMint"
        ],
        "properties": {
          "collateralMint": {
            "type": "string",
            "description": "Active collateral mint at this timestamp (can change during rollovers)"
          },
          "collateralTokenAmount": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Collateral token amount (UI amount)"
          },
          "collateralTokenAmountOfDebt": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Collateral token amount of debt (UI amount)"
          },
          "collateralValueUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Collateral value in USD"
          },
          "date": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp"
          },
          "isProjection": {
            "type": "boolean",
            "description": "Whether this is a projection"
          },
          "netPositionValueTokenAmount": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Net position value in collateral token amount (UI amount)"
          },
          "netPositionValueUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Net position value in USD"
          },
          "principalValueUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Principal value in USD"
          }
        }
      },
      "PositionValueGraphData": {
        "type": "object",
        "description": "Position value graph data",
        "required": [
          "dataPoints"
        ],
        "properties": {
          "dataPoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PositionValueDataPoint"
            }
          }
        }
      },
      "PrincipalCapsUpdateArgs": {
        "type": "object",
        "required": [
          "max1HrBorrowCap",
          "max24HrBorrowCap",
          "maxOutstandingBorrowCap",
          "max1HrSupplyCap",
          "max24HrSupplyCap",
          "maxOutstandingSupplyCap",
          "max1HrWithdrawCap",
          "max24HrWithdrawCap"
        ],
        "properties": {
          "max1HrBorrowCap": {
            "type": "string"
          },
          "max1HrSupplyCap": {
            "type": "string"
          },
          "max1HrWithdrawCap": {
            "type": "string"
          },
          "max24HrBorrowCap": {
            "type": "string"
          },
          "max24HrSupplyCap": {
            "type": "string"
          },
          "max24HrWithdrawCap": {
            "type": "string"
          },
          "maxOutstandingBorrowCap": {
            "type": "string"
          },
          "maxOutstandingSupplyCap": {
            "type": "string"
          }
        }
      },
      "PrincipalCollateralBorrowRateQuery": {
        "type": "object",
        "required": [
          "principalMint",
          "timeLookback"
        ],
        "properties": {
          "collateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Explicit mint filter. If empty, all mints for this principal are candidates."
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Max collateral mints to return. Defaults to 10, capped at 20.",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "sampleIntervalSecs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optional downsampling bucket in seconds — one point per bucket (latest).\nOmitted = full resolution.",
            "minimum": 0
          },
          "sortDirection": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Sort direction: `0` = ascending, `1` = descending.",
            "minimum": 0
          },
          "sortType": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Sort key (see `PrincipalCollateralRateHistorySortType` discriminants).",
            "minimum": 0
          },
          "timeLookback": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PrincipalCollateralPair": {
        "type": "object",
        "required": [
          "principalAssetIdentifier",
          "collateralAssetIdentifier"
        ],
        "properties": {
          "collateralAssetIdentifier": {
            "type": "string"
          },
          "principalAssetIdentifier": {
            "type": "string"
          }
        }
      },
      "PrincipalCollateralRateHistoryResponse": {
        "type": "object",
        "description": "Borrow-rate history for a principal mint against each requested collateral,\nplus a `global` series aggregated across all of them.",
        "required": [
          "perCollateral",
          "global"
        ],
        "properties": {
          "global": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrincipalCollateralRatePoint"
            },
            "description": "Aggregate rate-history series across all requested collateral."
          },
          "perCollateral": {
            "type": "object",
            "description": "Per-collateral-mint (base58 key) rate-history series.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/PrincipalCollateralRatePoint"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "PrincipalCollateralRatePoint": {
        "type": "object",
        "description": "One time-sampled point of a principal↔collateral pair's borrow-rate history.",
        "required": [
          "timestamp"
        ],
        "properties": {
          "avgBorrowRate": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "collateralDepositedUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "collateralYield": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          },
          "totalPrincipalDeployedUsd": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "wAvgActiveBorrowRate": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "wAvgApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "wAvgBorrowRate": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "PrincipalMarketStats": {
        "type": "object",
        "required": [
          "principalUtilized",
          "principalOriginated",
          "principalPrice"
        ],
        "properties": {
          "durationToWAvgBorrowApy": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DurationToWAvgBorrowApy"
            }
          },
          "principalOriginated": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalPrice": {
            "type": "number",
            "format": "double"
          },
          "principalUtilized": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "wAvgBorrowApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "wAvgLendApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "PrincipalMarketStrategyStats": {
        "type": "object",
        "required": [
          "totalDeposits",
          "principalPrice",
          "durationToMinApy",
          "durationToWeightedAvgApy"
        ],
        "properties": {
          "durationToMinApy": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "durationToWeightedAvgApy": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "principalPrice": {
            "type": "number",
            "format": "double"
          },
          "totalDeposits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "QueryCancelTimelockParams": {
        "type": "object",
        "required": [
          "manager",
          "timelock",
          "vault"
        ],
        "properties": {
          "manager": {
            "type": "string"
          },
          "timelock": {
            "type": "string"
          },
          "vault": {
            "type": "string"
          }
        }
      },
      "QueryCreateLendVaultParams": {
        "type": "object",
        "required": [
          "lendVaultNonce",
          "principalMint",
          "tokenName",
          "tokenSymbol",
          "tokenUri",
          "amount",
          "originationsEnabled",
          "liquidityBuffer",
          "interestFee",
          "originationFee",
          "originationCap"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "createMarketInformation": {
            "type": "boolean"
          },
          "externalYieldSourceArgs": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalYieldSourceParams"
              }
            ]
          },
          "interestFee": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lendVaultNonce": {
            "type": "string"
          },
          "liquidityBuffer": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "originationCap": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "originationFee": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "originationsEnabled": {
            "type": "boolean"
          },
          "principalFee": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMint": {
            "type": "string"
          },
          "tokenName": {
            "type": "string"
          },
          "tokenSymbol": {
            "type": "string"
          },
          "tokenUri": {
            "type": "string"
          }
        }
      },
      "QuoteCollateralInfo": {
        "type": "object",
        "required": [
          "amount",
          "assetType",
          "assetIdentifier",
          "assetMint"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "assetIdentifier": {
            "type": "string"
          },
          "assetMint": {
            "type": "string"
          },
          "assetType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "priceOverride": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          }
        }
      },
      "RankedMergeOption": {
        "type": "object",
        "required": [
          "weightedApyBefore",
          "weightedApyAfter",
          "weightedApyImprovement",
          "mergeCalls",
          "groups",
          "unchangedLoans",
          "metrics"
        ],
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MergeOptionGroup"
            },
            "description": "Detailed merge groups, one per merge target that receives sources."
          },
          "mergeCalls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MergeCall"
            },
            "description": "Endpoint-ready merge calls."
          },
          "metrics": {
            "$ref": "#/components/schemas/MergeOptionMetrics"
          },
          "unchangedLoans": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Loans that remain open and unchanged: not merged into another loan and did\nnot receive merged loans."
          },
          "weightedApyAfter": {
            "type": "integer",
            "format": "int64",
            "description": "Debt-weighted APY after this merge option, in cbps.",
            "minimum": 0
          },
          "weightedApyBefore": {
            "type": "integer",
            "format": "int64",
            "description": "Debt-weighted APY before any merges, in cbps.",
            "minimum": 0
          },
          "weightedApyImprovement": {
            "type": "integer",
            "format": "int64",
            "description": "weighted_apy_before - weighted_apy_after. Positive means improvement."
          }
        }
      },
      "RateHistoryDataPoint": {
        "type": "object",
        "required": [
          "date",
          "collateralMint"
        ],
        "properties": {
          "borrowApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Borrow APY (as percentage)"
          },
          "collateralApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Collateral/Yield APY (as percentage)"
          },
          "collateralMint": {
            "type": "string",
            "description": "Active collateral mint at this timestamp (can change during rollovers)"
          },
          "date": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp"
          },
          "isProjection": {
            "type": "boolean",
            "description": "Whether this is a projection"
          },
          "netApy": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Net leveraged APY (as percentage, e.g., 15.5 for 15.5%)"
          }
        }
      },
      "RateHistoryGraphData": {
        "type": "object",
        "description": "Rate history graph data",
        "required": [
          "dataPoints"
        ],
        "properties": {
          "dataPoints": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RateHistoryDataPoint"
            }
          }
        }
      },
      "RateStats": {
        "type": "object",
        "required": [
          "loopRates",
          "vaultRates"
        ],
        "properties": {
          "loopRates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LoopRateInfo"
            }
          },
          "vaultRates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VaultRateInfo"
            }
          }
        }
      },
      "RatesHistoryQuery": {
        "type": "object",
        "required": [
          "principalMints",
          "timeLookback"
        ],
        "properties": {
          "onlyLoopscale": {
            "type": "boolean"
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "timeLookback": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RawQuoteFilter": {
        "type": "object",
        "required": [
          "collateral",
          "principal",
          "limit",
          "duration",
          "durationType",
          "offset"
        ],
        "properties": {
          "apyRange": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "description": "Inclusive `[min, max]` APY bounds (basis points)."
          },
          "collateral": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "durationType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "excludedExternalYield": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "lendingStrategyAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "minPrincipalAmount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "offset": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principal": {
            "type": "string"
          }
        }
      },
      "RawQuoteOffer": {
        "type": "object",
        "required": [
          "apy",
          "ltv",
          "liquidationThreshold",
          "maxPrincipalAvailable",
          "sumPrincipalAvailable"
        ],
        "properties": {
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "liquidationThreshold": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "maxPrincipalAvailable": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "sumPrincipalAvailable": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "RaydiumPositionData": {
        "type": "object",
        "required": [
          "mint",
          "pool"
        ],
        "properties": {
          "mint": {
            "type": "string"
          },
          "pool": {
            "type": "string"
          },
          "tokenProgram": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RefinanceConstraintResponse": {
        "type": "object",
        "description": "`null` floor means no constraint is set.",
        "required": [
          "loanAddress"
        ],
        "properties": {
          "loanAddress": {
            "type": "string"
          },
          "minLiquidationThreshold": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "RefinanceLedgerParamsSchema": {
        "type": "object",
        "description": "Params for refinancing a ledger to a new strategy/duration (`refinance_ledger`).",
        "required": [
          "ledgerIndex",
          "durationIndex",
          "assetIndexGuidance"
        ],
        "properties": {
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral oracle asset-index guidance."
          },
          "durationIndex": {
            "type": "integer",
            "format": "int32",
            "description": "Index into the new strategy's offered durations.",
            "minimum": 0
          },
          "ledgerIndex": {
            "type": "integer",
            "format": "int32",
            "description": "Index of the ledger being refinanced.",
            "minimum": 0
          }
        }
      },
      "RefinanceParams": {
        "type": "object",
        "required": [
          "refinanceStrategy",
          "principalRepayment",
          "minLqt"
        ],
        "properties": {
          "additionalBorrowAmount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "currentApy": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "minLqt": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "minLtv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "principalRepayment": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "refinanceStrategy": {
            "type": "string"
          }
        }
      },
      "RemoveCollateralArgs": {
        "type": "object",
        "required": [
          "durations",
          "removeFromMarketInformation"
        ],
        "properties": {
          "durations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StrategyDuration"
            }
          },
          "removeFromMarketInformation": {
            "type": "boolean"
          }
        }
      },
      "RepayPrincipalParamsSchema": {
        "type": "object",
        "description": "Params for repaying principal on a ledger (`repay_principal`).",
        "required": [
          "amount",
          "ledgerIndex",
          "repayAll"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Amount to repay, in the principal mint's native units (ignored if `repay_all`).",
            "minimum": 0
          },
          "ledgerIndex": {
            "type": "integer",
            "format": "int32",
            "description": "Index of the ledger being repaid.",
            "minimum": 0
          },
          "repayAll": {
            "type": "boolean",
            "description": "Repay the ledger's full outstanding principal + interest."
          }
        }
      },
      "SellLedgerParamsSchema": {
        "type": "object",
        "description": "Params for selling a ledger to a new lender/strategy (`sell_ledger`).",
        "required": [
          "ledgerIndex",
          "expectedSalePrice",
          "assetIndexGuidance"
        ],
        "properties": {
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral oracle asset-index guidance."
          },
          "expectedSalePrice": {
            "type": "integer",
            "format": "int64",
            "description": "Sale price the seller expects, in the principal mint's native units.",
            "minimum": 0
          },
          "ledgerIndex": {
            "type": "integer",
            "format": "int32",
            "description": "Index of the ledger being sold.",
            "minimum": 0
          }
        }
      },
      "SellLoanQuote": {
        "type": "object",
        "required": [
          "salePrice",
          "fairSalePriceAtQuoteRate",
          "valueLeft"
        ],
        "properties": {
          "fairSalePriceAtQuoteRate": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "quote": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BestSellQuote"
              }
            ]
          },
          "salePrice": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "valueLeft": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "SetRefinanceConstraintParams": {
        "type": "object",
        "description": "Set the min `liquidation_threshold` a loan may be refinanced into. Millionths\n(1_000_000 = 100%); `0` clears the floor.",
        "required": [
          "loanAddress",
          "minLiquidationThreshold",
          "timestamp",
          "signature"
        ],
        "properties": {
          "loanAddress": {
            "type": "string",
            "description": "Loan account address."
          },
          "minLiquidationThreshold": {
            "type": "integer",
            "format": "int32",
            "description": "Floor in millionths (1_000_000 = 100%); `0` clears the floor.",
            "minimum": 0
          },
          "signature": {
            "type": "string",
            "description": "Base64 wallet signature over\n`\"Set refinance liquidation threshold floor for loan:{loanAddress}:{minLiquidationThreshold}:{timestamp}\"`."
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "description": "Unix seconds; the signed message must be no older than 30s.",
            "minimum": 0
          }
        }
      },
      "SplData": {
        "type": "object",
        "required": [
          "mint"
        ],
        "properties": {
          "mint": {
            "type": "string"
          }
        }
      },
      "StakeLpQueryParams": {
        "type": "object",
        "required": [
          "vault",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "stakeAccount": {
            "type": [
              "string",
              "null"
            ]
          },
          "vault": {
            "type": "string"
          }
        }
      },
      "StakedSolData": {
        "type": "object",
        "required": [
          "stakeAccount",
          "stakePool"
        ],
        "properties": {
          "stakeAccount": {
            "type": "string"
          },
          "stakePool": {
            "type": "string"
          }
        }
      },
      "StrategiesAggregate": {
        "type": "object",
        "description": "Filter-scoped aggregate over the full matched strategy set. USD fields use\nthe request's pinned oracle snapshot. APYs are fractional (0.085 = 8.5%).\n\n`wAvgApy` and `expected24hInterestUsd` are **blended**: they include both\ndeployed-side interest (from `ledgers.apy`) and external-yield-side yield\n(from `external_yield_vaults.apy`). Idle principal sitting in the strategy's\ntoken account contributes to `strategyBalanceUsd` and drags the weighted\naverage with an implicit 0% APY, matching realized-yield semantics.\n\nStrategies are lender-side only — no role ambiguity; `expected24hInterestUsd`\nalways represents accrual to the lender.",
        "required": [
          "count",
          "principalDeployedUsd",
          "strategyBalanceUsd",
          "totalSupplyUsd",
          "interestAccruedUsd",
          "interestEarnedAllTimeUsd",
          "wAvgApy",
          "expected24hInterestUsd"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of strategies folded into this aggregate.",
            "minimum": 0
          },
          "expected24hInterestUsd": {
            "type": "number",
            "format": "double",
            "description": "Projected 24h interest in USD — computed off the unrounded weighted\nAPY numerator, so it reconciles with the displayed `wAvgApy` within a\nfraction of a bp. Lender-side accrual."
          },
          "interestAccruedUsd": {
            "type": "number",
            "format": "double",
            "description": "Currently-outstanding deployed interest accrued by ledgers, in USD."
          },
          "interestEarnedAllTimeUsd": {
            "type": "number",
            "format": "double",
            "description": "Lifetime interest earned by the lender, read directly from on-chain\n`strategy.cumulative_interest_accrued` summed across the group and\npriced at the snapshot. Independent of `interestAccruedUsd` (which is\nonly the *currently outstanding* leg)."
          },
          "principalDeployedUsd": {
            "type": "number",
            "format": "double",
            "description": "Deployed-side principal in USD — `SUM(principal_due − principal_repaid)`\nacross active ledgers, priced at the snapshot."
          },
          "strategyBalanceUsd": {
            "type": "number",
            "format": "double",
            "description": "Idle-side principal in USD — strategy token-account balance plus\nexternal-yield-vault balance, priced at the snapshot."
          },
          "totalSupplyUsd": {
            "type": "number",
            "format": "double",
            "description": "`principalDeployedUsd + strategyBalanceUsd` — total lender supply."
          },
          "wAvgApy": {
            "type": "number",
            "format": "double",
            "description": "Blended USD-weighted APY: deployed-side (from `ledgers.apy`) plus\nexternal-yield-side (from `external_yield_vaults.apy`). Idle in the\ntoken account contributes at an implicit 0%. Weighting key is\n`totalSupplyUsd`."
          }
        }
      },
      "Strategy": {
        "type": "object",
        "required": [
          "address",
          "version",
          "nonce",
          "bump",
          "principalMint",
          "tokenBalance",
          "lender",
          "originationsEnabled",
          "externalYieldSource",
          "interestPerSecond",
          "lastAccruedTimestamp",
          "liquidityBuffer",
          "interestFee",
          "principalFee",
          "originationFee",
          "originationCap",
          "externalYieldAmount",
          "currentDeployedAmount",
          "outstandingInterestAmount",
          "feeClaimable",
          "cumulativePrincipalOriginated",
          "cumulativeInterestAccrued",
          "cumulativeLoanCount",
          "activeLoanCount",
          "marketInformation",
          "closed",
          "lastInteractedTime",
          "lastInteractedTxn",
          "createdAt",
          "writeVersion",
          "supplyCap1hrPeriodStart",
          "supplyCap24hrPeriodStart",
          "supplyCap1hrAmount",
          "supplyCap24hrAmount",
          "borrowCap1hrPeriodStart",
          "borrowCap24hrPeriodStart",
          "borrowCap1hrAmount",
          "borrowCap24hrAmount",
          "withdrawCap1hrPeriodStart",
          "withdrawCap24hrPeriodStart",
          "withdrawCap1hrAmount",
          "withdrawCap24hrAmount"
        ],
        "properties": {
          "activeLoanCount": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "borrowCap1hrAmount": {
            "type": "string"
          },
          "borrowCap1hrPeriodStart": {
            "type": "string"
          },
          "borrowCap24hrAmount": {
            "type": "string"
          },
          "borrowCap24hrPeriodStart": {
            "type": "string"
          },
          "bump": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "closed": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "cumulativeInterestAccrued": {
            "type": "string"
          },
          "cumulativeLoanCount": {
            "type": "string"
          },
          "cumulativePrincipalOriginated": {
            "type": "string"
          },
          "currentDeployedAmount": {
            "type": "string"
          },
          "externalYieldAmount": {
            "type": "string"
          },
          "externalYieldSource": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "feeClaimable": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "interestFee": {
            "type": "string"
          },
          "interestPerSecond": {
            "type": "number",
            "format": "double"
          },
          "lastAccruedTimestamp": {
            "type": "string"
          },
          "lastInteractedTime": {
            "type": "string"
          },
          "lastInteractedTxn": {
            "type": "string"
          },
          "lender": {
            "type": "string"
          },
          "liquidityBuffer": {
            "type": "string"
          },
          "marketInformation": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "originationCap": {
            "type": "string"
          },
          "originationFee": {
            "type": "string"
          },
          "originationsEnabled": {
            "type": "boolean"
          },
          "outstandingInterestAmount": {
            "type": "string"
          },
          "principalFee": {
            "type": "string"
          },
          "principalMint": {
            "type": "string"
          },
          "supplyCap1hrAmount": {
            "type": "string"
          },
          "supplyCap1hrPeriodStart": {
            "type": "string"
          },
          "supplyCap24hrAmount": {
            "type": "string"
          },
          "supplyCap24hrPeriodStart": {
            "type": "string"
          },
          "tokenBalance": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "withdrawCap1hrAmount": {
            "type": "string"
          },
          "withdrawCap1hrPeriodStart": {
            "type": "string"
          },
          "withdrawCap24hrAmount": {
            "type": "string"
          },
          "withdrawCap24hrPeriodStart": {
            "type": "string"
          },
          "writeVersion": {
            "type": "string"
          }
        }
      },
      "StrategyCollateralUpdates": {
        "type": "object",
        "properties": {
          "addCollateral": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/AddCollateralArgs"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "removeCollateral": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/RemoveCollateralArgs"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "updateAssetAllocation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CollateralAllocationUpdateArgs"
            }
          },
          "updateCollateral": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CollateralParamsUpdateArgs"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "StrategyDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/StrategyInfo"
          },
          {
            "type": "object",
            "required": [
              "principalDeployedUsd",
              "strategyBalanceUsd",
              "totalSupplyUsd",
              "interestAccruedUsd",
              "interestEarnedAllTimeUsd",
              "wAvgApy",
              "expected24hInterestUsd"
            ],
            "properties": {
              "expected24hInterestUsd": {
                "type": "number",
                "format": "double"
              },
              "interestAccruedUsd": {
                "type": "number",
                "format": "double"
              },
              "interestEarnedAllTimeUsd": {
                "type": "number",
                "format": "double"
              },
              "principalDeployedUsd": {
                "type": "number",
                "format": "double"
              },
              "strategyBalanceUsd": {
                "type": "number",
                "format": "double"
              },
              "totalSupplyUsd": {
                "type": "number",
                "format": "double"
              },
              "wAvgApy": {
                "type": "number",
                "format": "double"
              }
            }
          }
        ]
      },
      "StrategyDuration": {
        "type": "object",
        "required": [
          "duration",
          "durationType"
        ],
        "properties": {
          "duration": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "durationType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "StrategyInfo": {
        "type": "object",
        "required": [
          "strategy",
          "terms",
          "borrowCapMonitor",
          "supplyCapMonitor",
          "withdrawCapMonitor"
        ],
        "properties": {
          "borrowCapMonitor": {
            "$ref": "#/components/schemas/ParsedCapMonitor"
          },
          "externalYieldInfo": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalYieldInfo"
              }
            ]
          },
          "strategy": {
            "$ref": "#/components/schemas/Strategy",
            "description": "Strategy account state (DB projection of the on-chain strategy)."
          },
          "supplyCapMonitor": {
            "$ref": "#/components/schemas/ParsedCapMonitor"
          },
          "terms": {
            "$ref": "#/components/schemas/StrategyTerms"
          },
          "withdrawCapMonitor": {
            "$ref": "#/components/schemas/ParsedCapMonitor"
          }
        }
      },
      "StrategyInfoUsdFields": {
        "type": "object",
        "description": "Per-strategy USD/APY summary (TVL, deployed, blended APY, …). Serialized as\nthe `strategySummary` on each vault when `/lending_vaults/info` is called\nwith `includeStrategySummaries`, mirroring the per-item fields of\n`StrategyDetail` from `POST /strategy/summaries`.",
        "required": [
          "principalDeployedUsd",
          "strategyBalanceUsd",
          "totalSupplyUsd",
          "interestAccruedUsd",
          "interestEarnedAllTimeUsd",
          "wAvgApy",
          "expected24hInterestUsd"
        ],
        "properties": {
          "expected24hInterestUsd": {
            "type": "number",
            "format": "double"
          },
          "interestAccruedUsd": {
            "type": "number",
            "format": "double"
          },
          "interestEarnedAllTimeUsd": {
            "type": "number",
            "format": "double"
          },
          "principalDeployedUsd": {
            "type": "number",
            "format": "double"
          },
          "strategyBalanceUsd": {
            "type": "number",
            "format": "double"
          },
          "totalSupplyUsd": {
            "type": "number",
            "format": "double"
          },
          "wAvgApy": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "StrategyPositionItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EarnVaultPosition"
          },
          {
            "type": "object",
            "properties": {
              "positionAddress": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "On-chain address of the underlying position, when the position type has\na single natural anchor. Populated for `loopscaleLoan` (the loan\naccount) and `loopscaleStrategy` (the strategy account) so the FE can\nlink out; `None` for types whose addresses live inside\n`raw_position_json` sub-objects (Kamino, Exponent, etc.)."
              }
            }
          }
        ]
      },
      "StrategyRewards": {
        "type": "object",
        "required": [
          "ledgerRewards"
        ],
        "properties": {
          "externalYieldRewards": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalYieldReward"
              }
            ]
          },
          "ledgerRewards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LedgerReward"
            }
          }
        }
      },
      "StrategyTerms": {
        "type": "object",
        "required": [
          "assetTerms",
          "supplyCaps",
          "borrowCaps",
          "withdrawCaps"
        ],
        "properties": {
          "assetTerms": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/AssetTerms"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "borrowCaps": {
            "$ref": "#/components/schemas/ParsedPrincipalCaps",
            "description": "Principal borrow caps (rolling 1h/24h + max outstanding)."
          },
          "supplyCaps": {
            "$ref": "#/components/schemas/ParsedPrincipalCaps",
            "description": "Principal supply caps (rolling 1h/24h + max outstanding)."
          },
          "withdrawCaps": {
            "$ref": "#/components/schemas/ParsedPrincipalCaps",
            "description": "Principal withdraw caps (rolling 1h/24h + max outstanding)."
          }
        }
      },
      "TimeLockFilter": {
        "type": "object",
        "required": [
          "page",
          "pageSize"
        ],
        "properties": {
          "includeInstant": {
            "type": "boolean"
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "sortDirection": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "timelockStatus": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ToggleLoanPositionParams": {
        "type": "object",
        "required": [
          "loanAddress",
          "timestamp",
          "signature"
        ],
        "properties": {
          "loanAddress": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "TokenAmountsParamsSchema": {
        "type": "object",
        "description": "Explicit token-amount params for a CLMM position (Raydium / token-amount mode).",
        "required": [
          "tokenAAmount",
          "tokenBAmount"
        ],
        "properties": {
          "tokenAAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "tokenBAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "TransactionInstruction": {
        "type": "object",
        "description": "instruction return",
        "required": [
          "programId",
          "keys",
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "data"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstructionAccountMeta"
            },
            "description": "accounts for ix"
          },
          "programId": {
            "type": "string",
            "description": "sPID"
          }
        }
      },
      "TransferCreditQuote": {
        "type": "object",
        "required": [
          "apy",
          "amountLeft",
          "strategyAddress",
          "ltv",
          "liquidationThreshold"
        ],
        "properties": {
          "amountLeft": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "apy": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "liquidationThreshold": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "ltv": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "strategyAddress": {
            "type": "string"
          }
        }
      },
      "TransferPositionParamsSchema": {
        "type": "object",
        "description": "Params for transferring an Orca/Raydium CLMM position as collateral\n(`transfer_*_position`).",
        "required": [
          "liquidityAmount",
          "collateralIndex",
          "transferParams",
          "tickLowerIndex",
          "tickUpperIndex",
          "assetIndexGuidance"
        ],
        "properties": {
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          "collateralIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "liquidityAmount": {
            "type": "integer",
            "minimum": 0
          },
          "tickLowerIndex": {
            "type": "integer",
            "format": "int32"
          },
          "tickUpperIndex": {
            "type": "integer",
            "format": "int32"
          },
          "transferParams": {
            "$ref": "#/components/schemas/TransferTypeParamsSchema"
          }
        }
      },
      "TransferTypeParamsSchema": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "Liquidity"
            ],
            "properties": {
              "Liquidity": {
                "$ref": "#/components/schemas/LiquidityParamsSchema"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "TokenAmounts"
            ],
            "properties": {
              "TokenAmounts": {
                "$ref": "#/components/schemas/TokenAmountsParamsSchema"
              }
            }
          }
        ],
        "description": "How a CLMM transfer/manage sizes the position: by liquidity or by explicit\ntoken amounts (externally-tagged: `{ \"Liquidity\": … }` / `{ \"TokenAmounts\": … }`)."
      },
      "TxnBorrowPrincipalParams": {
        "type": "object",
        "required": [
          "loan",
          "borrowParams",
          "strategy"
        ],
        "properties": {
          "borrowParams": {
            "$ref": "#/components/schemas/BorrowPrincipalParamsSchema",
            "description": "On-chain borrow params."
          },
          "isLoop": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "loan": {
            "type": "string",
            "description": "Loan account address (base58)."
          },
          "refinanceParams": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RefinanceLedgerParamsSchema",
                "description": "Optional on-chain refinance params."
              }
            ]
          },
          "strategy": {
            "type": "string",
            "description": "Strategy account address (base58)."
          },
          "weightMatrixUpdates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeightMatrixUpdateParams"
            }
          }
        }
      },
      "TxnClaimFeeParams": {
        "type": "object",
        "required": [
          "loan",
          "positionMint"
        ],
        "properties": {
          "loan": {
            "type": "string"
          },
          "positionMint": {
            "type": "string"
          }
        }
      },
      "TxnCloseLoanParams": {
        "type": "object",
        "required": [
          "loan"
        ],
        "properties": {
          "loan": {
            "type": "string"
          }
        }
      },
      "TxnCreateLoanParams": {
        "type": "object",
        "required": [
          "depositCollateral",
          "borrower",
          "principalRequested"
        ],
        "properties": {
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral oracle asset-index guidance (one byte per collateral slot)."
          },
          "borrower": {
            "type": "string"
          },
          "depositCollateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositCollateralInput"
            }
          },
          "isLoop": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "loanNonce": {
            "type": [
              "string",
              "null"
            ]
          },
          "principalRequested": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BorrowPrincipalRequested"
            }
          },
          "unstakeInstructions": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UnstakeLpQueryParams",
                "description": "Optional vault LP unstake leg to compose with this txn as a prefix."
              }
            ]
          }
        }
      },
      "TxnCreateStrategyParams": {
        "type": "object",
        "required": [
          "principalMint",
          "lender",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "collateralTerms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MultiCollateralTermsUpdateParamsSchema"
            }
          },
          "externalYieldSourceArgs": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TxnExternalYieldSourceArgs"
              }
            ]
          },
          "interestFee": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "lender": {
            "type": "string"
          },
          "liquidityBuffer": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "marketInformation": {
            "type": [
              "string",
              "null"
            ]
          },
          "originationCap": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "originationFee": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "originationsEnabled": {
            "type": "boolean"
          },
          "principalMint": {
            "type": "string"
          }
        }
      },
      "TxnDepositCollateralParams": {
        "type": "object",
        "required": [
          "loan",
          "depositMint",
          "amount",
          "assetType",
          "assetIdentifier"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "assetIdentifier": {
            "type": "string"
          },
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral oracle asset-index guidance (one byte per collateral slot)."
          },
          "assetType": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "depositMint": {
            "type": "string"
          },
          "expectedLoanValues": {
            "$ref": "#/components/schemas/ExpectedLoanValuesSchema"
          },
          "loan": {
            "type": "string"
          },
          "lockLoan": {
            "type": "boolean"
          },
          "unstakeInstructions": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UnstakeLpQueryParams"
              }
            ]
          }
        }
      },
      "TxnDepositStrategyParams": {
        "type": "object",
        "required": [
          "strategy",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "strategy": {
            "type": "string"
          }
        }
      },
      "TxnExternalYieldSourceArgs": {
        "type": "object",
        "required": [
          "newExternalYieldSource",
          "createExternalYieldAccount"
        ],
        "properties": {
          "createExternalYieldAccount": {
            "type": "boolean"
          },
          "newExternalYieldSource": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "TxnManageOrcaLiquidityParams": {
        "type": "object",
        "required": [
          "loan",
          "positionMint",
          "increase",
          "manageParams"
        ],
        "properties": {
          "increase": {
            "type": "boolean"
          },
          "loan": {
            "type": "string"
          },
          "manageParams": {
            "$ref": "#/components/schemas/ManageLiquidityParamsSchema"
          },
          "positionMint": {
            "type": "string"
          }
        }
      },
      "TxnManageRaydiumLiquidityParams": {
        "type": "object",
        "required": [
          "loan",
          "positionMint",
          "increase",
          "manageParams",
          "amount",
          "slippageDecimals"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "increase": {
            "type": "boolean"
          },
          "isTokenA": {
            "type": "boolean"
          },
          "loan": {
            "type": "string"
          },
          "manageParams": {
            "$ref": "#/components/schemas/ManageRaydiumLiquidityParamsSchema"
          },
          "positionMint": {
            "type": "string"
          },
          "slippageDecimals": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "TxnMergeLoanParams": {
        "type": "object",
        "required": [
          "baseLoan",
          "branchLoan"
        ],
        "properties": {
          "baseLoan": {
            "type": "string"
          },
          "branchLoan": {
            "type": "string"
          }
        }
      },
      "TxnRefinanceLedgerParams": {
        "type": "object",
        "required": [
          "loan",
          "oldStrategy",
          "newStrategy",
          "principalMint",
          "refinanceParams"
        ],
        "properties": {
          "loan": {
            "type": "string"
          },
          "newStrategy": {
            "type": "string"
          },
          "oldStrategy": {
            "type": "string"
          },
          "principalMint": {
            "type": "string"
          },
          "refinanceParams": {
            "$ref": "#/components/schemas/RefinanceLedgerParamsSchema"
          }
        }
      },
      "TxnRepayPrincipalParams": {
        "type": "object",
        "required": [
          "loan",
          "repayParams"
        ],
        "properties": {
          "closeIfPossible": {
            "type": "boolean"
          },
          "collateralWithdrawalParams": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawCollateralParams"
            }
          },
          "cpiIxs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedInstruction"
            },
            "description": "Caller-supplied CPI instructions spliced into the built transaction."
          },
          "cpiLuts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cpiSigners": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "loan": {
            "type": "string"
          },
          "repayParams": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RepayPrincipalParamsSchema"
            }
          },
          "setupIxs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedInstruction"
            },
            "description": "Setup instructions run before the main instructions."
          },
          "setupLuts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "setupSigners": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stakeInstructions": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StakeLpQueryParams",
                "description": "Optional vault LP stake leg to compose with this txn as a suffix.\nUsed to stake collateral released by repayments."
              }
            ]
          },
          "unifySetup": {
            "type": "boolean"
          },
          "weightMatrixUpdates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeightMatrixUpdateParams"
            }
          }
        }
      },
      "TxnSellLedgerParams": {
        "type": "object",
        "required": [
          "loan",
          "oldStrategy",
          "newStrategy",
          "sellParams"
        ],
        "properties": {
          "loan": {
            "type": "string"
          },
          "newStrategy": {
            "type": "string"
          },
          "oldStrategy": {
            "type": "string"
          },
          "sellParams": {
            "$ref": "#/components/schemas/SellLedgerParamsSchema"
          }
        }
      },
      "TxnSimpleRepayPrincipalParams": {
        "type": "object",
        "required": [
          "loan",
          "repayParams",
          "strategy"
        ],
        "properties": {
          "isLoop": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "loan": {
            "type": "string",
            "description": "Loan account address (base58)."
          },
          "repayParams": {
            "$ref": "#/components/schemas/RepayPrincipalParamsSchema",
            "description": "On-chain repay params."
          },
          "strategy": {
            "type": "string",
            "description": "Strategy account address (base58)."
          },
          "weightMatrixUpdates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeightMatrixUpdateParams"
            }
          }
        }
      },
      "TxnSwapCollateralParams": {
        "type": "object",
        "required": [
          "loan",
          "withdrawCollateral",
          "depositCollateral"
        ],
        "properties": {
          "cpiIxs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedInstruction"
            },
            "description": "Caller-supplied CPI instructions spliced into the built transaction."
          },
          "cpiLuts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cpiSigners": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "depositCollateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositCollateralInput"
            }
          },
          "loan": {
            "type": "string"
          },
          "withdrawCollateral": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WithdrawCollateralParams"
            }
          }
        }
      },
      "TxnTransferOrcaPositionParams": {
        "type": "object",
        "required": [
          "loan",
          "positionMint",
          "transferParams"
        ],
        "properties": {
          "loan": {
            "type": "string"
          },
          "positionMint": {
            "type": "string"
          },
          "transferParams": {
            "$ref": "#/components/schemas/TransferPositionParamsSchema"
          }
        }
      },
      "TxnTransferRaydiumPositionParams": {
        "type": "object",
        "required": [
          "loan",
          "positionMint",
          "slippageDecimals",
          "transferParams"
        ],
        "properties": {
          "loan": {
            "type": "string"
          },
          "positionMint": {
            "type": "string"
          },
          "slippageDecimals": {
            "type": "number",
            "format": "double"
          },
          "transferParams": {
            "$ref": "#/components/schemas/TransferPositionParamsSchema"
          }
        }
      },
      "TxnWithdrawCollateralParams": {
        "type": "object",
        "required": [
          "loan",
          "collateralMint",
          "amount",
          "collateralIndex",
          "expectedLoanValues"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "assetIndexGuidance": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "description": "Per-collateral oracle asset-index guidance (one byte per collateral slot)."
          },
          "collateralIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "collateralMint": {
            "type": "string"
          },
          "expectedLoanValues": {
            "$ref": "#/components/schemas/ExpectedLoanValuesSchema"
          },
          "loan": {
            "type": "string"
          },
          "lockLoan": {
            "type": "boolean"
          },
          "skipClose": {
            "type": "boolean"
          },
          "stakeInstructions": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StakeLpQueryParams"
              }
            ]
          }
        }
      },
      "TxnWithdrawStrategyParams": {
        "type": "object",
        "required": [
          "strategy",
          "amount",
          "withdrawAll"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "strategy": {
            "type": "string"
          },
          "withdrawAll": {
            "type": "boolean"
          }
        }
      },
      "UnifiedStatsRequest": {
        "type": "object",
        "properties": {
          "force": {
            "type": "boolean"
          },
          "includeBorrowCaps": {
            "type": "boolean"
          },
          "includeCollateral": {
            "type": "boolean"
          },
          "includeEarn": {
            "type": "boolean"
          },
          "includeEcosystem": {
            "type": "boolean"
          },
          "includePrincipal": {
            "type": "boolean"
          },
          "includePrincipalToCollateralDepositedUsd": {
            "type": "boolean"
          },
          "includeStrategy": {
            "type": "boolean"
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ratesFilter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/YieldStatsFilter"
              }
            ]
          }
        }
      },
      "UnifiedStatsResponse": {
        "type": "object",
        "description": "Unified market stats: each block is present only when the matching\n`include_*` flag was set on the request. Maps are keyed by principal mint\n(base58); nested collateral maps are keyed by collateral mint.",
        "properties": {
          "borrowCaps": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/BorrowCap"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "collateral": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "earn": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EarnStats"
              }
            ]
          },
          "ecosystem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EcosystemStats"
              }
            ]
          },
          "principal": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/PrincipalMarketStats"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "principalToDepositedCollateralUsd": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "number",
                "format": "double"
              },
              "propertyNames": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "rates": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RateStats"
              }
            ]
          },
          "strategy": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "$ref": "#/components/schemas/PrincipalMarketStrategyStats"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "UnstakeLpQueryParams": {
        "type": "object",
        "required": [
          "vault",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "stakeAccount": {
            "type": [
              "string",
              "null"
            ]
          },
          "vault": {
            "type": "string"
          }
        }
      },
      "UpdateRewardsScheduleTxnParams": {
        "type": "object",
        "required": [
          "vaultAddress",
          "scheduleIndex",
          "amountToDeposit",
          "rewardMint"
        ],
        "properties": {
          "amountToDeposit": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "newScheduleEndTime": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "rewardMint": {
            "type": "string"
          },
          "scheduleIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "UpdateStrategyQueryParams": {
        "type": "object",
        "required": [
          "strategy"
        ],
        "properties": {
          "collateralTerms": {
            "$ref": "#/components/schemas/StrategyCollateralUpdates"
          },
          "strategy": {
            "type": "string"
          },
          "updateParams": {
            "$ref": "#/components/schemas/EditStrategySettingsArgs"
          }
        }
      },
      "UpdateVaultMetadataParams": {
        "type": "object",
        "required": [
          "vaultAddress",
          "metadata",
          "timestamp",
          "signature"
        ],
        "properties": {
          "metadata": {
            "$ref": "#/components/schemas/LendingVaultMetadata"
          },
          "signature": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "UserExternalRewardsFilter": {
        "type": "object",
        "properties": {
          "rewardMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stakeAccounts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stakeStatus": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserExternalRewardsPnlInfo": {
        "type": "object",
        "required": [
          "rewardMint",
          "claimedRewards",
          "pendingRewards"
        ],
        "properties": {
          "claimedRewards": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pendingRewards": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "rewardMint": {
            "type": "string"
          }
        }
      },
      "UserLendVaultActiveStats": {
        "type": "object",
        "required": [
          "wAvgApy",
          "totalValue"
        ],
        "properties": {
          "totalValue": {
            "type": "number",
            "format": "double"
          },
          "wAvgApy": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "UserLendingVaultFilter": {
        "type": "object",
        "properties": {
          "lpMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sort": {
            "type": "integer",
            "format": "int32",
            "description": "Sort key (see `StakeSortType` discriminants).",
            "minimum": 0
          },
          "sortDirection": {
            "type": "integer",
            "format": "int32",
            "description": "Sort direction: `0` = ascending, `1` = descending.",
            "minimum": 0
          },
          "stakeDuration": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "Position status filter (see `StakeStatus` discriminants).",
            "minimum": 0
          },
          "userAddress": {
            "type": [
              "string",
              "null"
            ],
            "description": "Depositor wallet. Required by `/lending_vaults/user/v2` (filter-only,\nno header fallback). Optional on legacy paths that read from the auth header."
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserLoansFilter": {
        "type": "object",
        "description": "Request body for `POST /user/loans`. User-scoped — `user_address` is required\n(matched as `loans.borrower`). Response shape switches on the filter's\n`order_funding_types`: `Loop` returns `loopGroups` keyed by collateral\n`(identifier, mint)`; anything else (default `Generic`) returns `loanGroups`\nkeyed by principal mint.",
        "required": [
          "userAddress"
        ],
        "properties": {
          "collateralIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional filter on `loan_collateral.asset_identifier` (pool id for LP collateral)."
          },
          "collateralMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "filterType": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "`LoanFilterType` as `u8` (same as `POST /loans/info`). Defaults to **Active** on the server\nif omitted — this endpoint is intended for open positions only.",
            "minimum": 0
          },
          "orderFundingTypes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "`LoanType` as `u8` (`Generic=0`, `Loop=2`). Defaults to **Generic** on\nthe server if omitted. Pass `Loop` (2) to get the loop-grouped response.",
            "minimum": 0
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sortDirection": {
            "type": "integer",
            "format": "int32",
            "description": "Sort direction: `0` = ascending, `1` = descending.",
            "minimum": 0
          },
          "userAddress": {
            "type": "string"
          }
        }
      },
      "UserPositionDepositSummaryParams": {
        "type": "object",
        "properties": {
          "stakeAccounts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserStrategiesFilter": {
        "type": "object",
        "description": "Request body for `POST /user/strategies`. User-scoped — `user_address` is\nrequired and is the primary filter; `principal_mints` narrows further.\nPagination is over **distinct principal mints**, not strategies.",
        "required": [
          "userAddress"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "showArchived": {
            "type": "boolean"
          },
          "sortDirection": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "userAddress": {
            "type": "string"
          }
        }
      },
      "UserVaultActionType": {
        "type": "string",
        "enum": [
          "deposit",
          "withdrawal"
        ]
      },
      "UserVaultStakePositionsResponse": {
        "type": "object",
        "required": [
          "positions",
          "total"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedUserVaultStake"
            }
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "UserVaultsFilter": {
        "type": "object",
        "description": "Request body for `POST /user/vaults`. User-scoped — `user_address` is required.\nPagination is over **distinct principal mints**. Per-vault rows are loaded\nlazily via `POST /lending_vaults/user/v2` with `principalMints: [mint]`\n(plus optional vault / LP / status filters) when a group row expands.",
        "required": [
          "userAddress"
        ],
        "properties": {
          "lpMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "page": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pageSize": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalMints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sortDirection": {
            "type": "integer",
            "format": "int32",
            "description": "Orders vault groups by `aggregate.totalValueUsd` (largest first when Desc).",
            "minimum": 0
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "userAddress": {
            "type": "string"
          },
          "vaultAddresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "VaultAccessReturn": {
        "type": "object",
        "required": [
          "allowed"
        ],
        "properties": {
          "allowed": {
            "type": "boolean"
          }
        }
      },
      "VaultDepositSummary": {
        "type": "object",
        "required": [
          "sumOfDeposits",
          "sumOfWithdrawals",
          "vaultActions"
        ],
        "properties": {
          "mostRecentDepositOrWithdrawalTimestamp": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "sumOfDeposits": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "sumOfWithdrawals": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vaultActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedLendVaultBalanceChange"
            },
            "description": "Per-action deposit/withdrawal history."
          }
        }
      },
      "VaultDepositWithQuoteParams": {
        "type": "object",
        "required": [
          "vault",
          "principalAmount",
          "minLpAmount"
        ],
        "properties": {
          "minLpAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "principalAmount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vault": {
            "type": "string"
          }
        }
      },
      "VaultDeposits": {
        "type": "object",
        "required": [
          "vaultAddress",
          "userDeposits"
        ],
        "properties": {
          "userDeposits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ParsedVaultPosition"
            }
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "VaultDepositsAggregate": {
        "type": "object",
        "description": "Filter-scoped aggregate over the full matched user-vault-deposit set. USD\nfields use the request's pinned oracle snapshot. APYs are fractional\n(0.085 = 8.5%) with reward APY folded in.\n\nEach `wAvg*Apy` is weighted by per-row `positionValueUsd`. `wAvgTotalApy`\nis the sum of the three legs (base + reward + collateralYield), itself\nalready weighted, so consumers can show it directly without re-summing.\n\n`expected24hInterestUsd = totalValueUsd × wAvgTotalApy / 365` (computed\nfrom the unrounded blended numerator for full precision).",
        "required": [
          "count",
          "totalValueUsd",
          "totalDeployedUsd",
          "wAvgBaseApy",
          "wAvgRewardApy",
          "wAvgCollateralYieldApy",
          "wAvgTotalApy",
          "expected24hInterestUsd",
          "totalEarnedUsd",
          "totalRealizedPnlUsd",
          "totalUnrealizedPnlUsd"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Number of (vault, user) rows folded into this aggregate.",
            "minimum": 0
          },
          "expected24hInterestUsd": {
            "type": "number",
            "format": "double",
            "description": "Projected 24h interest in USD =\n`totalValueUsd × wAvgTotalApy / 365`, derived from the unrounded\nblended APY numerator so it reconciles with the displayed\n`wAvgTotalApy` within a fraction of a bp."
          },
          "totalDeployedUsd": {
            "type": "number",
            "format": "double",
            "description": "Sum of per-row `deployedValueUsd` — the user's pro-rata share of the\nvaults' currently-deployed (lent-out) principal, priced at the snapshot.\nAlways ≤ `totalValueUsd`; the gap is the idle/withdrawable buffer."
          },
          "totalEarnedUsd": {
            "type": "number",
            "format": "double",
            "description": "Lifetime PnL in USD across the rows in scope — the sum of per-row\n`pnl_usd` (current principal-mint value minus net deposited, priced\nat the snapshot). Surfaced on each group and the top-level aggregate\nso the FE can show lifetime earned alongside the daily projection.\nEquals `totalRealizedPnlUsd + totalUnrealizedPnlUsd`."
          },
          "totalRealizedPnlUsd": {
            "type": "number",
            "format": "double",
            "description": "Realized leg of `totalEarnedUsd`: interest already booked into the\nvaults' principal (`totalEarnedUsd − totalUnrealizedPnlUsd`)."
          },
          "totalUnrealizedPnlUsd": {
            "type": "number",
            "format": "double",
            "description": "Unrealized leg: each holder's pro-rata share of the vaults'\nnot-yet-booked accruing interest (`outstanding_interest + live accrual`),\nnet of fee, capped at the position's total earned."
          },
          "totalValueUsd": {
            "type": "number",
            "format": "double",
            "description": "Sum of per-row `positionValueUsd` — total user-held value across the\nrows in scope, priced at the snapshot. This is the user's total\n*deposited* value (idle + deployed + accrued)."
          },
          "wAvgBaseApy": {
            "type": "number",
            "format": "double",
            "description": "USD-weighted average of `baseApy` (deployed + idle blend, net of\n`interest_fee`). Weighting key is per-row `positionValueUsd`."
          },
          "wAvgCollateralYieldApy": {
            "type": "number",
            "format": "double",
            "description": "USD-weighted average of `collateralYieldApy` (fractional yield on the\nprincipal mint when it is yield-bearing, e.g. JLP, mSOL). Weighting\nkey is per-row `positionValueUsd`."
          },
          "wAvgRewardApy": {
            "type": "number",
            "format": "double",
            "description": "USD-weighted average of `rewardApy` (vault-level emissions priced in\nUSD divided by vault TVL in USD). Weighting key is per-row\n`positionValueUsd`."
          },
          "wAvgTotalApy": {
            "type": "number",
            "format": "double",
            "description": "Sum of `wAvgBaseApy + wAvgRewardApy + wAvgCollateralYieldApy`,\nalready weighted — consumers can show it directly without re-summing."
          }
        }
      },
      "VaultDepositsMintAggregate": {
        "type": "object",
        "description": "Per-principal-mint rollup of a user's vault positions — their portfolio\ngrouped by mint. `aggregate` is the standard `VaultDepositsAggregate`\nrestricted to this mint's positions (so its `totalValueUsd`,\n`totalDeployedUsd`, weighted APYs and `totalEarnedUsd` are all this-mint\nonly). The `*Principal` fields express the same totals in the mint's own\ntoken (UI / decimal-adjusted) units, which is only meaningful within a\nsingle mint.",
        "required": [
          "principalMint",
          "aggregate",
          "totalDepositedPrincipal",
          "totalDeployedPrincipal",
          "totalEarnedPrincipal",
          "totalRealizedPnlPrincipal",
          "totalUnrealizedPnlPrincipal"
        ],
        "properties": {
          "aggregate": {
            "$ref": "#/components/schemas/VaultDepositsAggregate"
          },
          "principalMint": {
            "type": "string"
          },
          "totalDeployedPrincipal": {
            "type": "number",
            "format": "double",
            "description": "Total deployed share in principal-token UI units."
          },
          "totalDepositedPrincipal": {
            "type": "number",
            "format": "double",
            "description": "Total deposited (current position value) in principal-token UI units."
          },
          "totalEarnedPrincipal": {
            "type": "number",
            "format": "double",
            "description": "Lifetime PnL (current value − net deposited) in principal-token UI units.\nEquals `totalRealizedPnlPrincipal + totalUnrealizedPnlPrincipal`."
          },
          "totalRealizedPnlPrincipal": {
            "type": "number",
            "format": "double",
            "description": "Realized leg of PnL in principal-token UI units."
          },
          "totalUnrealizedPnlPrincipal": {
            "type": "number",
            "format": "double",
            "description": "Unrealized leg of PnL in principal-token UI units."
          }
        }
      },
      "VaultRateInfo": {
        "type": "object",
        "required": [
          "vaultAddress",
          "apy"
        ],
        "properties": {
          "apy": {
            "type": "number",
            "format": "double"
          },
          "vaultAddress": {
            "type": "string"
          }
        }
      },
      "VaultReward": {
        "type": "object",
        "required": [
          "baseReward",
          "vaultMetadata",
          "stakeAddress",
          "vaultPrincipalMint",
          "vaultAddress"
        ],
        "properties": {
          "baseReward": {
            "$ref": "#/components/schemas/BasePortfolioReward"
          },
          "stakeAddress": {
            "type": "string"
          },
          "vaultAddress": {
            "type": "string"
          },
          "vaultMetadata": {
            "$ref": "#/components/schemas/LendingVaultMetadata"
          },
          "vaultPrincipalMint": {
            "type": "string"
          }
        }
      },
      "VaultWithdrawWithQuoteParams": {
        "type": "object",
        "required": [
          "vault",
          "amountPrincipal",
          "maxAmountLp",
          "withdrawAll"
        ],
        "properties": {
          "amountPrincipal": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "maxAmountLp": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "vault": {
            "type": "string"
          },
          "withdrawAll": {
            "type": "boolean"
          }
        }
      },
      "VersionedTransactionReturn": {
        "type": "object",
        "description": "versioned txn return",
        "required": [
          "message",
          "signatures"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "serialized message"
          },
          "signatures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionedTransactionSignature"
            },
            "description": "serialized signatures"
          }
        }
      },
      "VersionedTransactionSignature": {
        "type": "object",
        "description": "versioned txn return",
        "required": [
          "publicKey",
          "signature"
        ],
        "properties": {
          "publicKey": {
            "type": "string",
            "description": "serialized message"
          },
          "signature": {
            "type": "string",
            "description": "serialized signatures"
          }
        }
      },
      "WeightMatrixUpdateParams": {
        "type": "object",
        "required": [
          "weightMatrixUpdate",
          "collateralIndex"
        ],
        "properties": {
          "collateralIndex": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "weightMatrixUpdate": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        }
      },
      "WithdrawCollateralParams": {
        "type": "object",
        "required": [
          "collateralMint",
          "amount"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "closeIfEligible": {
            "type": "boolean"
          },
          "collateralMint": {
            "type": "string"
          }
        }
      },
      "YieldStatsFilter": {
        "type": "object",
        "properties": {
          "loop_addresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vault_addresses": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "creditbook",
      "description": "Creditbook loan write transactions"
    },
    {
      "name": "strategy",
      "description": "Lender strategy write transactions"
    },
    {
      "name": "lending_vaults",
      "description": "Lending vault write transactions"
    },
    {
      "name": "lending_vaults_data",
      "description": "Lending vault + portfolio read endpoints"
    },
    {
      "name": "strategy_data",
      "description": "Lender strategy read endpoints"
    },
    {
      "name": "loans_data",
      "description": "Loan read endpoints"
    },
    {
      "name": "external_yield_data",
      "description": "External yield read endpoints"
    },
    {
      "name": "quotes",
      "description": "Borrow / sell / refinance / loop quote endpoints"
    },
    {
      "name": "stats",
      "description": "Market stats / rates / collateral-holder read endpoints"
    },
    {
      "name": "oracles_data",
      "description": "Oracle / market-information read endpoints"
    },
    {
      "name": "loops_data",
      "description": "Loop vault + collateral-yield read endpoints"
    },
    {
      "name": "earn_data",
      "description": "Earn vault + portfolio read endpoints"
    }
  ]
}
