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

# Market trades

> Real-time trade updates for a specific market (not cached, updates only)



## AsyncAPI

````yaml api-reference/asyncapi.json marketTrades
id: marketTrades
title: Market trades
description: Real-time trade updates for a specific market (not cached, updates only)
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.aptoslabs.com/decibel/ws
    bindings: []
    variables: []
address: trades:{marketAddr}
parameters:
  - id: marketAddr
    jsonSchema:
      type: string
      description: Market address (Aptos address format, e.g. 0x456...)
    description: Market address (Aptos address format, e.g. 0x456...)
    type: string
    required: true
    deprecated: false
bindings: []
operations:
  - &ref_0
    id: receivemarketTrades
    title: Receivemarket trades
    description: >-
      Receive updates for real-time trade updates for a specific market (not
      cached, updates only)
    type: receive
    messages:
      - &ref_1
        id: MarketTradesMessage
        payload:
          - name: MarketTradesMessage
            description: >-
              Real-time trade updates for a specific market (not cached, updates
              only)
            type: object
            properties:
              - name: topic
                type: string
                required: true
              - name: trades
                type: array
                required: true
                properties:
                  - name: account
                    type: string
                    description: User's account address
                    required: true
                  - name: action
                    type: string
                    description: Trade action type (e.g., "buy", "sell", "liquidation")
                    required: true
                  - name: client_order_id
                    type: string
                    description: Client-specified order ID
                    required: true
                  - name: fee_amount
                    type: number
                    description: Fee amount in raw units
                    required: true
                  - name: is_profit
                    type: boolean
                    description: Whether trade was profitable
                    required: true
                  - name: is_rebate
                    type: boolean
                    description: Whether trade received rebate
                    required: true
                  - name: market
                    type: string
                    description: Market identifier address
                    required: true
                  - name: order_id
                    type: string
                    description: Order ID associated with trade
                    required: true
                  - name: price
                    type: number
                    description: Trade price
                    required: true
                  - name: realized_funding_amount
                    type: number
                    description: >-
                      Realized funding amount in USDC

                      - Negative value: trader PAID funding (e.g., long position
                      with positive funding rate)

                      - Positive value: trader RECEIVED funding (e.g., short
                      position with positive funding rate)

                      - Zero: no funding accrued
                    required: true
                  - name: realized_pnl_amount
                    type: number
                    description: Realized PnL amount
                    required: true
                  - name: size
                    type: number
                    description: Trade size
                    required: true
                  - name: source
                    type: string
                    description: >-
                      Trade source (e.g., "OrderFill", "MarginCall",
                      "BackStopLiquidation", "ADL", "MarketDelisted")
                    required: true
                  - name: trade_id
                    type: string
                    description: Trade ID
                    required: true
                  - name: transaction_unix_ms
                    type: integer
                    description: Transaction timestamp in milliseconds
                    required: true
                  - name: transaction_version
                    type: integer
                    description: Transaction version
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - topic
            - trades
          properties:
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-165>
            trades:
              type: array
              items:
                type: object
                required:
                  - account
                  - market
                  - action
                  - source
                  - trade_id
                  - size
                  - price
                  - is_profit
                  - realized_pnl_amount
                  - 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-144>
                  action:
                    type: string
                    description: Trade action type (e.g., "buy", "sell", "liquidation")
                    example: buy
                    x-parser-schema-id: <anonymous-schema-145>
                  client_order_id:
                    type: string
                    description: Client-specified order ID
                    example: client_order_abc
                    x-parser-schema-id: <anonymous-schema-146>
                  fee_amount:
                    type: number
                    format: double
                    description: Fee amount in raw units
                    x-parser-schema-id: <anonymous-schema-147>
                  is_profit:
                    type: boolean
                    description: Whether trade was profitable
                    x-parser-schema-id: <anonymous-schema-148>
                  is_rebate:
                    type: boolean
                    description: Whether trade received rebate
                    x-parser-schema-id: <anonymous-schema-149>
                  market:
                    type: string
                    description: Market identifier address
                    example: 0xmarket123456789abcdef
                    x-parser-schema-id: <anonymous-schema-150>
                  order_id:
                    type: string
                    description: Order ID associated with trade
                    example: '12345'
                    x-parser-schema-id: <anonymous-schema-151>
                  price:
                    type: number
                    format: double
                    description: Trade price
                    example: 50000.25
                    x-parser-schema-id: <anonymous-schema-152>
                  realized_funding_amount:
                    type: number
                    format: double
                    description: >-
                      Realized funding amount in USDC

                      - Negative value: trader PAID funding (e.g., long position
                      with positive funding rate)

                      - Positive value: trader RECEIVED funding (e.g., short
                      position with positive funding rate)

                      - Zero: no funding accrued
                    example: -15.5
                    x-parser-schema-id: <anonymous-schema-153>
                  realized_pnl_amount:
                    type: number
                    format: double
                    description: Realized PnL amount
                    x-parser-schema-id: <anonymous-schema-154>
                  size:
                    type: number
                    format: double
                    description: Trade size
                    example: 100.5
                    x-parser-schema-id: <anonymous-schema-155>
                  source:
                    type: string
                    description: >-
                      Trade source (e.g., "OrderFill", "MarginCall",
                      "BackStopLiquidation", "ADL", "MarketDelisted")
                    example: OrderFill
                    x-parser-schema-id: <anonymous-schema-156>
                  trade_id:
                    type: string
                    description: Trade ID
                    example: '3647276'
                    x-parser-schema-id: <anonymous-schema-157>
                  transaction_unix_ms:
                    type: integer
                    format: int64
                    description: Transaction timestamp in milliseconds
                    example: 1634567890000
                    x-parser-schema-id: <anonymous-schema-158>
                  transaction_version:
                    type: integer
                    format: int64
                    description: Transaction version
                    example: 3647276285
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-159>
                x-parser-schema-id: TradeDto
              x-parser-schema-id: <anonymous-schema-166>
          x-parser-schema-id: MarketTradesResponse
        title: Market trades message
        description: >-
          Real-time trade updates for a specific market (not cached, updates
          only)
        example: |-
          {
            "topic": "trades:0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
            "trades": [
              {
                "account": "0x9876543210fedcba9876543210fedcba9876543210fedcba9876543210fedcba",
                "market": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
                "action": "Open Long",
                "source": "OrderFill",
                "trade_id": "3647277",
                "size": 0.8,
                "price": 50100,
                "is_profit": false,
                "realized_pnl_amount": -45.2,
                "realized_funding_amount": 5.1,
                "is_rebate": false,
                "fee_amount": 20.04,
                "order_id": "45680",
                "client_order_id": "order_123",
                "transaction_unix_ms": 1699564900000,
                "transaction_version": 3647276286
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: MarketTradesMessage
          - id: x-parser-message-name
            value: MarketTradesMessage
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: marketTrades
sendOperations:
  - *ref_0
receiveOperations: []
sendMessages:
  - *ref_1
receiveMessages: []
extensions:
  - id: x-parser-unique-object-id
    value: marketTrades
securitySchemes: []

````