> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get market by ID

> Retrieve details for a specific lending market. Useful for deep linking into a specific market (e.g., cbBTC/USDT on Morpho Blue).

This is a proxy to the Yield.xyz Borrow `GET /v1/markets/{marketId}` endpoint. Portal validates the upstream response against the schema documented here before returning it under `data`, and translates `network` values to CAIP-2. If Yield.xyz changes the response shape, Portal returns a 500 with `id: INTEGRATION_RESPONSE_SCHEMA_DRIFT` instead of a partial response. Upstream reference: [docs.yield.xyz](https://docs.yield.xyz/reference/marketscontroller_getmarketbyid_v1).



## OpenAPI

````yaml /openapi/client-api.yaml get /clients/me/integrations/yield-xyz-borrow/markets/{marketId}
openapi: 3.1.0
info:
  title: Portal Client API
  version: '3.0'
  description: >
    The Portal Client API provides endpoints for managing wallets, building
    transactions,

    and interacting with blockchain networks. All endpoints require
    authentication via a

    Client API Key or Client Session Token (CST) passed as a Bearer token.


    ## Base URL

    `https://api.portalhq.io/api/v3`


    ## Authentication

    Include your Client API Key or Client Session Token as a Bearer token in the

    `Authorization` header of every request.


    ## Chain ID Format

    Chain parameters use either friendly names (e.g. `ethereum`, `solana`) or
    CAIP-2 format

    (e.g. `eip155:1`, `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`). When using
    CAIP-2 format

    in URLs, ensure the colon is URI-encoded (`%3A`).
servers:
  - url: https://api.portalhq.io/api/v3
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Clients
    description: Core client management endpoints
  - name: Wallet
    description: >-
      Read wallet state — balances, NFTs, transaction history, capabilities, and
      transaction details
  - name: Transactions
    description: Build, broadcast, and evaluate blockchain transactions
  - name: Funding
    description: Fund wallets with testnet tokens
  - name: Wallet Shares
    description: Manage signing and backup share pairs
  - name: Delegations
    description: Manage token approvals, revocations, and delegated transfers
  - name: Session Keys
    description: Manage EIP-7702 session keys for smart accounts
  - name: 0x
    description: Token swap endpoints powered by the 0x protocol
  - name: Yield.xyz
    description: Yield opportunities and staking actions powered by Yield.xyz
  - name: Yield.xyz Borrow
    description: >-
      Supply collateral, borrow, repay and withdraw from lending markets (Aave
      V3, Morpho Blue, SparkLend, Lista) powered by Yield.xyz Borrow
  - name: Li.Fi
    description: Cross-chain swaps and bridging powered by Li.Fi
  - name: Blockaid
    description: Transaction and address security scanning powered by Blockaid
  - name: Hypernative
    description: >-
      Transaction, address, token, and NFT security scanning powered by
      Hypernative
  - name: Noah
    description: KYC onboarding, payins, and payouts powered by Noah
  - name: Meld
    description: Buy and sell crypto with fiat through aggregated providers powered by Meld
  - name: Due
    description: Payins, payouts, virtual accounts, and FX powered by Due
  - name: EIP-7702
    description: EIP-7702 account type detection and authorization management
  - name: Deprecated
    description: >-
      Legacy endpoints scheduled for removal. Use the newer equivalents listed
      in each endpoint's description.
paths:
  /clients/me/integrations/yield-xyz-borrow/markets/{marketId}:
    get:
      tags:
        - Yield.xyz Borrow
      summary: Get market by ID
      description: >-
        Retrieve details for a specific lending market. Useful for deep linking
        into a specific market (e.g., cbBTC/USDT on Morpho Blue).


        This is a proxy to the Yield.xyz Borrow `GET /v1/markets/{marketId}`
        endpoint. Portal validates the upstream response against the schema
        documented here before returning it under `data`, and translates
        `network` values to CAIP-2. If Yield.xyz changes the response shape,
        Portal returns a 500 with `id: INTEGRATION_RESPONSE_SCHEMA_DRIFT`
        instead of a partial response. Upstream reference:
        [docs.yield.xyz](https://docs.yield.xyz/reference/marketscontroller_getmarketbyid_v1).
      operationId: getYieldXyzBorrowMarket
      parameters:
        - name: marketId
          in: path
          required: true
          example: aave-borrow-base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
          schema:
            example: aave-borrow-base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
            type: string
          description: >-
            Market id exactly as returned by `GET /markets` (e.g.
            `aave-borrow-base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913`).
            Treat it as opaque.
      responses:
        '200':
          description: Market details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YieldXyzBorrowMarketResponse'
        '400':
          description: >-
            Invalid request (a field failed validation, or `network` is not a
            chain Portal supports). Also returned when Yield.xyz Borrow rejects
            the request or the configured API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Yield.xyz has no item for this id (the message names it)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Yield.xyz Borrow rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: >-
            Yield.xyz Borrow returned a response that does not match the schema
            Portal expects (`id: INTEGRATION_RESPONSE_SCHEMA_DRIFT`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationSchemaDriftErrorResponse'
        '503':
          description: Yield.xyz Borrow is unreachable or returned an upstream error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    YieldXyzBorrowMarketResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/YieldXyzBorrowMarket'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
    IntegrationSchemaDriftErrorResponse:
      type: object
      description: >-
        Returned (HTTP 500) when a third-party response no longer matches the
        schema Portal proxies for it. The `id` is stable: SDKs should key off it
        and fail gracefully. Portal is alerted automatically and fixes the
        mapping server-side.
      required:
        - error
        - id
        - details
      properties:
        error:
          type: string
          example: >-
            yield-xyz-borrow returned a response for GET /v1/positions that does
            not match the expected schema
        id:
          type: string
          enum:
            - INTEGRATION_RESPONSE_SCHEMA_DRIFT
        details:
          type: object
          required:
            - integration
            - endpoint
            - issues
          properties:
            integration:
              type: string
              example: yield-xyz-borrow
            endpoint:
              type: string
              description: The upstream vendor endpoint whose response drifted.
              example: GET /v1/positions
            issues:
              type: array
              items:
                type: object
                required:
                  - path
                  - message
                  - code
                properties:
                  path:
                    type: string
                    description: Dotted path of the offending field in the vendor response.
                    example: supplyBalances.0.balanceUsd
                  message:
                    type: string
                    example: Expected string, received number
                  code:
                    type: string
                    example: invalid_type
    YieldXyzBorrowMarket:
      type: object
      required:
        - id
        - integrationId
        - network
        - type
        - poolAddress
        - loanToken
        - collateralTokens
        - borrowRate
        - totalSupply
        - totalSupplyRaw
        - totalBorrow
        - totalBorrowRaw
        - availableLiquidity
        - availableLiquidityRaw
        - utilizationRate
        - loanTokenPriceUsd
        - isBorrowEnabled
        - supplyCollateralFeeBps
        - feeWrapperAddress
        - originationFeeBps
        - originationFeeWrapperAddress
        - blueBundleOriginationFeeBps
        - minLoan
      properties:
        id:
          type: string
          description: Market ID (opaque; use it exactly as returned)
          example: aave-borrow-base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
        integrationId:
          type: string
          description: Integration ID
          example: aave-borrow
        network:
          type: string
          description: >-
            Network identifier in CAIP-2 format (e.g. `eip155:1`). Chains Portal
            does not support are returned with the Yield.xyz network name
            unchanged.
          example: eip155:1
        type:
          type: string
          description: >-
            Market type. "pool" for shared-pool protocols (Aave), "isolated" for
            pair-based protocols (Morpho Blue). Known values: `pool`,
            `isolated`. Treat unknown values as opaque.
          example: pool
        poolAddress:
          type: string
          description: Pool/protocol contract address
          example: '0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2'
        loanToken:
          description: The borrowable token
          allOf:
            - $ref: '#/components/schemas/YieldXyzBorrowToken'
        collateralTokens:
          description: >-
            Accepted collateral tokens with per-collateral risk parameters. For
            isolated markets: single entry. For pool markets: all eligible
            collateral assets.
          type: array
          items:
            $ref: '#/components/schemas/YieldXyzBorrowCollateralToken'
        borrowRate:
          type: string
          description: Current variable borrow rate as decimal
          example: '0.0567'
        totalSupply:
          type: string
          description: Total supplied amount in human-readable token units
          example: '1234567.89'
        totalSupplyRaw:
          type: string
          description: Total supplied amount in raw token units
          example: '1234567890000000'
        totalBorrow:
          type: string
          description: Total borrowed amount in human-readable token units
          example: '987654.321'
        totalBorrowRaw:
          type: string
          description: Total borrowed amount in raw token units
          example: '987654321000000'
        availableLiquidity:
          type: string
          description: Available liquidity in human-readable token units
          example: '246913.569'
        availableLiquidityRaw:
          type: string
          description: Available liquidity in raw token units
          example: '246913569000000'
        utilizationRate:
          type: string
          description: Utilization rate as decimal
          example: '0.80'
        loanTokenPriceUsd:
          type: string
          description: Loan token price in USD
          example: '1.00'
        isBorrowEnabled:
          type: boolean
          description: Whether borrowing is enabled for this asset
          example: true
        supplyCollateralFeeBps:
          type: string
          description: >-
            Deposit fee charged on supplyCollateral, in basis points (1 bp =
            0.01%; 50 = 0.5%). Ranges from 0 to 500 (0% to 5%).
          example: '50'
          minimum: 0
          maximum: 500
        feeWrapperAddress:
          type: string
          description: >-
            Address of the fee wrapper contract charging the deposit fee for the
            requesting project. null when no wrapper is configured for the
            (project, integration) pair.
          example: '0x29ac0c53Eb4b19295875D3895Fb1514ffC8e1616'
          nullable: true
        originationFeeBps:
          type: string
          description: >-
            Origination fee for plain borrow (allocator wrapper default), in
            basis points (1 bp = 0.01%). When no wrapper is set, mirrors
            blueBundleOriginationFeeBps if BlueBundle is configured, else "0".
          example: '100'
        originationFeeWrapperAddress:
          type: string
          description: >-
            Address of the wrapper contract charging the origination fee for the
            requesting project. null when no origination wrapper is configured.
          example: '0x3C778911B9e36eA8CE53dBF211a203e3300939b6'
          nullable: true
        blueBundleOriginationFeeBps:
          type: string
          description: >-
            BlueBundle origination fee for supplyAndBorrow, in basis points.
            null when not configured.
          example: '50'
          nullable: true
        minLoan:
          type: string
          description: >-
            Minimum borrowable amount in human-readable loan-token units.
            Borrows that would leave debt below this floor, and partial repays
            that leave remaining debt below it, revert on-chain. null when the
            market enforces no minimum (e.g. non-Lista integrations).
          example: '0.01'
          nullable: true
    YieldXyzBorrowToken:
      type: object
      required:
        - symbol
        - name
        - decimals
      properties:
        address:
          type: string
          description: Token contract address
          example: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
          nullable: true
        symbol:
          type: string
          description: Token symbol
          example: USDC
        name:
          type: string
          description: Token name
          example: USD Coin
        decimals:
          type: number
          description: Token decimals
          example: 6
        logoURI:
          type: string
          description: Token logo URI
          nullable: true
    YieldXyzBorrowCollateralToken:
      type: object
      required:
        - token
        - priceUsd
        - maxLtv
        - liquidationThreshold
        - liquidationPenalty
        - supplyRate
      properties:
        token:
          description: Collateral token details
          allOf:
            - $ref: '#/components/schemas/YieldXyzBorrowToken'
        priceUsd:
          type: string
          description: Token price in USD
          example: '2800.00'
        maxLtv:
          type: string
          description: >-
            Maximum loan-to-value ratio as decimal (e.g. "0.80" = 80% borrowing
            power)
          example: '0.80'
        liquidationThreshold:
          type: string
          description: Liquidation threshold as decimal
          example: '0.825'
        liquidationPenalty:
          type: string
          description: Liquidation penalty as decimal
          example: '0.05'
        supplyRate:
          type: string
          description: >-
            APY earned on this collateral while deposited (decimal, e.g. "0.02"
            = 2%)
          example: '0.02'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Client API Key or Client Session Token (CST). Pass as a Bearer token in
        the

        Authorization header.

````