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

# Get Position Risk

> Liquidation distance, LTV, and per-asset risk breakdown for one chain's live position. Optional `market_id` (default main) and `target_health_factor` (default 1.5) for the safe borrow/withdraw slider.

**Credits:** 8 per successful call.



## OpenAPI

````yaml /openapi.yaml get /v1/lending/aavev3/position/{chain_id}/risk
openapi: 3.1.0
info:
  title: DeFi Orbit API
  version: 1.0.0
  description: Public REST API for DeFi Orbit positions, lending, portfolio, and usage.
servers:
  - url: https://api.defiorbit.xyz
security:
  - bearerAuth: []
tags:
  - name: Portfolio
  - name: Snapshots
  - name: Uniswap V3
  - name: Aerodrome V3
  - name: Orca
  - name: Aave V3
  - name: Morpho
  - name: Kamino
  - name: Usage
paths:
  /v1/lending/aavev3/position/{chain_id}/risk:
    get:
      tags:
        - Aave V3
      summary: Get Position Risk
      description: >-
        Liquidation distance, LTV, and per-asset risk breakdown for one chain's
        live position. Optional `market_id` (default main) and
        `target_health_factor` (default 1.5) for the safe borrow/withdraw
        slider.


        **Credits:** 8 per successful call.
      operationId: get_v1_lending_aavev3_position_chain_id_risk
      parameters:
        - name: chain_id
          in: path
          required: true
          schema:
            type: integer
            description: Chain ID.
            example: 8453
            x-default: 8453
        - name: wallet
          in: query
          required: true
          schema:
            type: string
            description: Wallet address.
            example: '0xbf7620d0377b0660a6cbaef5cdfe2e00eddc1495'
            x-default: '0xbf7620d0377b0660a6cbaef5cdfe2e00eddc1495'
        - name: market_id
          in: query
          required: false
          schema:
            type: string
            enum:
              - main
              - lido
              - horizon
            description: 'Default: `main`. Values: `main`, `lido`, `horizon`.'
            default: main
        - name: target_health_factor
          in: query
          required: false
          schema:
            type: number
            description: 'Target health factor. Default: 1.5.'
            default: 1.5
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/RequestId'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          chain_id:
                            type: integer
                          wallet:
                            type: string
                          market_id:
                            type: string
                          health_factor:
                            type: string
                            description: >-
                              String. Aave divides
                              liquidation-threshold-weighted collateral by debt.
                              Morpho divides collateral × oracle price × LLTV by
                              debt, to four decimals. Kamino divides liquidation
                              LTV by LTV. MAX or ∞ when there is no debt.
                          current_ltv_percentage:
                            type: string
                          safe_borrow_amount_usd:
                            type: string
                          safe_withdraw_amount_usd:
                            type: string
                          risk_metrics:
                            type: object
                            properties:
                              priceDropToLiquidation:
                                type: string
                              borrowCapacityUtilization:
                                type: string
                              interestCoverageRatio:
                                type: string
                              maxBorrowCapacityUSD:
                                type: string
                              liquidationThreshold:
                                type: string
                              ltv:
                                type: string
                            required:
                              - priceDropToLiquidation
                              - borrowCapacityUtilization
                              - interestCoverageRatio
                              - maxBorrowCapacityUSD
                              - liquidationThreshold
                              - ltv
                          asset_metrics:
                            type: object
                            properties:
                              suppliedAssets:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    symbol:
                                      type: string
                                    suppliedUSD:
                                      type: string
                                    weightInPortfolio:
                                      type: string
                                    dailyEarnings:
                                      type: string
                                    liquidation:
                                      type: object
                                      properties:
                                        direction:
                                          type: string
                                        currentPrice:
                                          type: number
                                        liquidationPricePerTokenUSD:
                                          type: string
                                        liquidationNotionalUSD:
                                          type: string
                                        priceDropToLiquidationPct:
                                          type: string
                                      required:
                                        - direction
                                        - currentPrice
                                        - liquidationPricePerTokenUSD
                                        - liquidationNotionalUSD
                                        - priceDropToLiquidationPct
                                  required:
                                    - symbol
                                    - suppliedUSD
                                    - weightInPortfolio
                                    - dailyEarnings
                                    - liquidation
                              borrowedAssets:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    symbol:
                                      type: string
                                    borrowedUSD:
                                      type: string
                                    weightInDebt:
                                      type: string
                                    dailyCost:
                                      type: string
                                    liquidation:
                                      type: object
                                      properties:
                                        direction:
                                          type: string
                                        currentPrice:
                                          type: number
                                        liquidationPricePerTokenUSD:
                                          type: string
                                        liquidationNotionalUSD:
                                          type: string
                                        priceIncreaseToLiquidationPct:
                                          type: string
                                      required:
                                        - direction
                                        - currentPrice
                                        - liquidationPricePerTokenUSD
                                        - liquidationNotionalUSD
                                        - priceIncreaseToLiquidationPct
                                  required:
                                    - symbol
                                    - borrowedUSD
                                    - weightInDebt
                                    - dailyCost
                                    - liquidation
                            required:
                              - suppliedAssets
                              - borrowedAssets
                        required:
                          - chain_id
                          - wallet
                          - market_id
                          - health_factor
                          - current_ltv_percentage
                          - safe_borrow_amount_usd
                          - safe_withdraw_amount_usd
                          - risk_metrics
                          - asset_metrics
                    required:
                      - data
              example:
                data:
                  chain_id: 8453
                  wallet: '0xbf7620d0377b0660a6cbaef5cdfe2e00eddc1495'
                  market_id: main
                  health_factor: '1.42'
                  current_ltv_percentage: '56.12'
                  safe_borrow_amount_usd: '200.00'
                  safe_withdraw_amount_usd: '500.00'
                  risk_metrics:
                    priceDropToLiquidation: '29.67'
                    borrowCapacityUtilization: '74.24'
                    interestCoverageRatio: '0.36'
                    maxBorrowCapacityUSD: '3844.66'
                    liquidationThreshold: '79.80'
                    ltv: '75.00'
                  asset_metrics:
                    suppliedAssets:
                      - symbol: WETH
                        suppliedUSD: '1706.67'
                        weightInPortfolio: '33.56'
                        dailyEarnings: '0.08'
                        liquidation:
                          direction: decrease
                          currentPrice: 3413.34
                          liquidationPricePerTokenUSD: '2400.00'
                          liquidationNotionalUSD: '1200.00'
                          priceDropToLiquidationPct: '29.67'
                    borrowedAssets:
                      - symbol: USDC
                        borrowedUSD: '2854.38'
                        weightInDebt: '100.00'
                        dailyCost: '0.35'
                        liquidation:
                          direction: increase
                          currentPrice: 1
                          liquidationPricePerTokenUSD: '1.42'
                          liquidationNotionalUSD: '4050.00'
                          priceIncreaseToLiquidationPct: '42.00'
                request_id: req_...
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    RequestId:
      type: object
      required:
        - request_id
      properties:
        request_id:
          type: string
          description: Id to quote when you contact support.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
  responses:
    BadRequest:
      description: Missing or invalid parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_PARAMETER
              message: page must be a positive integer.
              request_id: req_...
    Unauthorized:
      description: Missing, malformed, invalid, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_API_KEY
              message: Missing API key.
              request_id: req_...
    PaymentRequired:
      description: The organization does not have enough credits.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INSUFFICIENT_CREDITS
              message: Insufficient API credits.
              request_id: req_...
    Forbidden:
      description: The organization is suspended, or the endpoint or feature is disabled.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: ACCOUNT_SUSPENDED
              message: This organization is suspended.
              request_id: req_...
    TooManyRequests:
      description: The organization exceeded its requests-per-second limit.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests per second for the organization.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left in the current window.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix time when the window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: RATE_LIMIT_EXCEEDED
              message: Rate limit exceeded. Please try again later.
              request_id: req_...
    InternalError:
      description: Unexpected server error, or pricing is not configured.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred.
              request_id: req_...
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Paste your API key from the
        [dashboard](https://platform.defiorbit.xyz/dashboard/keys). The key
        starts with `do_sk_`.
      x-default: YOUR_API_KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.