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

# User positions

> User's open positions with PnL and liquidation prices



## AsyncAPI

````yaml api-reference/asyncapi.json userPositions
id: userPositions
title: User positions
description: User's open positions with PnL and liquidation prices
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.aptoslabs.com/decibel/ws
    bindings: []
    variables: []
address: user_positions:{userAddr}
parameters:
  - id: userAddr
    jsonSchema:
      type: string
      description: User wallet address (Aptos address format, e.g. 0x123...)
    description: User wallet address (Aptos address format, e.g. 0x123...)
    type: string
    required: true
    deprecated: false
bindings: []
operations:
  - &ref_0
    id: receiveuserPositions
    title: Receiveuser positions
    description: Receive updates for user's open positions with pnl and liquidation prices
    type: receive
    messages:
      - &ref_1
        id: UserPositionsMessage
        payload:
          - name: UserPositionsMessage
            description: User's open positions with PnL and liquidation prices
            type: object
            properties:
              - name: positions
                type: array
                required: true
              - name: topic
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - topic
            - positions
          properties:
            positions:
              type: array
              items:
                type: object
                required:
                  - market
                  - user
                  - size
                  - user_leverage
                  - max_allowed_leverage
                  - entry_price
                  - is_isolated
                  - is_deleted
                  - unrealized_funding
                  - event_uid
                  - estimated_liquidation_price
                  - transaction_version
                  - has_fixed_sized_tpsls
                properties:
                  entry_price:
                    type: number
                    format: double
                    x-parser-schema-id: <anonymous-schema-66>
                  estimated_liquidation_price:
                    type: number
                    format: double
                    x-parser-schema-id: <anonymous-schema-67>
                  event_uid:
                    type: integer
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-68>
                  has_fixed_sized_tpsls:
                    type: boolean
                    x-parser-schema-id: <anonymous-schema-69>
                  is_deleted:
                    type: boolean
                    x-parser-schema-id: <anonymous-schema-70>
                  is_isolated:
                    type: boolean
                    x-parser-schema-id: <anonymous-schema-71>
                  market:
                    type: string
                    x-parser-schema-id: <anonymous-schema-72>
                  max_allowed_leverage:
                    type: integer
                    format: int32
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-73>
                  size:
                    type: number
                    format: double
                    x-parser-schema-id: <anonymous-schema-74>
                  sl_limit_price:
                    type:
                      - integer
                      - 'null'
                    format: int64
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-75>
                  sl_order_id:
                    type:
                      - string
                      - 'null'
                    x-parser-schema-id: <anonymous-schema-76>
                  sl_trigger_price:
                    type:
                      - integer
                      - 'null'
                    format: int64
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-77>
                  tp_limit_price:
                    type:
                      - integer
                      - 'null'
                    format: int64
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-78>
                  tp_order_id:
                    type:
                      - string
                      - 'null'
                    x-parser-schema-id: <anonymous-schema-79>
                  tp_trigger_price:
                    type:
                      - integer
                      - 'null'
                    format: int64
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-80>
                  transaction_version:
                    type: integer
                    format: int64
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-81>
                  unrealized_funding:
                    type: number
                    format: double
                    x-parser-schema-id: <anonymous-schema-82>
                  user:
                    type: string
                    x-parser-schema-id: <anonymous-schema-83>
                  user_leverage:
                    type: integer
                    format: int32
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-84>
                x-parser-schema-id: PositionDto
              x-parser-schema-id: <anonymous-schema-65>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-85>
          x-parser-schema-id: UserPositionsResponse
        title: User positions message
        description: User's open positions with PnL and liquidation prices
        example: |-
          {
            "topic": "user_positions:0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
            "positions": [
              {
                "market": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
                "user": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
                "size": 2.5,
                "user_leverage": 10,
                "max_allowed_leverage": 20,
                "entry_price": 49800,
                "is_isolated": false,
                "is_deleted": false,
                "unrealized_funding": -25.5,
                "event_uid": 1.2345678901234568e+35,
                "estimated_liquidation_price": 45000,
                "transaction_version": 12345681,
                "tp_order_id": "tp_001",
                "tp_trigger_price": 52000,
                "tp_limit_price": 51900,
                "sl_order_id": "sl_001",
                "sl_trigger_price": 48000,
                "sl_limit_price": null,
                "has_fixed_sized_tpsls": false
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: UserPositionsMessage
          - id: x-parser-message-name
            value: UserPositionsMessage
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: userPositions
sendOperations:
  - *ref_0
receiveOperations: []
sendMessages:
  - *ref_1
receiveMessages: []
extensions:
  - id: x-parser-unique-object-id
    value: userPositions
securitySchemes: []

````