openapi: 3.0.3
info:
  title: Kamino API
  version: 1.0.0
  description: >
    The Kamino API provides a comprehensive way to interact with Kamino without
    reading directly from the blockchain.


    The API also provides the ability to fetch data that might not be available
    from just reading the chain.


    Kamino products covered by this documentation:
      - **Kamino Earn Vaults** (kvaults)
      - **Kamino Borrow** (klend) (checkout out the [SDK examples](https://github.com/Kamino-Finance/klend-sdk/tree/master/examples) too)
      - **Kamino Liquidity** (yvaults) (coming soon, in the meantime, checkout out the [SDK examples](https://github.com/Kamino-Finance/kliquidity-sdk/tree/master/examples))

    The API is rate-limited for unauthenticated users. If you feel you need to
    make more requests or run into rate-limit issues, please reach out.
servers:
  - url: https://api.kamino.finance
tags:
  - name: KVaultsVault
    description: Endpoints to retrieve information about the state of Kamino Earn Vaults
    x-displayName: 📊 Vault Data
  - name: KVaultsUser
    description: >-
      Endpoints to retrieve information about the state of Kamino Earn Vault
      users
    x-displayName: 🕵️‍♂️ User Data
  - name: KVaultsGlobal
    description: >-
      Endpoints to retrieve information about the global state of Kamino Earn
      Vaults
    x-displayName: 🌍 Global Data
  - name: KVaultsMint
    description: >-
      Endpoints to retrieve information about the global state of Kamino Earn
      Vault share mints
    x-displayName: 🪙 Share Mint Data
  - name: KVaultsTxDeposit
    x-displayName: 🌱 Deposit
    description: >
      Get unsigned Solana transactions to **deposit** into Kamino Earn Vaults


      {% code-snippet file="/docs/tags/kvaults-tx-deposit-example.ts"
      language="ts" title="Deposit Transaction" /%}
  - name: KVaultsTxWithdraw
    x-displayName: 🏃‍♂️ Withdraw
    description: >
      Get unsigned Solana transactions to **withdraw** from Kamino Earn Vaults


      {% code-snippet file="/docs/tags/kvaults-tx-withdraw-example.ts"
      language="ts" title="Withdraw Transaction" /%}
  - name: KLendMarkets
    x-displayName: 🏦 Markets
    description: ''
  - name: KLendRewards
    x-displayName: 🍬 Rewards
    description: |
      Get up-to-date and historical rewards data.
  - name: KLendUsersAndLoans
    x-displayName: 👥 Users and Loans
    description: ''
  - name: KLendTxDeposit
    x-displayName: 📝 Deposit
    description: >
      Get unsigned Solana transactions to **deposit** liquidity into a Kamino
      Lend market reserve, which can then be used as collateral to borrow


      {% code-snippet file="/docs/tags/klend-tx-deposit-example.ts"
      language="ts" title="Deposit Transaction" /%}
  - name: KLendTxBorrow
    x-displayName: 💳 Borrow
    description: >
      Get unsigned Solana transactions to **borrow** liquidity from a given
      Kamino Lend market reserve


      {% code-snippet file="/docs/tags/klend-tx-borrow-example.ts" language="ts"
      title="Borrow Transaction" /%}
  - name: KLendTxRepay
    x-displayName: 📝 Repay
    description: >
      Get unsigned Solana transactions to **repay** debt for a given Kamino Lend
      user position


      {% code-snippet file="/docs/tags/klend-tx-repay-example.ts" language="ts"
      title="Repay Transaction" /%}
  - name: KLendTxWithdraw
    x-displayName: 🐝 Withdraw
    description: >
      Get unsigned Solana transactions to **withdraw** liquidity from a given
      Kamino Lend market reserve


      {% code-snippet file="/docs/tags/klend-tx-withdraw-example.ts"
      language="ts" title="Withdraw Transaction" /%}
x-tagGroups:
  - name: 📈 Kamino Earn Vaults Data
    tags:
      - KVaultsVault
      - KVaultsUser
      - KVaultsGlobal
      - KVaultsMint
  - name: ⚡️ Kamino Earn Vaults Actions
    tags:
      - KVaultsTxDeposit
      - KVaultsTxWithdraw
  - name: 💫 Kamino Lend Data
    tags:
      - KLendMarkets
      - KLendRewards
      - KLendUsersAndLoans
  - name: 🏹 Kamino Lend Actions
    tags:
      - KLendTxDeposit
      - KLendTxBorrow
      - KLendTxRepay
      - KLendTxWithdraw
paths:
  /kvaults/rewards:
    get:
      summary: Get all KVault season rewards
      description: Get all active season points rewards for each Kamino Earn Vault
      tags:
        - KVaultsGlobal
      parameters:
        - schema:
            type: string
            description: Points source identifier
            example: Season1
            examples:
              - Season1
              - Season2
              - Season3
              - Season4
          required: false
          description: Points source identifier
          name: source
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KvaultRewardMetrics'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/summary:
    get:
      summary: Get summary of the KVault program earnings
      description: >-
        Get an aggregated all-time summary of all Kamino Earn Vault rewards and
        interest earned, in SOL and USD
      tags:
        - KVaultsGlobal
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  earnings:
                    type: object
                    properties:
                      interest:
                        type: object
                        properties:
                          usd:
                            allOf:
                              - $ref: '#/components/schemas/Decimal'
                              - description: Amount in USD denomination
                                example: '1234.56789'
                          sol:
                            allOf:
                              - $ref: '#/components/schemas/Decimal'
                              - description: Amount in SOL denomination
                                example: '1234.56789'
                        required:
                          - usd
                          - sol
                        description: Earnings from interest
                      rewards:
                        type: object
                        properties:
                          usd:
                            allOf:
                              - $ref: '#/components/schemas/Decimal'
                              - description: Amount in USD denomination
                                example: '1234.56789'
                          sol:
                            allOf:
                              - $ref: '#/components/schemas/Decimal'
                              - description: Amount in SOL denomination
                                example: '1234.56789'
                        required:
                          - usd
                          - sol
                        description: Earnings from rewards
                      total:
                        type: object
                        properties:
                          usd:
                            allOf:
                              - $ref: '#/components/schemas/Decimal'
                              - description: Amount in USD denomination
                                example: '1234.56789'
                          sol:
                            allOf:
                              - $ref: '#/components/schemas/Decimal'
                              - description: Amount in SOL denomination
                                example: '1234.56789'
                        required:
                          - usd
                          - sol
                        description: Total earnings
                    required:
                      - interest
                      - rewards
                      - total
                    description: Earnings summary
                required:
                  - earnings
                description: KVault Summary Data
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/vaults:
    get:
      summary: Get all kvaults
      description: Get all Kamino Earn Vaults
      tags:
        - KVaultsVault
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VaultStateArray'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/vaults/{pubkey}:
    get:
      summary: Get KVault by address
      description: Get a single Kamino Earn Vault by the KVault account address
      tags:
        - KVaultsVault
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  address:
                    allOf:
                      - $ref: '#/components/schemas/AddressBase58'
                      - description: Public key of the vault
                        example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
                  state:
                    $ref: '#/components/schemas/The vault state object'
                  programId:
                    allOf:
                      - $ref: '#/components/schemas/AddressBase58'
                      - description: Public key of the kvault program which owns the vault
                        example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
                required:
                  - address
                  - state
                  - programId
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: string
                    description: Error message describing why it was not found
                    example: Account could not be found
                required:
                  - metadata
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/vaults/{pubkey}/metrics:
    get:
      summary: Get current KVault metrics
      description: Get current Kamino Earn Vault metrics for a given vault
      tags:
        - KVaultsVault
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KvaultMetrics'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/vaults/{pubkey}/metrics/history:
    get:
      summary: Get historical KVault metrics
      description: >-
        Get historical Kamino Earn Vault metrics for a given vault, between an
        optional range of dates
      tags:
        - KVaultsVault
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '1970-01-01T00:00:00.000Z'
            description: >-
              Start date of the range (defaults to Unix epoch). Accepts ISO
              string or epoch in ms.
            examples:
              - '1970-01-01T00:00:00.000Z'
              - 0
          required: false
          description: >-
            Start date of the range (defaults to Unix epoch). Accepts ISO string
            or epoch in ms.
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '2025-11-06T12:14:45.529Z'
            description: >-
              End date of the range (defaults to current time). Accepts ISO
              string or epoch in ms.
            examples:
              - '2025-01-01T00:00:00.000Z'
              - 1735689600000
          required: false
          description: >-
            End date of the range (defaults to current time). Accepts ISO string
            or epoch in ms.
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    timestamp:
                      type: number
                      description: Unix timestamp in milliseconds
                    tvl:
                      allOf:
                        - $ref: '#/components/schemas/Decimal'
                        - description: Total Value Locked in token denomination
                          example: '1234.56789'
                    solTvl:
                      allOf:
                        - $ref: '#/components/schemas/Decimal'
                        - description: Total Value Locked in SOL
                          example: '1234.56789'
                    apy:
                      allOf:
                        - $ref: '#/components/schemas/Apy'
                        - description: Annual Percentage Yield
                          example: '0.2'
                    apyTheoretical:
                      allOf:
                        - $ref: '#/components/schemas/Apy'
                        - description: Theoretical Annual Percentage Yield
                          example: '0.2'
                    apyActual:
                      allOf:
                        - $ref: '#/components/schemas/Apy'
                        - description: Actual Annual Percentage Yield
                          example: '0.2'
                    apyFarmRewards:
                      allOf:
                        - $ref: '#/components/schemas/Apy'
                        - description: Annual Percentage Yield from Farm Rewards
                          example: '0.2'
                    apyReservesIncentives:
                      allOf:
                        - $ref: '#/components/schemas/Apy'
                        - description: Annual Percentage Yield from Reserves Incentives
                          example: '0.2'
                    apyIncentives:
                      allOf:
                        - $ref: '#/components/schemas/Apy'
                        - description: Annual Percentage Yield from Incentives
                          example: '0.2'
                    sharePrice:
                      allOf:
                        - $ref: '#/components/schemas/Decimal'
                        - description: Share Price of the vault
                          example: '1234.56789'
                    interest:
                      allOf:
                        - $ref: '#/components/schemas/Decimal'
                        - description: Interest earned in token denomination
                          example: '1234.56789'
                    interestUsd:
                      allOf:
                        - $ref: '#/components/schemas/Decimal'
                        - description: Interest earned in USD
                          example: '1234.56789'
                    interestSol:
                      allOf:
                        - $ref: '#/components/schemas/Decimal'
                        - description: Interest earned in SOL
                          example: '1234.56789'
                    reserves:
                      type: array
                      items:
                        type: object
                        properties:
                          pubkey:
                            allOf:
                              - $ref: '#/components/schemas/AddressBase58'
                              - description: Public key of the reserve
                                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
                          supplyApy:
                            allOf:
                              - $ref: '#/components/schemas/Apy'
                              - description: Supply Annual Percentage Yield
                                example: '0.2'
                          rewardsApy:
                            allOf:
                              - $ref: '#/components/schemas/Apy'
                              - description: Rewards Annual Percentage Yield
                                example: '0.2'
                          allocationRatio:
                            allOf:
                              - $ref: '#/components/schemas/Decimal'
                              - description: Allocation Ratio
                                example: '1234.56789'
                          rewardTokens:
                            type: array
                            items:
                              type: object
                              properties:
                                tokenMint:
                                  allOf:
                                    - $ref: '#/components/schemas/AddressBase58'
                                    - description: Token mint address
                                      example: >-
                                        VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
                                apy:
                                  allOf:
                                    - $ref: '#/components/schemas/Apy'
                                    - description: >-
                                        Annual Percentage Yield for the reward
                                        token
                                      example: '0.2'
                              required:
                                - tokenMint
                                - apy
                            description: List of reward tokens for the reserve
                        required:
                          - pubkey
                          - supplyApy
                          - rewardsApy
                          - allocationRatio
                          - rewardTokens
                      description: List of reserves with rewards
                    vaultRewards:
                      type: array
                      items:
                        type: object
                        properties:
                          tokenMint:
                            allOf:
                              - $ref: '#/components/schemas/AddressBase58'
                              - description: Token mint address
                                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
                          apy:
                            allOf:
                              - $ref: '#/components/schemas/Apy'
                              - description: >-
                                  Annual Percentage Yield for the vault reward
                                  token
                                example: '0.2'
                        required:
                          - tokenMint
                          - apy
                      description: List of vault reward tokens
                  required:
                    - timestamp
                    - tvl
                    - solTvl
                    - apy
                    - apyTheoretical
                    - apyActual
                    - apyFarmRewards
                    - apyReservesIncentives
                    - apyIncentives
                    - sharePrice
                    - interest
                    - interestUsd
                    - interestSol
                    - reserves
                    - vaultRewards
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/vaults/{pubkey}/allocation-volume/history:
    get:
      summary: Get historical KVault allocation volume
      description: >-
        Get historical Kamino Earn Vault allocation volume for a given vault and
        date range (max 1 year)
      tags:
        - KVaultsVault
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
        - schema:
            anyOf:
              - type: string
              - type: number
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    timestamp:
                      type: string
                      format: date
                      description: Timestamp of the investment volume data point
                    volumeUsd:
                      allOf:
                        - $ref: '#/components/schemas/Decimal'
                        - description: Investment volume in USD
                          example: '1234.56789'
                  required:
                    - timestamp
                    - volumeUsd
                description: Array of investment volume data points
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/users/{pubkey}/metrics/history:
    get:
      summary: Get historical user metrics for all KVault positions
      description: >-
        Get historical timeseries of total usd/sol/interest/apy for all user
        Kamino Earn Vault positions
      tags:
        - KVaultsUser
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the user wallet
                example: AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As
          required: true
          description: Valid base58-encoded address of the user wallet
          name: pubkey
          in: path
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '1970-01-01T00:00:00.000Z'
            description: >-
              Start date of the range (defaults to Unix epoch). Accepts ISO
              string or epoch in ms.
            examples:
              - '1970-01-01T00:00:00.000Z'
              - 0
          required: false
          description: >-
            Start date of the range (defaults to Unix epoch). Accepts ISO string
            or epoch in ms.
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '2025-11-06T12:14:45.537Z'
            description: >-
              End date of the range (defaults to current time). Accepts ISO
              string or epoch in ms.
            examples:
              - '2025-01-01T00:00:00.000Z'
              - 1735689600000
          required: false
          description: >-
            End date of the range (defaults to current time). Accepts ISO string
            or epoch in ms.
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserKVaultTotal'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/users/{pubkey}/transactions:
    get:
      summary: Get user KVault transactions
      description: Get all Kamino Earn Vault transactions for a given user
      tags:
        - KVaultsUser
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the user wallet
                example: AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As
          required: true
          description: Valid base58-encoded address of the user wallet
          name: pubkey
          in: path
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/KVaultInstruction'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/users/{pubkey}/positions:
    get:
      summary: Get all user KVault positions
      description: >-
        Get a list of user positions for each Kamino Earn Vault the user has
        currently deposited into. Returns staked and unstaked shares.
      tags:
        - KVaultsUser
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the user wallet
                example: AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As
          required: true
          description: Valid base58-encoded address of the user wallet
          name: pubkey
          in: path
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/VaultStateArray'
                  - items:
                      type: object
                      properties:
                        vaultAddress:
                          allOf:
                            - $ref: '#/components/schemas/AddressBase58'
                            - description: Address of the Kamino Earn Vault
                              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
                        stakedShares:
                          allOf:
                            - $ref: '#/components/schemas/Decimal'
                            - description: >-
                                The number of Kamino Earn Vault shares staked in
                                a farm
                              example: '1234.56789'
                        unstakedShares:
                          allOf:
                            - $ref: '#/components/schemas/Decimal'
                            - description: >-
                                The number of Kamino Earn Vault shares held in
                                the user wallet
                              example: '1234.56789'
                        totalShares:
                          allOf:
                            - $ref: '#/components/schemas/Decimal'
                            - description: >-
                                The total number of Kamino Earn Vault shares
                                both held and staked by the user
                              example: '1234.56789'
                      required:
                        - vaultAddress
                        - stakedShares
                        - unstakedShares
                        - totalShares
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/users/{userPubkey}/positions/{vaultPubkey}:
    get:
      summary: Get user position for a specific KVault
      description: >-
        Get a single user position for a Kamino Earn Vault the user currently
        has currently deposited into. Returns staked and unstaked shares.
      tags:
        - KVaultsUser
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the vault
                example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
          required: true
          description: Valid base58-encoded address of the vault
          name: vaultPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the user wallet
                example: AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As
          required: true
          description: Valid base58-encoded address of the user wallet
          name: userPubkey
          in: path
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  vaultAddress:
                    allOf:
                      - $ref: '#/components/schemas/AddressBase58'
                      - description: Address of the Kamino Earn Vault
                        example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
                  stakedShares:
                    allOf:
                      - $ref: '#/components/schemas/Decimal'
                      - description: >-
                          The number of Kamino Earn Vault shares staked in a
                          farm
                        example: '1234.56789'
                  unstakedShares:
                    allOf:
                      - $ref: '#/components/schemas/Decimal'
                      - description: >-
                          The number of Kamino Earn Vault shares held in the
                          user wallet
                        example: '1234.56789'
                  totalShares:
                    allOf:
                      - $ref: '#/components/schemas/Decimal'
                      - description: >-
                          The total number of Kamino Earn Vault shares both held
                          and staked by the user
                        example: '1234.56789'
                required:
                  - vaultAddress
                  - stakedShares
                  - unstakedShares
                  - totalShares
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: string
                    description: Error message describing why it was not found
                    example: Account could not be found
                required:
                  - metadata
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/users/{userPubkey}/vaults/{vaultPubkey}/metrics/history:
    get:
      summary: Get historical user metrics for a single KVault
      description: >-
        Get historical timeseries of total usd/sol/interest/apy for a single
        user Kamino Earn Vault position
      tags:
        - KVaultsUser
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the vault
                example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
          required: true
          description: Valid base58-encoded address of the vault
          name: vaultPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the user wallet
                example: AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As
          required: true
          description: Valid base58-encoded address of the user wallet
          name: userPubkey
          in: path
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '1970-01-01T00:00:00.000Z'
            description: >-
              Start date of the range (defaults to Unix epoch). Accepts ISO
              string or epoch in ms.
            examples:
              - '1970-01-01T00:00:00.000Z'
              - 0
          required: false
          description: >-
            Start date of the range (defaults to Unix epoch). Accepts ISO string
            or epoch in ms.
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '2025-11-06T12:14:45.538Z'
            description: >-
              End date of the range (defaults to current time). Accepts ISO
              string or epoch in ms.
            examples:
              - '2025-01-01T00:00:00.000Z'
              - 1735689600000
          required: false
          description: >-
            End date of the range (defaults to current time). Accepts ISO string
            or epoch in ms.
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserKvaultMetrics'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl:
    get:
      summary: Get user KVault PnL
      description: Get current PnL and cost basis of user vault position
      tags:
        - KVaultsUser
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the vault
                example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
          required: true
          description: Valid base58-encoded address of the vault
          name: vaultPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the user wallet
                example: AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As
          required: true
          description: Valid base58-encoded address of the user wallet
          name: userPubkey
          in: path
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KvaultPnl'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history:
    get:
      summary: Get user KVault PnL history
      description: Get PnL and cost basis history of user vault position
      tags:
        - KVaultsUser
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the vault
                example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
          required: true
          description: Valid base58-encoded address of the vault
          name: vaultPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address of the user wallet
                example: AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As
          required: true
          description: Valid base58-encoded address of the user wallet
          name: userPubkey
          in: path
        - schema:
            anyOf:
              - type: string
              - type: number
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  history:
                    type: array
                    items:
                      $ref: '#/components/schemas/KvaultPnlTimeseriesValue'
                  totalPnl:
                    $ref: '#/components/schemas/KvaultMultiValue'
                  totalCostBasis:
                    $ref: '#/components/schemas/KvaultMultiValue'
                required:
                  - history
                  - totalPnl
                  - totalCostBasis
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/mints/{pubkey}/metadata:
    get:
      summary: Get metadata for KVault token
      description: Get metadata for a given Kamino Earn Vault receipt token mint
      tags:
        - KVaultsMint
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                    description: The name of the token
                  symbol:
                    type: string
                    description: The symbol of the token
                  description:
                    type: string
                    description: A description of the token
                  image:
                    type: string
                    format: uri
                    description: A URL pointing to an image of the token
                required:
                  - name
                  - symbol
                  - description
                  - image
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: string
                    description: Error message describing why it was not found
                    example: Account could not be found
                required:
                  - metadata
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kvaults/mints/{pubkey}/metadata/image.svg:
    get:
      summary: Get icon for KVault token
      description: Get the SVG icon for a given Kamino Earn Vault receipt token mint
      tags:
        - KVaultsMint
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
      responses:
        '200':
          description: OK
          content:
            image/svg+xml:
              schema:
                type: string
                description: SVG markup string
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: string
                    description: Error message describing why it was not found
                    example: Account could not be found
                required:
                  - metadata
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/kamino-market:
    get:
      summary: Get all Kamino Markets config
      description: >-
        Get all Kamino Lending markets configuration for a specific program ID.
        This is the V2 endpoint that allows filtering by program ID instead of
        cluster.
      tags:
        - KLendMarkets
      parameters:
        - schema:
            type: string
            default: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
            description: KLend program ID
            example: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
          required: false
          description: KLend program ID
          name: programId
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MarketConfigResponseV2'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kamino-market/{marketPubkey}/reserves/{reservePubkey}/metrics/history:
    get:
      summary: Get KLend reserve history
      description: >-
        Get historical metrics for a specific reserve in a Kamino Lending market
        over a specified time range with configurable frequency (minute, hour,
        or day).
      tags:
        - KLendMarkets
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Kamino Lend market public key
                example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Kamino Lend market public key
          name: marketPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Kamino Lend reserve public key
                example: FBSyPnxtHKLBZ4UeeUyAnbtFuAmTHLtso9YtsqRDRWpM
          required: true
          description: Kamino Lend reserve public key
          name: reservePubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '1970-01-01T00:00:00.000Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '2025-11-06T12:14:45.482Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: end
          in: query
        - schema:
            type: string
            enum:
              - hour
              - day
            default: hour
            description: Frequency of the snapshots
            example: hour
          required: false
          description: Frequency of the snapshots
          name: frequency
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                nullable: true
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/kamino-market/{pubkey}:
    get:
      summary: Get Kamino Market config
      description: >-
        Get configuration for a specific Kamino Lending market by market
        address. Optionally filter by program ID.
      tags:
        - KLendMarkets
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Market public key
          name: pubkey
          in: path
        - schema:
            type: string
            default: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
            description: KLend program ID
            example: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
          required: false
          description: KLend program ID
          name: programId
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketConfigResponseV2'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kamino-market/{pubkey}/leverage/metrics:
    get:
      summary: Get metrics for leverage/multiply vaults
      description: >-
        Get aggregated metrics for all leverage and multiply positions in a
        Kamino Lending market, including average leverage, total borrowed, total
        deposited, and number of obligations.
      tags:
        - KLendMarkets
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Market public key
          name: pubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LeverageMetricsResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kamino-market/{pubkey}/metrics/history:
    get:
      summary: Get KLend Market metrics history
      description: >-
        Get historical metrics (TVL and number of obligations) for a Kamino
        Lending market over a specified time range.
      tags:
        - KLendMarkets
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Market public key
          name: pubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '1970-01-01T00:00:00.000Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '2025-11-06T12:14:45.480Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MarketMetricsResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kamino-market/{pubkey}/reserves/metrics:
    get:
      summary: Get metrics for market reserves
      description: >-
        Get current metrics for all reserves in a Kamino Lending market,
        including APY, TVL, borrow/supply amounts, and LTV ratios.
      tags:
        - KLendMarkets
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Market public key
          name: pubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReserveMetricsResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kamino-market/reserves/account-data:
    get:
      summary: Get KLend market reserves account data
      description: >-
        Fetch reserve account data for given Klend markets. Returns
        base64-encoded account data for all reserves in the specified markets.
      tags:
        - KLendMarkets
      parameters:
        - schema:
            type: string
            default: KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
          required: false
          name: programId
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          required: true
          name: markets
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReserveAccountDataResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /klend/rewards:
    get:
      summary: Get KLend rewards
      description: Fetches all active KLend reward metrics for a specific points source
      tags:
        - KLendRewards
      parameters:
        - schema:
            type: string
            description: Points source identifier
            example: Season1
            examples:
              - Season1
              - Season2
              - Season3
              - Season4
          required: false
          description: Points source identifier
          name: source
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KlendRewardMetrics'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /klend/users/{pubkey}/rewards:
    get:
      summary: Get user KLend rewards
      description: Fetches KLend reward data for a specific user and points source
      tags:
        - KLendRewards
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
        - schema:
            type: string
            description: Points source identifier
            example: Season1
            examples:
              - Season1
              - Season2
              - Season3
              - Season4
          required: false
          description: Points source identifier
          name: source
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KlendUserRewardMetrics'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /klend/{depositReservePubkey}/{borrowReservePubkey}/rewards/history:
    get:
      summary: Get KLend reward history
      description: >-
        Fetches historical KLend reward metrics for a specific deposit and
        borrow reserve pair
      tags:
        - KLendRewards
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Deposit reserve public key
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Deposit reserve public key
          name: depositReservePubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Borrow reserve public key
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Borrow reserve public key
          name: borrowReservePubkey
          in: path
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '1970-01-01T00:00:00.000Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '2025-11-06T12:14:45.561Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: end
          in: query
        - schema:
            type: string
            enum:
              - hour
              - day
            description: Frequency of historical data aggregation
            example: hour
            examples:
              - hour
              - day
          required: false
          description: Frequency of historical data aggregation
          name: frequency
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KlendRewardHistory'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      properties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/metrics/history:
    get:
      summary: Get KLend obligation history
      description: >-
        Get historical metrics for a specific obligation in a Kamino Lending
        market. This V2 endpoint supports using stake rate for obligation value
        calculation when `useStakeRateForObligation` is true.
      tags:
        - KLendUsersAndLoans
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Kamino Lend market public key
                example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Kamino Lend market public key
          name: marketPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Kamino Lend obligation public key
                example: 63QrAB1okxCc4FpsgcKYHjYTp1ua8ch6mLReyKRdc22o
          required: true
          description: Kamino Lend obligation public key
          name: obligationPubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '1970-01-01T00:00:00.000Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            default: '2025-11-06T12:14:45.505Z'
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: end
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
            description: Use stake rate to calculate net SOL value
            example: 'true'
          required: false
          description: Use stake rate to calculate net SOL value
          name: useStakeRateForObligation
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObligationMetricsHistoryResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl:
    get:
      summary: Get profit and loss for an obligation
      description: >-
        Get profit and loss (PnL) for a specific obligation. You can specify PnL
        mode with query param `positionMode` (obligation_all_time or
        current_obligation). For xSOL pairs, `useStakeRate` can be set to true
        to calculate the PnL using the stake rate.
      tags:
        - KLendUsersAndLoans
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Kamino Lend market public key
                example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Kamino Lend market public key
          name: marketPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Kamino Lend obligation public key
                example: 63QrAB1okxCc4FpsgcKYHjYTp1ua8ch6mLReyKRdc22o
          required: true
          description: Kamino Lend obligation public key
          name: obligationPubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
        - schema:
            type: string
            enum:
              - obligation_all_time
              - current_obligation
            default: current_obligation
            description: Position mode for PnL calculation
            example: current_obligation
          required: false
          description: Position mode for PnL calculation
          name: positionMode
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
            description: For xSOL pairs, calculate the PnL using the stake rate
            example: 'true'
          required: false
          description: For xSOL pairs, calculate the PnL using the stake rate
          name: useStakeRate
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PnlResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /kamino-market/{marketPubkey}/users/{userPubkey}/obligations:
    get:
      summary: Get all user obligations
      description: >-
        Get all obligations (loans) for a specific user wallet in a Kamino
        Lending market.
      tags:
        - KLendUsersAndLoans
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Kamino Lend market public key
                example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
          required: true
          description: Kamino Lend market public key
          name: marketPubkey
          in: path
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: User wallet public key
                example: AcNSmd5CxwLs21TYUmhWt7CW2v159TdYRkvQxb1iBYRj
          required: true
          description: User wallet public key
          name: userPubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                nullable: true
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /klend/loans/{pubkey}:
    get:
      summary: Get information about a loan (obligation)
      description: Fetches information about a loan
      tags:
        - KLendUsersAndLoans
      parameters:
        - schema:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Valid base58-encoded address
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          required: true
          description: Valid base58-encoded address
          name: pubkey
          in: path
        - schema:
            type: string
            enum:
              - mainnet-beta
              - devnet
              - localnet
            default: mainnet-beta
            description: Solana cluster environment
            example: mainnet-beta
          required: false
          description: Solana cluster environment
          name: env
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoanInfo'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: string
                    description: Error message describing why it was not found
                    example: Account could not be found
                required:
                  - metadata
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /ktx/kvault/deposit:
    post:
      summary: Get transaction to deposit into a kvault
      tags:
        - KVaultsTxDeposit
      description: Deposit tokens into a specified Kamino Earn Vault
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                kvault:
                  description: Target Kamino vault address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                amount:
                  description: Amount to deposit (in decimal format, not lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - kvault
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction:
                    description: Encoded transaction ready to send
                    type: string
                    example: >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=
                required:
                  - transaction
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/kvault/deposit-instructions:
    post:
      summary: Get instructions to deposit into a kvault
      tags:
        - KVaultsTxDeposit
      description: >-
        Instructions to deposit tokens into a specified Kamino Earn Vault.
        Additionally includes lookup tables to use to compress transaction size
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                kvault:
                  description: Target Kamino vault address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                amount:
                  description: Amount to deposit (in decimal format, not lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - kvault
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  instructions:
                    type: array
                    items:
                      type: object
                      properties:
                        accounts:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              role:
                                type: string
                              signer:
                                type: object
                                properties:
                                  address:
                                    type: string
                                required:
                                  - address
                            required:
                              - address
                              - role
                            example:
                              address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                              role: WRITABLE_SIGNER
                              signer:
                                address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                        data:
                          anyOf:
                            - type: string
                            - type: 'null'
                          example: 8iPGiVLh8rYA4fUFAAAAAA==
                        programAddress:
                          type: string
                          example: KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd
                      required:
                        - accounts
                        - data
                        - programAddress
                  lutsByAddress:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        description: Referenced LUT address
                        type: string
                    example:
                      9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu:
                        - sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH
                        - HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                        - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                required:
                  - instructions
                  - lutsByAddress
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/kvault/withdraw:
    post:
      summary: Get transaction to withdraw from a kvault
      tags:
        - KVaultsTxWithdraw
      description: Withdraw tokens from a specified Kamino Earn Vault
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                kvault:
                  description: Target Kamino vault address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                amount:
                  description: >-
                    Amount to withdraw (in decimal format, not lamports), use
                    U64::MAX to withdraw all
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - kvault
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction:
                    description: Encoded transaction ready to send
                    type: string
                    example: >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=
                required:
                  - transaction
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/kvault/withdraw-instructions:
    post:
      summary: Get instructions to withdraw from a kvault
      tags:
        - KVaultsTxWithdraw
      description: >-
        Instructions to withdraw tokens from a specified Kamino Earn Vault.
        Additionally includes lookup tables to use to compress transaction size
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                kvault:
                  description: Target Kamino vault address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                amount:
                  description: >-
                    Amount to withdraw (in decimal format, not lamports), use
                    U64::MAX to withdraw all
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - kvault
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  instructions:
                    type: array
                    items:
                      type: object
                      properties:
                        accounts:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              role:
                                type: string
                              signer:
                                type: object
                                properties:
                                  address:
                                    type: string
                                required:
                                  - address
                            required:
                              - address
                              - role
                            example:
                              address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                              role: WRITABLE_SIGNER
                              signer:
                                address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                        data:
                          anyOf:
                            - type: string
                            - type: 'null'
                          example: 8iPGiVLh8rYA4fUFAAAAAA==
                        programAddress:
                          type: string
                          example: KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd
                      required:
                        - accounts
                        - data
                        - programAddress
                  lutsByAddress:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        description: Referenced LUT address
                        type: string
                    example:
                      9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu:
                        - sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH
                        - HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                        - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                required:
                  - instructions
                  - lutsByAddress
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/deposit:
    post:
      summary: Get transaction to deposit into a klend reserve
      tags:
        - KLendTxDeposit
      description: Deposit tokens into the specified Kamino Lend market reserve
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: >-
                    Amount of liquidity token to deposit (in decimal format, not
                    lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction:
                    description: Encoded transaction ready to send
                    type: string
                    example: >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=
                required:
                  - transaction
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/deposit-instructions:
    post:
      summary: Get instructions to deposit into a klend reserve
      tags:
        - KLendTxDeposit
      description: >-
        Instructions to deposit tokens into the specified Kamino Lend market
        reserve. Additionally includes lookup tables to use to compress
        transaction size
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: >-
                    Amount of liquidity token to deposit (in decimal format, not
                    lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  instructions:
                    type: array
                    items:
                      type: object
                      properties:
                        accounts:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              role:
                                type: string
                              signer:
                                type: object
                                properties:
                                  address:
                                    type: string
                                required:
                                  - address
                            required:
                              - address
                              - role
                            example:
                              address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                              role: WRITABLE_SIGNER
                              signer:
                                address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                        data:
                          anyOf:
                            - type: string
                            - type: 'null'
                          example: 8iPGiVLh8rYA4fUFAAAAAA==
                        programAddress:
                          type: string
                          example: KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd
                      required:
                        - accounts
                        - data
                        - programAddress
                  lutsByAddress:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        description: Referenced LUT address
                        type: string
                    example:
                      9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu:
                        - sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH
                        - HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                        - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                required:
                  - instructions
                  - lutsByAddress
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/borrow:
    post:
      summary: Get transaction to borrow liquidity from a klend reserve
      tags:
        - KLendTxBorrow
      description: Borrow liquidity from the specified Kamino Lend market reserve
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: >-
                    Amount of liquidity token to borrow (in decimal format, not
                    lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction:
                    description: Encoded transaction ready to send
                    type: string
                    example: >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=
                required:
                  - transaction
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/borrow-instructions:
    post:
      summary: Get instructions to borrow liquidity from a klend reserve
      tags:
        - KLendTxBorrow
      description: >-
        Instructions to borrow liquidity from the specified Kamino Lend market
        reserve. Additionally includes lookup tables to use to compress
        transaction size
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: >-
                    Amount of liquidity token to borrow (in decimal format, not
                    lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  instructions:
                    type: array
                    items:
                      type: object
                      properties:
                        accounts:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              role:
                                type: string
                              signer:
                                type: object
                                properties:
                                  address:
                                    type: string
                                required:
                                  - address
                            required:
                              - address
                              - role
                            example:
                              address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                              role: WRITABLE_SIGNER
                              signer:
                                address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                        data:
                          anyOf:
                            - type: string
                            - type: 'null'
                          example: 8iPGiVLh8rYA4fUFAAAAAA==
                        programAddress:
                          type: string
                          example: KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd
                      required:
                        - accounts
                        - data
                        - programAddress
                  lutsByAddress:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        description: Referenced LUT address
                        type: string
                    example:
                      9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu:
                        - sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH
                        - HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                        - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                required:
                  - instructions
                  - lutsByAddress
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/repay:
    post:
      summary: Get transaction to repay debt of a klend reserve
      tags:
        - KLendTxRepay
      description: Repay a debt position for the specified Kamino Lend market reserve
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: Amount of debt to repay (in decimal format, not lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction:
                    description: Encoded transaction ready to send
                    type: string
                    example: >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=
                required:
                  - transaction
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/repay-instructions:
    post:
      summary: Get instructions to repay debt of a klend reserve
      tags:
        - KLendTxRepay
      description: >-
        Instructions to repay a debt position for the specified Kamino Lend
        market reserve. Additionally includes lookup tables to use to compress
        transaction size
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: Amount of debt to repay (in decimal format, not lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  instructions:
                    type: array
                    items:
                      type: object
                      properties:
                        accounts:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              role:
                                type: string
                              signer:
                                type: object
                                properties:
                                  address:
                                    type: string
                                required:
                                  - address
                            required:
                              - address
                              - role
                            example:
                              address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                              role: WRITABLE_SIGNER
                              signer:
                                address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                        data:
                          anyOf:
                            - type: string
                            - type: 'null'
                          example: 8iPGiVLh8rYA4fUFAAAAAA==
                        programAddress:
                          type: string
                          example: KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd
                      required:
                        - accounts
                        - data
                        - programAddress
                  lutsByAddress:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        description: Referenced LUT address
                        type: string
                    example:
                      9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu:
                        - sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH
                        - HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                        - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                required:
                  - instructions
                  - lutsByAddress
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/withdraw:
    post:
      summary: Get transaction to withdraw from a klend reserve
      tags:
        - KLendTxWithdraw
      description: Withdraw tokens from the specified Kamino Lend market reserve
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: >-
                    Amount of liquidity token to withdraw (in decimal format,
                    not lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transaction:
                    description: Encoded transaction ready to send
                    type: string
                    example: >-
                      AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAEB4U90z775Z0G20Lzbx64AwbcGsJTUS+D6M2d1yQDvRL+MXyh2DY6ZPXvcFUmkblzqU7UrFcH4BAOPAPQXUWHKZS66KvlDTwMypF/H+icat/xVYNA0OvZ+RMaheXL0QJajAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD9ps6fZhmN2HDYqYbzBnXEb4Pi9Sg0h5UvXVBWPj73qMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WQTZCvHbiTnsNf+U2WQNV9zDJ5S7Phu2b9OuhJqE3NuUsuvLnkdJfjUAGox8/57aeYKvmQtCaruy3qoGNzwovloCBQYAAQAHAxEBAQYRAAsIDw0HAgEQEREEBgoJDgwQ8iPGiVLh8rYA4fUFAAAAAAGC6dRmw0Z9LrKw2cy+tHvb9JXuHBu0d9Dar60DX6fr5AUFLxMJAQYVBAsCBwM=
                required:
                  - transaction
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
  /ktx/klend/withdraw-instructions:
    post:
      summary: Get instructions to withdraw from a klend reserve
      tags:
        - KLendTxWithdraw
      description: >-
        Instructions to withdraw tokens from the specified Kamino Lend market
        reserve. Additionally includes lookup tables to use to compress
        transaction size
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                wallet:
                  description: >-
                    User wallet address (base58) that will also sign the
                    transaction
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: KUMtRazMP7vwvc2kthnGZ9Cq6ZsGRiYC97snMYepNx9
                market:
                  description: Target Kamino Lend market address
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
                reserve:
                  description: >-
                    Target Kamino Lend Reserve address. The reserve must belong
                    to the specified market
                  format: solana-base58-address
                  minLength: 32
                  maxLength: 44
                  type: string
                  example: D6q6wuQSrifJKZYpR1M8R4YawnLDtDsMmWM1NbBmgJ59
                amount:
                  description: >-
                    Amount of liquidity token to withdraw (in decimal format,
                    not lamports)
                  format: decimal-positive-amount
                  type: string
                  example: '0.1234'
              required:
                - wallet
                - market
                - reserve
                - amount
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  instructions:
                    type: array
                    items:
                      type: object
                      properties:
                        accounts:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              role:
                                type: string
                              signer:
                                type: object
                                properties:
                                  address:
                                    type: string
                                required:
                                  - address
                            required:
                              - address
                              - role
                            example:
                              address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                              role: WRITABLE_SIGNER
                              signer:
                                address: 9y7uLMUMW6EiRwH1aJFSp9Zka7dVx2JdZKA3858u6YHT
                        data:
                          anyOf:
                            - type: string
                            - type: 'null'
                          example: 8iPGiVLh8rYA4fUFAAAAAA==
                        programAddress:
                          type: string
                          example: KvauGMspG5k6rtzrqqn7WNn3oZdyKqLKwK2XWQ8FLjd
                      required:
                        - accounts
                        - data
                        - programAddress
                  lutsByAddress:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        description: Referenced LUT address
                        type: string
                    example:
                      9p2oT9J6BojHigd3V5qXzrwsQf4dtgMgLxtrzLVR3rwu:
                        - sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH
                        - HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E
                        - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                required:
                  - instructions
                  - lutsByAddress
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    description: HTTP error code
                    type: number
                    example: 400
                  message:
                    description: Error message describing the issue
                    type: string
                  error:
                    description: Short description of the http status code
                    type: string
                    example: Bad Request
                  code:
                    description: Kamino error code
                    anyOf:
                      - type: string
                        enum:
                          - DECIMAL_TO_LAMPORTS_OVERFLOW
                      - type: string
                        enum:
                          - KLEND_MARKET_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_OBLIGATION_NOT_FOUND
                      - type: string
                        enum:
                          - KLEND_RESERVE_NOT_FOUND
                      - type: string
                        enum:
                          - KVAULT_NOT_FOUND
                      - type: string
                        enum:
                          - TRANSACTION_SIZE_ERROR
                required:
                  - statusCode
                  - message
                  - error
components:
  schemas:
    AddressBase58:
      type: string
      description: Market public key
      example: 9pMFoVgsG2cNiUCSBEE69iWFN7c1bz9gu9TtPeXkAMTs
    Apy:
      type: string
      description: Borrow interest APY
      example: '0.027610992938039702'
      examples:
        - '0.123'
        - '0'
        - '1'
        - '1.23'
        - '-0.5'
        - '999999.999999'
    Decimal:
      type: string
      description: Total Value Locked in USD
      example: '234.14377328764223'
      examples:
        - '0.123'
        - '0'
        - '1'
        - '1.23'
        - '-42.0'
        - '999999.999999'
    KvaultRewardMetric:
      type: object
      properties:
        kvault:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Address of the kvault
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        rewardToken:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Mint address of the reward token
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        lastCalculated:
          type: string
          format: date
          description: Timestamp of the last calculation
        apy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Annual Percentage Yield from rewards in the kvault
              example: '0.2'
        tokensPerSecond:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Number of reward tokens distributed per second
              example: '1234.56789'
      required:
        - kvault
        - rewardToken
        - lastCalculated
        - apy
        - tokensPerSecond
    KvaultRewardMetrics:
      type: array
      items:
        $ref: '#/components/schemas/KvaultRewardMetric'
      description: List of kvault reward metrics
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message for internal server failure
          example: An internal error occurred
      required:
        - error
      description: Internal server error response (500)
      example:
        error: An internal error occurred
    The vault state object:
      type: object
      properties:
        vaultAdminAuthority:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the vault admin authority
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        baseVaultAuthority:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the base vault authority
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        baseVaultAuthorityBump:
          type: number
          description: Bump seed for the base vault authority
        tokenMint:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the token mint
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        tokenMintDecimals:
          type: number
          description: Decimals of the token mint
        tokenVault:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the token vault
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        tokenProgram:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the token program
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        sharesMint:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the shares mint
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        sharesMintDecimals:
          type: number
          description: Decimals of the shares mint
        tokenAvailable:
          type: string
          description: Amount of tokens available in the vault
        sharesIssued:
          type: string
          description: Total shares issued by the vault
        availableCrankFunds:
          type: string
          description: Available crank funds in the vault
        performanceFeeBps:
          type: number
          description: Performance fee in basis points
        managementFeeBps:
          type: number
          description: Management fee in basis points
        lastFeeChargeTimestamp:
          type: number
          description: Timestamp of the last fee charge
        prevAum:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Previous assets under management scaled factor
              example: '1234.56789'
        pendingFees:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Pending fees scaled factor
              example: '1234.56789'
        vaultAllocationStrategy:
          type: array
          items:
            type: object
            properties:
              reserve:
                allOf:
                  - $ref: '#/components/schemas/AddressBase58'
                  - description: Public key of the reserve
                    example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
              ctokenVault:
                allOf:
                  - $ref: '#/components/schemas/AddressBase58'
                  - description: Public key of the cToken vault
                    example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
              targetAllocationWeight:
                type: number
                description: Target allocation weight as a whole number
              tokenAllocationCap:
                type: string
                description: Token allocation cap in lamports
              ctokenVaultBump:
                type: number
                description: cToken vault bump seed
              ctokenAllocation:
                type: string
                description: cToken allocation in lamports
              lastInvestSlot:
                type: string
                description: Last invest slot
              tokenTargetAllocation:
                allOf:
                  - $ref: '#/components/schemas/Decimal'
                  - description: Token target allocation scaled factor
                    example: '1234.56789'
            required:
              - reserve
              - ctokenVault
              - targetAllocationWeight
              - tokenAllocationCap
              - ctokenVaultBump
              - ctokenAllocation
              - lastInvestSlot
              - tokenTargetAllocation
            description: Vault allocation strategy entry
          description: List of vault allocation strategies
        minDepositAmount:
          type: string
          description: Minimum deposit amount in lamports
        minWithdrawAmount:
          type: string
          description: Minimum withdraw amount in lamports
        minInvestAmount:
          type: string
          description: Minimum invest amount in lamports
        minInvestDelaySlots:
          type: number
          description: Minimum invest delay in slots
        crankFundFeePerReserve:
          type: string
          description: Crank fund fee per reserve
        pendingAdmin:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the pending admin
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        cumulativeEarnedInterest:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative earned interest in decimal format
              example: '1234.56789'
        cumulativeMgmtFees:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative management fees in decimal format
              example: '1234.56789'
        cumulativePerfFees:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative performance fees in decimal format
              example: '1234.56789'
        name:
          type: string
          description: Name of the vault
        vaultLookupTable:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the vault lookup table
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        vaultFarm:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the vault farm
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        creationTimestamp:
          type: number
          description: Timestamp of vault creation
        allocationAdmin:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Public key of the allocation admin
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
      required:
        - vaultAdminAuthority
        - baseVaultAuthority
        - baseVaultAuthorityBump
        - tokenMint
        - tokenMintDecimals
        - tokenVault
        - tokenProgram
        - sharesMint
        - sharesMintDecimals
        - tokenAvailable
        - sharesIssued
        - availableCrankFunds
        - performanceFeeBps
        - managementFeeBps
        - lastFeeChargeTimestamp
        - prevAum
        - pendingFees
        - vaultAllocationStrategy
        - minDepositAmount
        - minWithdrawAmount
        - minInvestAmount
        - minInvestDelaySlots
        - crankFundFeePerReserve
        - pendingAdmin
        - cumulativeEarnedInterest
        - cumulativeMgmtFees
        - cumulativePerfFees
        - name
        - vaultLookupTable
        - vaultFarm
        - creationTimestamp
        - allocationAdmin
    VaultStateArray:
      type: array
      items:
        type: object
        properties:
          address:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Public key of the vault
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
          state:
            $ref: '#/components/schemas/The vault state object'
          programId:
            allOf:
              - $ref: '#/components/schemas/AddressBase58'
              - description: Public key of the kvault program which owns the vault
                example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        required:
          - address
          - state
          - programId
    KvaultMetrics:
      type: object
      properties:
        apy7d:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: 7-day Annual Percentage Yield of the kvault
              example: '0.2'
        apy24h:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: 24-hour Annual Percentage Yield of the kvault
              example: '0.2'
        apy30d:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: 30-day Annual Percentage Yield of the kvault
              example: '0.2'
        apy90d:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: 90-day Annual Percentage Yield of the kvault
              example: '0.2'
        apy180d:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: 180-day Annual Percentage Yield of the kvault
              example: '0.2'
        apy365d:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: 365-day Annual Percentage Yield of the kvault
              example: '0.2'
        tokenPrice:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Price of the kvault token
              example: '1234.56789'
        solPrice:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Price of SOL
              example: '1234.56789'
        tokensAvailable:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Number of tokens available in the kvault
              example: '1234.56789'
        tokensAvailableUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: USD value of tokens available in the kvault
              example: '1234.56789'
        tokensInvested:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Number of tokens invested in the kvault
              example: '1234.56789'
        tokensInvestedUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: USD value of tokens invested in the kvault
              example: '1234.56789'
        sharePrice:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Price per share of the kvault
              example: '1234.56789'
        tokensPerShare:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Number of tokens per share in the kvault
              example: '1234.56789'
        apy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Annual Percentage Yield of the kvault
              example: '0.2'
        apyTheoretical:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Theoretical Annual Percentage Yield of the kvault
              example: '0.2'
        apyActual:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Actual Annual Percentage Yield of the kvault
              example: '0.2'
        apyFarmRewards:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Annual Percentage Yield from farm rewards in the kvault
              example: '0.2'
        apyIncentives:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Annual Percentage Yield from incentives in the kvault
              example: '0.2'
        apyReservesIncentives:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Annual Percentage Yield from reserves incentives in the kvault
              example: '0.2'
        numberOfHolders:
          type: number
          description: Number of holders of the kvault
        sharesIssued:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total shares issued by the kvault
              example: '1234.56789'
        cumulativeInterestEarned:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative interest earned in the kvault token amount
              example: '1234.56789'
        cumulativeInterestEarnedUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative interest earned in USD for the kvault
              example: '1234.56789'
        cumulativeInterestEarnedSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative interest earned in SOL for the kvault
              example: '1234.56789'
        interestEarnedPerSecond:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second in the kvault token amount
              example: '1234.56789'
        interestEarnedPerSecondUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second in USD for the kvault
              example: '1234.56789'
        interestEarnedPerSecondSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second in SOL for the kvault
              example: '1234.56789'
        cumulativePerformanceFees:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative performance fees in the kvault token amount
              example: '1234.56789'
        cumulativePerformanceFeesUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative performance fees in USD for the kvault
              example: '1234.56789'
        cumulativePerformanceFeesSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative performance fees in SOL for the kvault
              example: '1234.56789'
        cumulativeManagementFees:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative management fees in the kvault token amount
              example: '1234.56789'
        cumulativeManagementFeesUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative management fees in USD for the kvault
              example: '1234.56789'
        cumulativeManagementFeesSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Cumulative management fees in SOL for the kvault
              example: '1234.56789'
      required:
        - apy7d
        - apy24h
        - apy30d
        - apy90d
        - apy180d
        - apy365d
        - tokenPrice
        - solPrice
        - tokensAvailable
        - tokensAvailableUsd
        - tokensInvested
        - tokensInvestedUsd
        - sharePrice
        - tokensPerShare
        - apy
        - apyTheoretical
        - apyActual
        - apyFarmRewards
        - apyIncentives
        - apyReservesIncentives
        - numberOfHolders
        - sharesIssued
        - cumulativeInterestEarned
        - cumulativeInterestEarnedUsd
        - cumulativeInterestEarnedSol
        - interestEarnedPerSecond
        - interestEarnedPerSecondUsd
        - interestEarnedPerSecondSol
        - cumulativePerformanceFees
        - cumulativePerformanceFeesUsd
        - cumulativePerformanceFeesSol
        - cumulativeManagementFees
        - cumulativeManagementFeesUsd
        - cumulativeManagementFeesSol
    SnapshotDateTime:
      type: string
      format: date-time
      description: Timestamp of the metrics snapshot
      example: '2023-06-29T15:15:26.464Z'
    UserKVaultTotal:
      type: object
      properties:
        createdOn:
          allOf:
            - $ref: '#/components/schemas/SnapshotDateTime'
            - description: Timestamp when the snapshot was created (ISO 8601 format)
              example: '2025-03-01T12:00:00.000Z'
        usdAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: User's total amount across all vaults in USD
              example: '1234.56789'
        solAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: User's total amount across all vaults in SOL
              example: '1234.56789'
        weightedApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Weighted average APY across all vaults in decimal format
              example: '0.2'
        cumulativeInterestEarnedUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total interest earned in USD across all vaults
              example: '1234.56789'
        cumulativeInterestEarnedSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total interest earned in SOL across all vaults
              example: '1234.56789'
        interestEarnedPerSecondUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second at that specific moment in USD
              example: '1234.56789'
        interestEarnedPerSecondSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second at that specific moment in SOL
              example: '1234.56789'
      required:
        - createdOn
        - usdAmount
        - solAmount
        - weightedApy
        - cumulativeInterestEarnedUsd
        - cumulativeInterestEarnedSol
        - interestEarnedPerSecondUsd
        - interestEarnedPerSecondSol
    KVaultInstruction:
      type: object
      properties:
        createdOn:
          type: string
          format: date
          description: Date when the instruction was created
        instruction:
          type: string
          description: Type of instruction
        tokenMint:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Token mint address
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        tokenAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Amount of tokens involved
              example: '1234.56789'
        tokenPrice:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Price of the token at the time of instruction
              example: '1234.56789'
        solPrice:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Price of SOL at the time of instruction
              example: '1234.56789'
        sharePrice:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Price per share at the time of instruction
              example: '1234.56789'
        numberOfShares:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Number of shares involved
              example: '1234.56789'
        usdValue:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: USD value of the transaction
              example: '1234.56789'
        transaction:
          type: string
          description: Transaction signature
        kvault:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: KVault identifier
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        latestPosition:
          type: boolean
          description: Indicates if this is the latest position
      required:
        - createdOn
        - instruction
        - tokenMint
        - tokenAmount
        - tokenPrice
        - solPrice
        - sharePrice
        - numberOfShares
        - usdValue
        - transaction
        - kvault
        - latestPosition
    UserKvaultMetrics:
      type: object
      properties:
        createdOn:
          allOf:
            - $ref: '#/components/schemas/SnapshotDateTime'
            - description: Timestamp when the snapshot was created (ISO 8601 format)
              example: '2025-03-01T12:00:00.000Z'
        sharesAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: User's total shares amount
              example: '1234.56789'
        usdAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: User's USD amount in kvault
              example: '1234.56789'
        solAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: User's SOL amount in kvault
              example: '1234.56789'
        apy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: >-
                APY in decimal format (not percentage) represented as string.
                Multiply by 100 to get percentage (%) - 0.1 in API response is
                10%.
              example: '0.2'
        cumulativeInterestEarned:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total interest earned in kvault token amount for kvault
              example: '1234.56789'
        cumulativeInterestEarnedUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total interest earned in USD for kvault
              example: '1234.56789'
        cumulativeInterestEarnedSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total interest earned in SOL for kvault
              example: '1234.56789'
        interestEarnedPerSecond:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second at that specific moment in token
              example: '1234.56789'
        interestEarnedPerSecondUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second at that specific moment in USD
              example: '1234.56789'
        interestEarnedPerSecondSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Interest earned per second at that specific moment in SOL
              example: '1234.56789'
      required:
        - createdOn
        - sharesAmount
        - usdAmount
        - solAmount
        - apy
        - cumulativeInterestEarned
        - cumulativeInterestEarnedUsd
        - cumulativeInterestEarnedSol
        - interestEarnedPerSecond
        - interestEarnedPerSecondUsd
        - interestEarnedPerSecondSol
    KvaultMultiValue:
      type: object
      properties:
        usd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Value in USD
              example: '1234.56789'
        sol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Value in SOL
              example: '1234.56789'
        token:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Value in token denomination
              example: '1234.56789'
      required:
        - usd
        - sol
        - token
    KvaultPnl:
      type: object
      properties:
        totalPnl:
          $ref: '#/components/schemas/KvaultMultiValue'
        totalCostBasis:
          $ref: '#/components/schemas/KvaultMultiValue'
      required:
        - totalPnl
        - totalCostBasis
    KvaultPnlTimeseriesValue:
      type: object
      properties:
        timestamp:
          type: number
          description: Unix timestamp in milliseconds
        type:
          anyOf:
            - type: string
              enum:
                - buy
            - type: string
              enum:
                - sell
            - type: string
              enum:
                - mark-to-market
        position:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Current position value
              example: '1234.56789'
        quantity:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Quantity involved in transaction
              example: '1234.56789'
        tokenPrice:
          allOf:
            - $ref: '#/components/schemas/KvaultMultiValue'
            - description: Token price snapshot
        sharePrice:
          allOf:
            - $ref: '#/components/schemas/KvaultMultiValue'
            - description: Share price snapshot
        costBasis:
          allOf:
            - $ref: '#/components/schemas/KvaultMultiValue'
            - description: Cost basis for position
        realizedPnl:
          allOf:
            - $ref: '#/components/schemas/KvaultMultiValue'
            - description: Realized profit/loss
        pnl:
          allOf:
            - $ref: '#/components/schemas/KvaultMultiValue'
            - description: Total profit/loss
        positionValue:
          allOf:
            - $ref: '#/components/schemas/KvaultMultiValue'
            - description: Value of the position
        investment:
          allOf:
            - $ref: '#/components/schemas/KvaultMultiValue'
            - description: Total invested value
      required:
        - timestamp
        - type
        - position
        - quantity
        - tokenPrice
        - sharePrice
        - costBasis
        - realizedPnl
        - pnl
        - positionValue
        - investment
    MarketConfigResponseV2:
      type: object
      properties:
        name:
          type: string
          description: Market name
          example: Main Market
        isPrimary:
          type: boolean
          description: Whether this is a primary market
          example: true
        description:
          type: string
          description: Market description
          example: Primary market on mainnet
        lendingMarket:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Lending market public key
              example: 7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF
        lookupTable:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Lookup table address
              example: FGMSBiyVE8TvZcdQnZETAAKw28tkQJ2ccZy6pyp95URb
        isCurated:
          type: boolean
          description: Whether this market is curated
          example: false
      required:
        - name
        - isPrimary
        - description
        - lendingMarket
        - lookupTable
        - isCurated
    LeverageMetricsResponse:
      type: object
      properties:
        avgLeverage:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Average leverage
              example: '1234.56789'
        totalBorrowed:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total borrowed amount
              example: '1234.56789'
        totalDeposited:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total deposited amount
              example: '1234.56789'
        totalBorrowedUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total borrowed in USD
              example: '1234.56789'
        totalObligations:
          type: string
          description: Total number of obligations
        totalDepositedUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total deposited in USD
              example: '1234.56789'
        tvl:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total Value Locked
              example: '1234.56789'
        updatedOn:
          type: string
          format: date-time
          description: Last update timestamp
        depositReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Deposit reserve public key
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        borrowReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Borrow reserve public key
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        tag:
          type: string
          description: Tag (Multiply or Leverage)
          example: Multiply
      required:
        - avgLeverage
        - totalBorrowed
        - totalDeposited
        - totalBorrowedUsd
        - totalObligations
        - totalDepositedUsd
        - tvl
        - updatedOn
        - depositReserve
        - borrowReserve
        - tag
    MarketMetricsResponse:
      type: object
      properties:
        market:
          $ref: '#/components/schemas/AddressBase58'
        timestamp:
          $ref: '#/components/schemas/SnapshotDateTime'
        metrics:
          type: object
          properties:
            tvl:
              $ref: '#/components/schemas/Decimal'
            obligations:
              type: integer
              description: Number of obligations
              example: 38
          required:
            - tvl
            - obligations
          description: Market metrics
      required:
        - market
        - timestamp
        - metrics
    ReserveMetricsResponse:
      type: object
      properties:
        reserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Reserve public key
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        liquidityToken:
          type: string
          description: Liquidity token symbol
          example: SOL
        liquidityTokenMint:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Liquidity token mint address
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        maxLtv:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Maximum loan-to-value ratio
              example: '0.65'
        borrowApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Current borrow APY
              example: '0.05450988511483601'
        supplyApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Current supply APY
              example: '0.038266801210808055'
        totalSupply:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total supply amount
              example: '1234.56789'
        totalBorrow:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total borrow amount
              example: '1234.56789'
        totalBorrowUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total borrow in USD
              example: '1234.56789'
        totalSupplyUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total supply in USD
              example: '1234.56789'
      required:
        - reserve
        - liquidityToken
        - liquidityTokenMint
        - maxLtv
        - borrowApy
        - supplyApy
        - totalSupply
        - totalBorrow
        - totalBorrowUsd
        - totalSupplyUsd
    ReserveAccountDataResponse:
      type: object
      properties:
        market:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        reserves:
          type: array
          items:
            type: object
            properties:
              pubkey:
                allOf:
                  - $ref: '#/components/schemas/AddressBase58'
                  - description: Reserve public key
                    example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
              data:
                type: string
                description: Base64 encoded reserve account data
            required:
              - pubkey
              - data
      required:
        - market
        - reserves
    KlendRewardMetric:
      type: object
      properties:
        depositReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - nullable: true
              description: Deposit reserve public key, if applicable
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        borrowReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - nullable: true
              description: Borrow reserve public key, if applicable
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        market:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        rewardToken:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Mint address of the reward token
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        lastCalculated:
          type: string
          format: date-time
          description: Timestamp of the last calculation
        apy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Annual Percentage Yield from rewards
              example: '0.2'
        tokensPerSecond:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Number of reward tokens distributed per second
              example: '1234.56789'
        activePositionsUsd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total USD value of active positions receiving rewards
              example: '1234.56789'
      required:
        - depositReserve
        - borrowReserve
        - market
        - rewardToken
        - lastCalculated
        - apy
        - tokensPerSecond
        - activePositionsUsd
    KlendRewardMetrics:
      type: array
      items:
        $ref: '#/components/schemas/KlendRewardMetric'
      description: List of klend reward metrics
    KlendUserRewardMetric:
      type: object
      properties:
        depositReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - nullable: true
              description: Deposit reserve public key, if applicable
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        borrowReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - nullable: true
              description: Borrow reserve public key, if applicable
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        market:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        rewardMint:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Mint address of the reward token
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        lastCalculated:
          type: string
          format: date
          description: Timestamp of the last calculation
        tokensEarned:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total number of reward tokens earned by the user
              example: '1234.56789'
        tokensPerSecond:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Number of reward tokens distributed per second to the user
              example: '1234.56789'
        stakingBoost:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Staking boost percentage applied to the user
              example: '1234.56789'
        effectiveStakingBoost:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Effective staking boost percentage for the user
              example: '1234.56789'
        baseApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Base Annual Percentage Yield from rewards for the user
              example: '0.2'
        boostedApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Boosted Annual Percentage Yield from rewards for the user
              example: '0.2'
        maxApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Max Annual Percentage Yield from rewards for the user
              example: '0.2'
        usdAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total USD amount of rewards earned by the user without boost
              example: '1234.56789'
        usdAmountBoosted:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: >-
                Total USD amount of rewards earned by the user with boost
                applied
              example: '1234.56789'
      required:
        - depositReserve
        - borrowReserve
        - market
        - rewardMint
        - lastCalculated
        - tokensEarned
        - tokensPerSecond
        - stakingBoost
        - effectiveStakingBoost
        - baseApy
        - boostedApy
        - maxApy
        - usdAmount
        - usdAmountBoosted
    KlendUserRewardMetrics:
      type: object
      properties:
        avgBaseApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Weighted average Base Annual Percentage Yield for the user
              example: '0.2'
        avgBoostedApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Weighted average Boosted Annual Percentage Yield for the user
              example: '0.2'
        avgMaxApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Weighted average Max Annual Percentage Yield for the user
              example: '0.2'
        rewards:
          type: array
          items:
            $ref: '#/components/schemas/KlendUserRewardMetric'
          description: List of klend user reward metrics
      required:
        - avgBaseApy
        - avgBoostedApy
        - avgMaxApy
        - rewards
    KlendRewardHistoryRow:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Timestamp of the data point
        depositReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - nullable: true
              description: Deposit reserve public key, if applicable
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        borrowReserve:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - nullable: true
              description: Borrow reserve public key, if applicable
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        rewardToken:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Mint address of the reward token
              example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
        rewardApy:
          allOf:
            - $ref: '#/components/schemas/Apy'
            - description: Annual Percentage Yield from rewards at this point in time
              example: '0.2'
      required:
        - timestamp
        - depositReserve
        - borrowReserve
        - rewardToken
        - rewardApy
    KlendRewardHistory:
      type: array
      items:
        $ref: '#/components/schemas/KlendRewardHistoryRow'
      description: List of historical klend reward metrics
    ObligationStats:
      type: object
      properties:
        leverage:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Leverage ratio of the obligation
              example: '1.0580080950430842892'
        borrowLimit:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Maximum borrow limit
              example: '1.3496969599567630906'
        loanToValue:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Current loan-to-value ratio
              example: '0.054827647647367082766'
        liquidationLtv:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Liquidation loan-to-value threshold
              example: '0.75000000000000000001'
        netAccountValue:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Net account value
              example: '1.7239138521696367095'
        userTotalBorrow:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total amount borrowed by the user
              example: '0.10000095858274584538'
        userTotalDeposit:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total amount deposited by the user
              example: '1.8239148107523825549'
        borrowUtilization:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Borrow utilization ratio
              example: '0.074091415739685246983'
        borrowLiquidationLimit:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Borrow liquidation limit
              example: '1.3679361080642869162'
        userTotalCollateralDeposit:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total collateral deposited by the user
              example: '1.8239148107523825549'
        userTotalLiquidatableDeposit:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total liquidatable deposit amount
              example: '1.8239148107523825549'
        potentialElevationGroupUpdate:
          type: number
          description: Potential elevation group update indicator
          example: 0
        userTotalBorrowBorrowFactorAdjusted:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Total borrow adjusted by borrow factor
              example: '0.10000095858274584538'
      required:
        - leverage
        - borrowLimit
        - loanToValue
        - liquidationLtv
        - netAccountValue
        - userTotalBorrow
        - userTotalDeposit
        - borrowUtilization
        - borrowLiquidationLimit
        - userTotalCollateralDeposit
        - userTotalLiquidatableDeposit
        - potentialElevationGroupUpdate
        - userTotalBorrowBorrowFactorAdjusted
      description: Refreshed obligation statistics
    Position:
      type: object
      properties:
        amount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Amount in the position
              example: '10000708.005624756258'
        mintAddress:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Token mint address
              example: So11111111111111111111111111111111111111112
        marketValueRefreshed:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Refreshed market value of the position
              example: '1.8239148107523825549'
      required:
        - amount
        - mintAddress
        - marketValueRefreshed
    ObligationSolValues:
      type: object
      properties:
        netValueSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Net value in SOL
              example: '0.009469142566566941841900274495955292427975'
        collateralValueSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Collateral value in SOL
              example: '0.01001842948854487210536205388880118310325'
        debtValueSol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Debt value in SOL
              example: '0.0005492869219779302633519230615141419874818'
        solPrice:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: SOL price in USD
              example: '182.05596125'
        timestampSolPrice:
          allOf:
            - $ref: '#/components/schemas/SnapshotDateTime'
            - description: Timestamp of the SOL price
              example: '2025-10-17T00:00:00.000Z'
        timestampObligation:
          allOf:
            - $ref: '#/components/schemas/SnapshotDateTime'
            - description: Timestamp of the obligation snapshot
              example: '2025-10-17T00:00:00.000Z'
      required:
        - netValueSol
        - collateralValueSol
        - debtValueSol
        - solPrice
        - timestampSolPrice
        - timestampObligation
      description: Obligation values denominated in SOL
    ObligationMetrics:
      type: object
      properties:
        timestamp:
          allOf:
            - $ref: '#/components/schemas/SnapshotDateTime'
            - example: '2025-10-17T00:00:00.000Z'
        refreshedStats:
          $ref: '#/components/schemas/ObligationStats'
        deposits:
          type: array
          items:
            $ref: '#/components/schemas/Position'
          description: Array of deposit positions
        borrows:
          type: array
          items:
            $ref: '#/components/schemas/Position'
          description: Array of borrow positions
        tag:
          type: integer
          minimum: 0
          maximum: 3
          description: >-
            Obligation type tag (0 = Vanilla, 1 = Multiply, 2 = Lending, 3 =
            Leverage)
          example: 0
        obligationSolValues:
          $ref: '#/components/schemas/ObligationSolValues'
      required:
        - timestamp
        - refreshedStats
        - deposits
        - borrows
        - tag
        - obligationSolValues
    ObligationMetricsHistoryResponse:
      type: object
      properties:
        obligation:
          allOf:
            - $ref: '#/components/schemas/AddressBase58'
            - description: Obligation public key
              example: 3HdrCvoJ91bwgVTejdDXfguo6S2A9jjUkBR5fasq4WhB
        history:
          type: array
          items:
            $ref: '#/components/schemas/ObligationMetrics'
          description: Historical metrics for the obligation
      required:
        - obligation
        - history
    PnlResponse:
      type: object
      properties:
        usd:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: PnL in USD
              example: '25.21'
        sol:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: PnL in SOL
              example: '1.0'
        invested:
          type: object
          properties:
            usd:
              allOf:
                - $ref: '#/components/schemas/Decimal'
                - description: Decimal value represented as string
                  example: '1234.56789'
            sol:
              allOf:
                - $ref: '#/components/schemas/Decimal'
                - description: Decimal value represented as string
                  example: '1234.56789'
          required:
            - usd
            - sol
          description: Invested amounts
      required:
        - usd
        - sol
    LoanDepositInfo:
      type: object
      properties:
        tokenMint:
          type: string
          description: The token mint address
          example: So11111111111111111111111111111111111111112
        tokenName:
          type: string
          description: The token name/symbol from the reserve
          example: SOL
        tokenAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Token amount in decimal format (not lamports)
              example: '0.0100002082771212'
        tokenValue:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: USD value (tokenAmount × tokenPrice)
              example: '1.80421579010444'
        maxLtv:
          type: number
          description: Maximum loan-to-value ratio for this collateral reserve
          example: 0.74
        liquidationLtv:
          type: number
          description: Liquidation threshold LTV for this collateral reserve
          example: 0.75
        maxWithdrawableAmount:
          type: number
          description: >-
            Maximum token amount (decimals) that can be withdrawn while
            currentLtv <= maxLtv
          example: 51225.5590659256
        maxWithdrawableValue:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: >-
                Maximum USD value that can be withdrawn while currentLtv <=
                maxLtv
              example: '9242003.76257327'
        tokenPrice:
          type: number
          description: Latest price from the oracle
          example: 180.41782132
      required:
        - tokenMint
        - tokenName
        - tokenAmount
        - tokenValue
        - maxLtv
        - liquidationLtv
        - maxWithdrawableAmount
        - maxWithdrawableValue
        - tokenPrice
    LoanBorrowInfo:
      type: object
      properties:
        tokenMint:
          type: string
          description: The token mint address
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        tokenName:
          type: string
          description: The token name/symbol
          example: USDC
        tokenAmount:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: Token amount in decimal format
              example: '0.100002775657846'
        tokenValue:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: USD value (tokenAmount × tokenPrice)
              example: '0.0999921413626825'
        maxBorrowableAmount:
          type: number
          description: Maximum amount that can be borrowed while currentLtv <= maxLtv
          example: 1.30084031718889
        maxBorrowableValue:
          allOf:
            - $ref: '#/components/schemas/Decimal'
            - description: >-
                Maximum USD value that can be borrowed while currentLtv <=
                maxLtv
              example: '1.30070198582957'
        tokenPrice:
          type: number
          description: Latest price from the oracle
          example: 0.99989366
        borrowFactor:
          type: number
          description: >-
            Extra weight given to debt token in LTV calculation (debt value is
            multiplied by this factor))
          example: 1
      required:
        - tokenMint
        - tokenName
        - tokenAmount
        - tokenValue
        - maxBorrowableAmount
        - maxBorrowableValue
        - tokenPrice
        - borrowFactor
    LoanInfo:
      type: object
      properties:
        loanId:
          type: string
          description: The loan (obligation) public key
          example: wGzt1J5Nr182HHqAc1zsfD9SLoe1MJb25VWih5NRY
        marketId:
          type: string
          description: The market public key
          example: 6HT16972HHiY4RM33GfUc22pHZ3VLDPpXFWhQ7XJzA
        user:
          type: string
          description: The loan owner public key
          example: 7yexZcPbepXgWw3Cxc7YB2eLaxwyuyshRbAF8XHDi2g
        timestamp:
          type: number
          description: UTC timestamp when this report was produced
          example: 1760707165421
        solanaSlot:
          type: number
          description: Solana slot when this report was produced
          example: 373973788
        elevationGroup:
          type: number
          description: >-
            The elevation group assigned to this obligation for isolation of
            risks
          example: 0
        leverage:
          type: number
          description: Current leverage ratio of the position
          example: '0.5'
        loanInfo:
          type: object
          properties:
            collateral:
              type: object
              properties:
                deposits:
                  type: array
                  items:
                    $ref: '#/components/schemas/LoanDepositInfo'
                  description: Array of collateral deposits
              required:
                - deposits
            debt:
              type: object
              properties:
                borrows:
                  type: array
                  items:
                    $ref: '#/components/schemas/LoanBorrowInfo'
                  description: Array of debt borrows
              required:
                - borrows
            currentLtv:
              type: number
              description: >-
                Current loan-to-value ratio (debt value × borrow factor /
                collateral value); liquidate when >= liquidationLtv
              example: 0.0554213869045533
            maxLtv:
              type: number
              description: >-
                weighted average max LTV from all the collateral reserves (risks
                actions borrows or withdrawals are blocked when userLtv >=
                maxLtv)
              example: 0.74
            liquidationLtv:
              type: number
              description: LTV threshold when liquidation occurs
              example: 0.75
            closeFactor:
              type: number
              description: >-
                Maximum percentage of total debt that can be repaid in a single
                liquidation
              example: 0.1
          required:
            - collateral
            - debt
            - currentLtv
            - maxLtv
            - liquidationLtv
            - closeFactor
      required:
        - loanId
        - marketId
        - user
        - timestamp
        - solanaSlot
        - elevationGroup
        - leverage
        - loanInfo
