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

> Just the profit/loss numbers, pulled out of the `full` payload.

**Credits:** 8 per successful call.

These queries have their own credit cost.

| Query | Credits |
| --- | --- |
| `status=inactive` | 4 |



## OpenAPI

````yaml /openapi.yaml get /v1/positions/uniswapv3/{id}/pnl
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/positions/uniswapv3/{id}/pnl:
    get:
      tags:
        - Uniswap V3
      summary: Get Position PnL
      description: |-
        Just the profit/loss numbers, pulled out of the `full` payload.

        **Credits:** 8 per successful call.

        These queries have their own credit cost.

        | Query | Credits |
        | --- | --- |
        | `status=inactive` | 4 |
      operationId: get_v1_positions_uniswapv3_id_pnl
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Token ID.
            example: '119128'
            x-default: '119128'
        - name: chain_id
          in: query
          required: true
          schema:
            type: integer
            description: Chain ID.
            example: 130
            x-default: 130
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - inactive
            description: >-
              Omit for active positions. Set to `inactive` for closed positions.
              Default: active.
        - name: manager_address
          in: query
          required: false
          schema:
            type: string
            description: Manager address.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/RequestId'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          token_id:
                            type: string
                          chain_id:
                            type: integer
                          pnl_usd_value:
                            type: string
                            description: >-
                              USD string. Current position value, plus
                              withdrawals, plus claimed fees and rewards, minus
                              capital deposited.
                          pnl_percentage:
                            type: string
                            description: >-
                              Percent string. PnL divided by net invested
                              capital. 0 when net invested is not positive.
                          time_weighted_average_capital:
                            type: string
                            description: >-
                              USD string. Capital weighted by how long each
                              deposit or withdrawal was open. Compounds are not
                              new capital.
                          hodl_gross_benchmark_usd_value:
                            type: string
                            description: >-
                              USD string. Deposited token amounts at the current
                              price. Withdrawals are not subtracted.
                          alpha_vs_hodl_gross_usd_value:
                            type: string
                            description: >-
                              USD string. Remaining value plus withdrawals plus
                              claimed yield, minus the HODL gross benchmark.
                          alpha_vs_hodl_gross_percentage:
                            type: string
                            description: >-
                              Percent string of that alpha over the HODL gross
                              benchmark. 0 when the benchmark is not positive.
                          net_impermanent_loss:
                            type: string
                            description: >-
                              USD string. Current position value, including
                              unclaimed yield, minus net deposited tokens at the
                              current price.
                          net_impermanent_loss_percentage:
                            type: string
                            description: >-
                              Percent string of net impermanent loss over the
                              value of net deposited tokens.
                          pure_impermanent_loss:
                            type: string
                            description: >-
                              USD string. Current token principal minus net
                              deposited tokens at the current price. Fees and
                              rewards are excluded.
                          pure_impermanent_loss_percentage:
                            type: string
                            description: >-
                              Percent string of pure impermanent loss over the
                              value of net deposited tokens.
                          market_pnl_usd_value:
                            type: string
                            description: >-
                              USD string. HODL gross benchmark minus capital
                              deposited.
                          lp_divergence_pnl_usd_value:
                            type: string
                            description: >-
                              USD string. Alpha versus HODL, minus total fees
                              and rewards.
                          realized_usd_value:
                            type: string
                            description: >-
                              USD string. Withdrawals plus claimed fees and
                              rewards.
                          unrealized_usd_value:
                            type: string
                            description: >-
                              USD string. Current position value, including
                              unclaimed fees and rewards.
                          is_closed:
                            type: boolean
                            description: True when the position liquidity is zero.
                        required:
                          - token_id
                          - chain_id
                          - pnl_usd_value
                          - pnl_percentage
                          - time_weighted_average_capital
                          - hodl_gross_benchmark_usd_value
                          - alpha_vs_hodl_gross_usd_value
                          - alpha_vs_hodl_gross_percentage
                          - net_impermanent_loss
                          - net_impermanent_loss_percentage
                          - pure_impermanent_loss
                          - pure_impermanent_loss_percentage
                          - market_pnl_usd_value
                          - lp_divergence_pnl_usd_value
                          - realized_usd_value
                          - unrealized_usd_value
                          - is_closed
                    required:
                      - data
              example:
                data:
                  token_id: '119128'
                  chain_id: 130
                  pnl_usd_value: '150.88'
                  pnl_percentage: '11.33'
                  time_weighted_average_capital: '1331.83'
                  hodl_gross_benchmark_usd_value: '1492.63'
                  alpha_vs_hodl_gross_usd_value: '-9.92'
                  alpha_vs_hodl_gross_percentage: '-0.66'
                  net_impermanent_loss: '-9.92'
                  net_impermanent_loss_percentage: '-0.66'
                  pure_impermanent_loss: '-9.92'
                  pure_impermanent_loss_percentage: '-0.66'
                  market_pnl_usd_value: '160.80'
                  lp_divergence_pnl_usd_value: '-9.92'
                  realized_usd_value: '0'
                  unrealized_usd_value: '1482.71'
                  is_closed: false
                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.