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

# Get migratable DeFi positions

> Returns the address's DeFi positions in one normalised shape, each carrying the largest amount that can actually be withdrawn right now. `maxWithdrawable` is capped against the venue's full withdraw validation — health factor (with a buffer above the liquidation edge), E-Mode thresholds, zero-LTV collateral, paused reserves and pool liquidity — so a client never asks a user to sign an exit the protocol would reject. Currently covers Aave v3 across every market on the deposit-enabled chains; a `failures` entry appears when a venue could not be reached, so an empty list is distinguishable from a failed lookup.



## OpenAPI

````yaml https://raw.githubusercontent.com/rhinestonewtf/openapi/refs/heads/main/deposit-service.json get /positions/{address}
openapi: 3.1.0
info:
  title: Deposit Service API
  version: 1.0.0
  description: >-
    Cross-chain deposit processing service with automatic token bridging and gas
    sponsorship
servers:
  - url: https://v1.orchestrator.rhinestone.dev/deposit-processor
security: []
paths:
  /positions/{address}:
    get:
      tags:
        - Utilities
      summary: Get migratable DeFi positions
      description: >-
        Returns the address's DeFi positions in one normalised shape, each
        carrying the largest amount that can actually be withdrawn right now.
        `maxWithdrawable` is capped against the venue's full withdraw validation
        — health factor (with a buffer above the liquidation edge), E-Mode
        thresholds, zero-LTV collateral, paused reserves and pool liquidity — so
        a client never asks a user to sign an exit the protocol would reject.
        Currently covers Aave v3 across every market on the deposit-enabled
        chains; a `failures` entry appears when a venue could not be reached, so
        an empty list is distinguishable from a failed lookup.
      parameters:
        - schema:
            type: string
            pattern: ^0x[a-fA-F0-9]{40}$
            description: EVM address holding the DeFi positions
            example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
          required: true
          description: EVM address holding the DeFi positions
          name: address
          in: path
        - schema:
            type: string
            description: API key for authentication
            example: your-api-key
          required: true
          description: API key for authentication
          name: x-api-key
          in: header
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}\.[a-z0-9]+$
            description: >-
              API version identifier (e.g. "2026-04.amazon"). Optional today,
              will become required in a future release.
            example: 2026-04.amazon
          required: false
          description: >-
            API version identifier (e.g. "2026-04.amazon"). Optional today, will
            become required in a future release.
          name: x-api-version
          in: header
      responses:
        '200':
          description: Normalised DeFi positions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionsResponse'
        '400':
          description: >-
            Invalid request, unauthorized, or the project is not configured for
            deposits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: API key lacks the required deposits scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PositionsResponse:
      type: object
      properties:
        positions:
          type: array
          items:
            type: object
            properties:
              venue:
                type: string
                enum:
                  - aave
              kind:
                type: string
                enum:
                  - lending
              market:
                type: object
                properties:
                  address:
                    type: string
                  name:
                    type: string
                required:
                  - address
                  - name
                description: >-
                  Positions are keyed by market, not chain — Ethereum alone
                  hosts four Aave v3 markets with distinct pools and risk
                  params.
              chain:
                type: string
                description: CAIP-2 chain id
                example: eip155:8453
              asset:
                type: object
                properties:
                  address:
                    type: string
                  symbol:
                    type: string
                  decimals:
                    type: number
                required:
                  - address
                  - symbol
                  - decimals
              amount:
                type: string
                description: Supplied balance in base units, accrued interest included
              usdValue:
                type: number
              apy:
                type: number
              isCollateral:
                type: boolean
              maxWithdrawable:
                type: string
                description: >-
                  Largest amount withdrawable right now, in base units. Capped
                  so the withdraw cannot be rejected on-chain.
              withdrawableUsd:
                type: number
                description: >-
                  USD value of `maxWithdrawable` — what would actually reach the
                  deposit address, as opposed to `usdValue`, which prices the
                  whole holding. Display this next to an amount you offer: it is
                  also the figure this project's deposit floor is judged
                  against, and re-deriving it from `usdValue` needs the amount
                  ratio taken in integer space to survive an 18-decimal balance.
                example: 40.02
              isFullExit:
                type: boolean
                description: >-
                  True when the entire supplied balance can leave in one
                  transaction
              constraints:
                type: array
                items:
                  type: string
                  enum:
                    - health_factor
                    - frozen_reserve
                    - nothing_supplied
                    - paused_reserve
                    - ltv_validation
                    - available_liquidity
                    - below_deposit_floor
                    - deposit_not_whitelisted
                  description: >-
                    Why the position cannot be fully migrated. Venue reasons
                    (`health_factor`, `paused_reserve`, `ltv_validation`,
                    `available_liquidity`) cap `maxWithdrawable` itself.
                    `frozen_reserve` is advisory — Aave still permits
                    withdrawing from a frozen reserve. `below_deposit_floor` and
                    `deposit_not_whitelisted` mean the venue would pay out but
                    this project's deposit policy would then reject the
                    proceeds, so they do not reduce `maxWithdrawable`.
            required:
              - venue
              - kind
              - market
              - chain
              - asset
              - amount
              - usdValue
              - apy
              - isCollateral
              - maxWithdrawable
              - withdrawableUsd
              - isFullExit
              - constraints
        totalUsd:
          type: number
        minDepositUsd:
          type: number
          description: >-
            The USD floor the withdrawn proceeds must clear for this project,
            resolved from the platform minimum and the project's own
            `minDepositUsd`. Proceeds below it are rejected on ingest after the
            withdrawal has already happened.
          example: 0.04
        failures:
          type: array
          items:
            type: object
            properties:
              venue:
                type: string
              reason:
                type: string
            required:
              - venue
              - reason
          description: >-
            Present only when a venue could not be reached, so an empty
            `positions` list can be told apart from a failed lookup.
      required:
        - positions
        - totalUsd
        - minDepositUsd
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              code:
                type: string
            required:
              - message
      required:
        - error

````