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

> User's trades



## AsyncAPI

````yaml api-reference/asyncapi.json userTrades
id: userTrades
title: User trades
description: User's trades
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.aptoslabs.com/decibel/ws
    bindings: []
    variables: []
address: user_trades:{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: receiveuserTrades
    title: Receiveuser trades
    description: Receive updates for user's trades
    type: receive
    messages:
      - &ref_1
        id: UserTradesMessage
        payload:
          - name: UserTradesMessage
            description: User's trades
            type: object
            properties:
              - name: topic
                type: string
                required: true
              - name: trades
                type: array
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - topic
            - trades
          properties:
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-133>
            trades:
              type: array
              items:
                type: object
                required:
                  - account
                  - market
                  - action
                  - trade_id
                  - size
                  - price
                  - is_profit
                  - realized_pnl_amount
                  - is_funding_positive
                  - realized_funding_amount
                  - is_rebate
                  - fee_amount
                  - order_id
                  - client_order_id
                  - transaction_unix_ms
                  - transaction_version
                properties:
                  account:
                    type: string
                    description: User's account address
                    example: '0x1234567890abcdef1234567890abcdef12345678'
                    x-parser-schema-id: <anonymous-schema-92>
                  action:
                    type: string
                    description: Trade action type (e.g., "buy", "sell", "liquidation")
                    example: buy
                    x-parser-schema-id: <anonymous-schema-93>
                  client_order_id:
                    type: string
                    description: Client-specified order ID
                    example: client_order_abc
                    x-parser-schema-id: <anonymous-schema-94>
                  fee_amount:
                    type: number
                    format: double
                    description: Fee amount in raw units
                    x-parser-schema-id: <anonymous-schema-95>
                  is_funding_positive:
                    type: boolean
                    description: Whether funding was positive
                    x-parser-schema-id: <anonymous-schema-96>
                  is_profit:
                    type: boolean
                    description: Whether trade was profitable
                    x-parser-schema-id: <anonymous-schema-97>
                  is_rebate:
                    type: boolean
                    description: Whether trade received rebate
                    x-parser-schema-id: <anonymous-schema-98>
                  market:
                    type: string
                    description: Market identifier address
                    example: 0xmarket123456789abcdef
                    x-parser-schema-id: <anonymous-schema-99>
                  order_id:
                    type: string
                    description: Order ID associated with trade
                    example: '12345'
                    x-parser-schema-id: <anonymous-schema-100>
                  price:
                    type: number
                    format: double
                    description: Trade price
                    example: 50000.25
                    x-parser-schema-id: <anonymous-schema-101>
                  realized_funding_amount:
                    type: number
                    format: double
                    description: Realized funding amount
                    x-parser-schema-id: <anonymous-schema-102>
                  realized_pnl_amount:
                    type: number
                    format: double
                    description: Realized PnL amount
                    x-parser-schema-id: <anonymous-schema-103>
                  size:
                    type: number
                    format: double
                    description: Trade size
                    example: 100.5
                    x-parser-schema-id: <anonymous-schema-104>
                  trade_id:
                    type: integer
                    description: Trade ID
                    example: 3647276
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-105>
                  transaction_unix_ms:
                    type: integer
                    format: int64
                    description: Transaction timestamp in milliseconds
                    example: 1634567890000
                    x-parser-schema-id: <anonymous-schema-106>
                  transaction_version:
                    type: integer
                    format: int64
                    description: Transaction version
                    example: 3647276285
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-107>
                x-parser-schema-id: TradeDto
              x-parser-schema-id: <anonymous-schema-134>
          x-parser-schema-id: UserTradesResponse
        title: User trades message
        description: User's trades
        example: |-
          {
            "topic": "user_trades:0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
            "trades": [
              {
                "account": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
                "market": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
                "action": "Open Long",
                "trade_id": 3647276,
                "size": 1.5,
                "price": 50125.75,
                "is_profit": true,
                "realized_pnl_amount": 187.5,
                "is_funding_positive": false,
                "realized_funding_amount": -12.3,
                "is_rebate": true,
                "fee_amount": 25.06,
                "order_id": "45678",
                "client_order_id": "order_123",
                "transaction_unix_ms": 1699564800000,
                "transaction_version": 3647276285
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: UserTradesMessage
          - id: x-parser-message-name
            value: UserTradesMessage
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: userTrades
sendOperations:
  - *ref_0
receiveOperations: []
sendMessages:
  - *ref_1
receiveMessages: []
extensions:
  - id: x-parser-unique-object-id
    value: userTrades
securitySchemes: []

````