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

# Trades by instrument type currency tx status

> Channel name: `trades.{instrument_type}.{currency}.{tx_status}`. Public channel that streams public trades filtered by category, underlying, and settlement outcome, where {instrument_type} is the instrument kind (erc20, option, or perp), {currency} is the underlying asset, and {tx_status} is the on-chain settlement state (settled, reverted, or timed_out).



## AsyncAPI

````yaml subscriptions.asyncapi.json tradesByInstrumentTypeCurrencyTxStatus
id: tradesByInstrumentTypeCurrencyTxStatus
title: Trades by instrument type currency tx status
description: >-
  Channel name: `trades.{instrument_type}.{currency}.{tx_status}`. Public
  channel that streams public trades filtered by category, underlying, and
  settlement outcome, where {instrument_type} is the instrument kind (erc20,
  option, or perp), {currency} is the underlying asset, and {tx_status} is the
  on-chain settlement state (settled, reverted, or timed_out).
servers:
  - id: production
    protocol: wss
    host: api.derive.xyz
    bindings: []
    variables: []
  - id: testnet
    protocol: wss
    host: testnet.api.derive.xyz
    bindings: []
    variables: []
address: /v3/ws
parameters: []
bindings: []
operations:
  - &ref_8
    id: receive_tradesByInstrumentTypeCurrencyTxStatus
    title: Receive_trades by instrument type currency tx status
    type: send
    messages:
      - &ref_11
        id: tradesByInstrumentTypeCurrencyTxStatusNotification
        payload:
          - name: tradesByInstrumentTypeCurrencyTxStatusNotification
            description: Pushed as a JSON array; each element has the fields below.
            type: object
            properties:
              - name: direction
                type: string
                enumValues:
                  - buy
                  - sell
                required: true
              - name: expected_rebate
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: extra_fee
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: index_price
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: instrument_name
                type: string
                required: true
              - name: liquidity_role
                type: string
                enumValues:
                  - maker
                  - taker
                required: true
              - name: mark_price
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: quote_id
                type: &ref_0
                  - string
                  - 'null'
                description: Optional UUID v4 string
                required: true
              - name: realized_pnl
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: realized_pnl_excl_fees
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: rfq_id
                type: &ref_1
                  - string
                  - 'null'
                description: Optional UUID v4 string
                required: true
              - name: subaccount_id
                type: integer
                required: true
              - name: timestamp
                type: integer
                required: true
              - name: trade_amount
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: trade_fee
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: trade_id
                type: string
                required: true
              - name: trade_price
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: tx_hash
                type: string
                required: true
              - name: tx_status
                type: string
                required: false
              - name: wallet
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          description: >-
            A settled trade returned by `public/get_trade_history`. Anonymized:
            no `order_id` or `label`. `wallet` is included since settled trades
            are visible on-chain.
          type: object
          required:
            - direction
            - expected_rebate
            - extra_fee
            - index_price
            - instrument_name
            - liquidity_role
            - mark_price
            - quote_id
            - realized_pnl
            - realized_pnl_excl_fees
            - rfq_id
            - subaccount_id
            - timestamp
            - trade_amount
            - trade_fee
            - trade_id
            - trade_price
            - tx_hash
            - wallet
          properties:
            direction:
              type: string
              enum:
                - buy
                - sell
              x-parser-schema-id: Direction
            expected_rebate:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-211>
            extra_fee:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-212>
            index_price:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-213>
            instrument_name:
              type: string
              x-parser-schema-id: <anonymous-schema-214>
            liquidity_role:
              type: string
              enum:
                - maker
                - taker
              x-parser-schema-id: LiquidityRole
            mark_price:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-215>
            quote_id:
              description: Optional UUID v4 string
              type: *ref_0
              format: uuid
              x-parser-schema-id: <anonymous-schema-216>
            realized_pnl:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-217>
            realized_pnl_excl_fees:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-218>
            rfq_id:
              description: Optional UUID v4 string
              type: *ref_1
              format: uuid
              x-parser-schema-id: <anonymous-schema-219>
            subaccount_id:
              type: integer
              format: int64
              x-parser-schema-id: <anonymous-schema-220>
            timestamp:
              type: integer
              format: int64
              x-parser-schema-id: <anonymous-schema-221>
            trade_amount:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-222>
            trade_fee:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-223>
            trade_id:
              type: string
              x-parser-schema-id: <anonymous-schema-224>
            trade_price:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-225>
            tx_hash:
              type: string
              x-parser-schema-id: <anonymous-schema-226>
            tx_status:
              anyOf:
                - description: >-
                    Batch lifecycle status — the single source of lifecycle
                    truth for every operation in the batch (individual ops carry
                    no status of their own). Each stage has a healthy variant
                    and a corresponding `...Error` variant meaning that stage
                    failed. Serialized as the variant name (string) in API
                    responses.
                  type: string
                  enum:
                    - Batching
                    - Executing
                    - Proving
                    - Settling
                    - Settled
                    - BatchingError
                    - ExecutingError
                    - ProvingError
                    - SettlingError
                    - SettledError
                  x-parser-schema-id: BatchStatus
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-228>
              x-parser-schema-id: <anonymous-schema-227>
            wallet:
              type: string
              x-parser-schema-id: <anonymous-schema-229>
          x-parser-schema-id: SettledTrade
        title: Trades by instrument type currency tx status notification
        description: Pushed as a JSON array; each element has the fields below.
        example: |-
          {
            "direction": "<string>",
            "expected_rebate": "<string>",
            "extra_fee": "<string>",
            "index_price": "<string>",
            "instrument_name": "<string>",
            "liquidity_role": "<string>",
            "mark_price": "<string>",
            "realized_pnl": "<string>",
            "realized_pnl_excl_fees": "<string>",
            "subaccount_id": 123,
            "timestamp": 123,
            "trade_amount": "<string>",
            "trade_fee": "<string>",
            "trade_id": "<string>",
            "trade_price": "<string>",
            "tx_hash": "<string>",
            "tx_status": "<string>",
            "wallet": "<string>"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: tradesByInstrumentTypeCurrencyTxStatusNotification
    bindings: []
    extensions: &ref_6
      - id: x-parser-unique-object-id
        value: tradesByInstrumentTypeCurrencyTxStatus
  - &ref_7
    id: send_subscribe_tradesByInstrumentTypeCurrencyTxStatus
    title: Send_subscribe_trades by instrument type currency tx status
    type: receive
    messages:
      - &ref_9
        id: subscribeRequest
        payload:
          - name: subscribeRequest
            description: >-
              Send to subscribe: list this channel's address (with the {param}
              segments filled, e.g. orderbook.ETH-PERP.10.20) in
              params.channels.
            type: object
            properties:
              - name: headers
                type: &ref_2
                  - object
                  - 'null'
                description: Non-standard; used by `auth/login`.
                required: false
              - name: id
                type: anyOf
                required: true
              - name: method
                type: string
                description: subscribe
                required: true
              - name: params
                type: object
                description: >-
                  Params for `subscribe`. `channels` is the required list of
                  channel names to subscribe to.
                required: true
                properties:
                  - name: channels
                    type: array
                    required: true
                    properties:
                      - name: item
                        type: string
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - id
            - method
            - params
          properties:
            headers:
              description: Non-standard; used by `auth/login`.
              type: *ref_2
              additionalProperties: true
              x-parser-schema-id: <anonymous-schema-16>
            id: &ref_4
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-17>
                - type: number
                  x-parser-schema-id: <anonymous-schema-18>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-19>
              x-parser-schema-id: JsonRpcId
            method:
              type: string
              const: subscribe
              x-parser-schema-id: <anonymous-schema-20>
            params:
              description: >-
                Params for `subscribe`. `channels` is the required list of
                channel names to subscribe to.
              type: object
              required:
                - channels
              properties:
                channels:
                  type: array
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-22>
                  x-parser-schema-id: <anonymous-schema-21>
              x-parser-schema-id: SubscribeParams
          x-parser-schema-id: <anonymous-schema-15>
        title: Subscribe request
        description: >-
          Send to subscribe: list this channel's address (with the {param}
          segments filled, e.g. orderbook.ETH-PERP.10.20) in params.channels.
        example: |-
          {
            "id": 1,
            "method": "subscribe",
            "params": {
              "channels": [
                "orderbook.ETH-PERP.10.20"
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribeRequest
      - &ref_10
        id: unsubscribeRequest
        payload:
          - name: unsubscribeRequest
            description: >-
              Send to unsubscribe: list the channel addresses to drop in
              params.channels, or omit it to unsubscribe from everything.
            type: object
            properties:
              - name: headers
                type: &ref_3
                  - object
                  - 'null'
                description: Non-standard; used by `auth/login`.
                required: false
              - name: id
                type: anyOf
                required: true
              - name: method
                type: string
                description: unsubscribe
                required: true
              - name: params
                type: object
                description: >-
                  Params for `unsubscribe`. `channels` is optional.


                  When omitted (or null) the connection unsubscribes from all
                  channels.
                required: true
                properties:
                  - name: channels
                    type: &ref_5
                      - array
                      - 'null'
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - id
            - method
            - params
          properties:
            headers:
              description: Non-standard; used by `auth/login`.
              type: *ref_3
              additionalProperties: true
              x-parser-schema-id: <anonymous-schema-24>
            id: *ref_4
            method:
              type: string
              const: unsubscribe
              x-parser-schema-id: <anonymous-schema-25>
            params:
              description: >-
                Params for `unsubscribe`. `channels` is optional.


                When omitted (or null) the connection unsubscribes from all
                channels.
              type: object
              properties:
                channels:
                  default: null
                  type: *ref_5
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-27>
                  x-parser-schema-id: <anonymous-schema-26>
              x-parser-schema-id: UnsubscribeParams
          x-parser-schema-id: <anonymous-schema-23>
        title: Unsubscribe request
        description: >-
          Send to unsubscribe: list the channel addresses to drop in
          params.channels, or omit it to unsubscribe from everything.
        example: |-
          {
            "method": "<string>",
            "params": {}
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribeRequest
    bindings: []
    extensions: *ref_6
sendOperations:
  - *ref_7
receiveOperations:
  - *ref_8
sendMessages:
  - *ref_9
  - *ref_10
receiveMessages:
  - *ref_11
extensions:
  - id: x-parser-unique-object-id
    value: tradesByInstrumentTypeCurrencyTxStatus
securitySchemes: []

````

## Related topics

- [Trades by instrument type currency](/api-reference/channels/tradesbyinstrumenttypecurrency.md)
- [Subscriptions](/subscriptions.md)
- [Query anonymized public trade history](/api-reference/market-data/query-anonymized-public-trade-history.md)
