> ## 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 positions

> Retrieve all supply and borrow positions for a user address across specified integration and network.

This is a proxy to the Yield.xyz Borrow `GET /v1/positions` 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/positionscontroller_getpositions_v1).



## OpenAPI

````yaml /openapi/client-api.yaml get /clients/me/integrations/yield-xyz-borrow/positions
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/positions:
    get:
      tags:
        - Yield.xyz Borrow
      summary: Get positions
      description: >-
        Retrieve all supply and borrow positions for a user address across
        specified integration and network.


        This is a proxy to the Yield.xyz Borrow `GET /v1/positions` 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/positionscontroller_getpositions_v1).
      operationId: getYieldXyzBorrowPositions
      parameters:
        - name: integrationId
          in: query
          required: true
          example: aave-borrow
          schema:
            example: aave-borrow
            type: string
          description: Integration identifier
        - name: network
          in: query
          required: true
          example: eip155:1
          schema:
            type: string
          description: >-
            Network identifier in CAIP-2 format (e.g. `eip155:1` for Ethereum,
            `eip155:8453` for Base). Portal translates this to the Yield.xyz
            network name; unsupported chains are rejected with a 400.
        - name: address
          in: query
          required: true
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fB28'
          schema:
            example: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fB28'
            type: string
          description: User wallet address
      responses:
        '200':
          description: User positions retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YieldXyzBorrowPositionResponse'
        '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'
        '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:
    YieldXyzBorrowPositionResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/YieldXyzBorrowPosition'
    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
    YieldXyzBorrowPosition:
      type: object
      required:
        - address
        - integrationId
        - network
        - totalSuppliedUsd
        - totalCollateralUsd
        - totalBorrowedUsd
        - netWorthUsd
        - healthFactor
        - currentLtv
        - availableToBorrowUsd
        - netApy
        - supplyBalances
        - debtBalances
      properties:
        address:
          type: string
          description: User wallet address
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fB28'
        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
        totalSuppliedUsd:
          type: string
          description: Total supplied value in USD (all supplied assets)
          example: '5000.00'
        totalCollateralUsd:
          type: string
          description: Total collateral value in USD (only assets enabled as collateral)
          example: '4200.00'
        totalBorrowedUsd:
          type: string
          description: Total borrowed value in USD
          example: '2000.00'
        netWorthUsd:
          type: string
          description: Net worth (supplied - borrowed) in USD
          example: '3000.00'
        healthFactor:
          type: string
          description: >-
            Account-level health factor (>1 is safe, <1 means liquidatable).
            Null when there is no debt, and always null for isolated-market
            protocols (e.g. Morpho); read each supply balance's
            positionState.healthFactor instead.
          example: '1.85'
          nullable: true
        currentLtv:
          type: string
          description: Current loan-to-value ratio as decimal (e.g., "0.55" = 55%)
          example: '0.55'
        availableToBorrowUsd:
          type: string
          description: >-
            Account-level available to borrow in USD based on collateral. Null
            for isolated-market protocols (e.g. Morpho), where headroom is
            per-market; read each supply balance's
            positionState.availableToBorrowUsd instead.
          example: '1500.00'
          nullable: true
        netApy:
          type: string
          description: Net APY (supply earnings - borrow costs)
          example: '2.34'
        supplyBalances:
          description: Supply positions
          type: array
          items:
            $ref: '#/components/schemas/YieldXyzBorrowSupplyBalance'
        debtBalances:
          description: Debt positions
          type: array
          items:
            $ref: '#/components/schemas/YieldXyzBorrowDebtBalance'
    YieldXyzBorrowSupplyBalance:
      type: object
      required:
        - marketId
        - tokenAddress
        - tokenSymbol
        - balance
        - balanceRaw
        - balanceUsd
        - apy
        - isCollateral
        - pendingActions
      properties:
        marketId:
          type: string
          description: Market ID
          example: aave-borrow-base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
        tokenAddress:
          type: string
          description: Token contract address
          example: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
        tokenSymbol:
          type: string
          description: Token symbol
          example: USDC
        balance:
          type: string
          description: Supplied balance in human-readable token units
          example: '1000.00'
        balanceRaw:
          type: string
          description: Supplied balance in raw token units
          example: '1000000000'
        balanceUsd:
          type: string
          description: Supplied balance in USD
          example: '1000.00'
        apy:
          type: string
          description: Current supply APY as percentage
          example: '3.45'
        isCollateral:
          type: boolean
          description: Whether this supply is being used as collateral
          example: true
        positionState:
          description: >-
            Per-market risk state for isolated-market protocols (e.g. Morpho
            Blue), where borrowing power and liquidation are scoped to this
            market. Omitted for pool-based protocols (e.g. Aave), where the
            account-level fields apply.
          allOf:
            - $ref: '#/components/schemas/YieldXyzBorrowPositionState'
          nullable: true
        pendingActions:
          description: Available actions for this supply balance
          type: array
          items:
            $ref: '#/components/schemas/YieldXyzBorrowBorrowPendingAction'
    YieldXyzBorrowDebtBalance:
      type: object
      required:
        - marketId
        - tokenAddress
        - tokenSymbol
        - balance
        - balanceRaw
        - balanceUsd
        - apy
        - pendingActions
      properties:
        marketId:
          type: string
          description: Market ID
          example: aave-borrow-base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
        tokenAddress:
          type: string
          description: Token contract address
          example: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'
        tokenSymbol:
          type: string
          description: Token symbol
          example: WETH
        balance:
          type: string
          description: Borrowed balance in human-readable token units
          example: '0.5'
        balanceRaw:
          type: string
          description: Borrowed balance in raw token units
          example: '500000000000000000'
        balanceUsd:
          type: string
          description: Borrowed balance in USD
          example: '1500.00'
        apy:
          type: string
          description: Current borrow APY as percentage
          example: '5.67'
        pendingActions:
          description: Available actions for this debt balance
          type: array
          items:
            $ref: '#/components/schemas/YieldXyzBorrowBorrowPendingAction'
    YieldXyzBorrowPositionState:
      type: object
      required:
        - currentLtv
        - liquidationThreshold
        - healthFactor
        - availableToBorrowUsd
      properties:
        currentLtv:
          type: string
          description: Loan-to-value for this market as a decimal (e.g., "0.20" = 20%)
          example: '0.1980'
        liquidationThreshold:
          type: string
          description: Liquidation LTV for this market as a decimal (e.g., "0.86" = 86%)
          example: '0.8600'
        healthFactor:
          type: string
          description: >-
            Health factor for this market (>1 is safe, <1 means liquidatable).
            Null when this market has no debt.
          example: '4.3430'
          nullable: true
        availableToBorrowUsd:
          type: string
          description: Remaining borrowing power in USD within this market
          example: '2.01'
    YieldXyzBorrowBorrowPendingAction:
      type: object
      required:
        - type
        - label
        - args
      properties:
        type:
          type: string
          description: >-
            Action type. Pass this value to POST /actions as the action field.
            Known values: `supply`, `borrow`, `repay`, `withdraw`,
            `enableCollateral`, `disableCollateral`, `supplyAndBorrow`. Treat
            unknown values as opaque.
          example: withdraw
        label:
          type: string
          description: Human-readable action label
          example: Withdraw USDC
        args:
          description: Pre-filled arguments for the action
          allOf:
            - $ref: '#/components/schemas/YieldXyzBorrowArguments'
    YieldXyzBorrowArguments:
      type: object
      required:
        - marketId
      properties:
        amount:
          type: string
          description: >-
            Amount in human-readable units (e.g. "1.5" for 1.5 USDC). Provide
            either amount or amountRaw.
          example: '1.5'
        amountRaw:
          type: string
          description: >-
            Amount in raw token units (e.g. "1500000" for 1.5 USDC with 6
            decimals). Provide either amount or amountRaw.
          example: '1500000'
        repayAll:
          type: boolean
          description: >-
            Repay the full outstanding debt using protocol-specific full-repay
            semantics. Only valid for repay actions. When true, omit amount and
            amountRaw.
          example: true
        tokenAddress:
          type: string
          description: >-
            Token address to supply/borrow/repay/withdraw. Required for `supply`
            and `withdraw` on pool-based protocols (Aave): the market's
            `loanToken.address`, or one of `collateralTokens[].token.address`.
            Isolated-market protocols (Morpho Blue) infer it from `marketId`.
          example: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
        collateralTokenAddress:
          type: string
          description: >-
            Collateral token address. Required when providing collateralAmount
            for pool-based protocols (Aave). Inferred from marketId for
            isolated-market protocols (Morpho Blue).
          example: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'
        collateralAmount:
          type: string
          description: >-
            Optional collateral amount in human-readable units (e.g. "0.5" for
            0.5 ETH). For borrow: collateral to deposit before borrowing. For
            repay: collateral to withdraw after repaying. Provide either
            collateralAmount or collateralAmountRaw.
          example: '0.5'
        collateralAmountRaw:
          type: string
          description: >-
            Optional collateral amount in raw token units (e.g. "50000000" for
            0.5 ETH with 8 decimals). Provide either collateralAmount or
            collateralAmountRaw.
          example: '50000000'
        borrowAmount:
          type: string
          description: >-
            Supply action only. Desired borrow amount in human-readable units of
            the market loan token. Provide together with targetLtv to have the
            API derive the required collateral (post-fee). Mutually exclusive
            with amount/amountRaw.
          example: '100'
        targetLtv:
          type: string
          description: >-
            Supply action only. Target loan-to-value as a decimal (e.g. "0.1" =
            10%). Provide together with borrowAmount. Must not exceed the market
            max LTV.
          example: '0.1'
        marketId:
          type: string
          description: >-
            Market ID as returned by GET /v1/markets. Identifies the specific
            lending market for the action.
          example: morpho-blue-borrow-base-cbbtc-usdc-86
      description: >-
        Action arguments. `marketId` is always required; the other fields depend
        on the action (see the integration's `actions[].schema`).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Client API Key or Client Session Token (CST). Pass as a Bearer token in
        the

        Authorization header.

````