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

# Get Order Update History

> Get order updates (trades, liquidations, cancels)



## OpenAPI

````yaml /api-specs/public-rest-unified.json get /exchange/api/v1/order_updates
openapi: 3.1.0
info:
  title: DerivaDEX API Documentation
  version: '1.0'
  description: ''
servers:
  - url: https://testnet.derivadex.io
    description: DerivaDEX testnet
security: []
tags:
  - name: Venue-Wide Tables
    description: These APIs expose venue-wide public tables and reference data.
    x-source-api: Public REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public Exchange REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public Exchange REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public Exchange REST API
paths:
  /exchange/api/v1/order_updates:
    get:
      tags:
        - Market
      summary: Get Order Update History
      description: Get order updates (trades, liquidations, cancels)
      parameters:
        - in: query
          name: trader
          schema:
            type: string
          description: The trader address, with the discriminant prefix.
          example: '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
        - in: query
          name: strategyIdHash
          schema:
            type: string
          description: The strategy id hash.
          example: 628550609
        - in: query
          name: limit
          schema:
            type: integer
            default: 500
          description: The number of rows to return
        - in: query
          name: globalOrdinal
          schema:
            type: integer
          description: >-
            The global ordinal boundary used when fetching the next timeseries
            page.
          example: 100
        - in: query
          name: order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          description: The ordering of the results.
        - in: query
          name: symbol
          schema:
            type: string
          description: The symbol
          example: ETHP
        - name: orderHash
          in: query
          schema:
            type: string
            example: '0xe30f69fffa653b9cb7d4e90f099fe12ea21c5ff8e97f7854dd'
          description: >-
            the order hash of the order intent. Multiple order hash values can
            be provided.
        - in: query
          name: reason
          schema:
            type: integer
          description: >
            The reason for the creation of this row. Multiple reason values can
            be provided. Values include:
              0-Post;
              1-Trade;
              2-Liquidation;
              3-Cancel,
              4-Order Rejection,
              5-Cancel Rejection.
          example: 0
        - in: query
          name: since
          schema:
            type: integer
          description: >-
            The earliest time in seconds to fetch rows for. This param cannot be
            used together with param order = 'desc'
          example: 1678396827
      responses:
        '200':
          description: Order update data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeAPIOrderUpdateSuccessResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
components:
  schemas:
    ExchangeAPIOrderUpdateSuccessResponse:
      type: object
      additionalProperties: false
      properties:
        nextGlobalOrdinal:
          type:
            - number
            - 'null'
          description: >-
            Pointer for the global ordinal boundary of the next page. Will
            return null when there is no more data left to fetch.
          examples:
            - 100
            - null
        value:
          type: array
          items:
            type: object
            properties:
              globalOrdinal:
                type: number
                description: >-
                  The global ordinal for an order update that identifies it
                  uniquely.
                examples:
                  - 9
              epochId:
                type: number
                description: The epoch in which this transaction occured.
                examples:
                  - 100
              txOrdinal:
                type: number
                description: The transaction ordinal, within the epoch.
                examples:
                  - 3432
              ordinal:
                type: number
                description: The ordinal within this particular transaction.
                examples:
                  - 0
              orderRejection:
                type: number
                enum:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                  - 5
                description: The order rejection type. Only applicable when its rejection.
                examples:
                  - 0
              cancelRejection:
                type: number
                const: 0
                description: The cancel rejection type. Only applicable when its rejection.
                examples:
                  - 0
              reason:
                type: number
                enum:
                  - 0
                  - 1
                  - 2
                  - 3
                  - 4
                description: The reason for the order update.
                examples:
                  - 0
                  - 1
                  - 2
              amount:
                type: string
                description: The amount that was filled.
                examples:
                  - '1.5'
              quoteAssetAmount:
                type: string
                description: The quote asset amount.
                examples:
                  - '750'
              symbol:
                type: string
                description: The symbol of the asset that was filled.
                examples:
                  - ETHP
              price:
                type: string
                description: The fill price.
                examples:
                  - '500'
              makerFeeCollateral:
                type: string
                description: >-
                  The USDC fee that was incurred to the maker side of the fill
                  if the maker receives fees in USDC.
                examples:
                  - '0'
              makerFeeDDX:
                type: string
                description: >-
                  The fee that was incurred to the maker side of the fill if the
                  maker elected to receive fees in DDX. Null otherwise.
                examples:
                  - '0'
              makerRealizedPnl:
                type: string
                description: >-
                  The realized profit and loss (not inclusive of fees) incurred
                  to the maker due to this fill. Null otherwise.
                examples:
                  - '0'
              takerOrderIntent:
                type: object
                properties:
                  epochId:
                    type: number
                    description: The epoch in which this transaction occured.
                    examples:
                      - 100
                  orderHash:
                    type: string
                    description: A hash of this order contents.
                    examples:
                      - '0xa3c4c1c18c6e72c4aea8cfa0a1868ac4bc0f9b6463e8c9687f'
                  symbol:
                    type: string
                    description: The symbol of the asset for this order.
                    examples:
                      - ETHP
                  side:
                    type: number
                    enum:
                      - 0
                      - 1
                    description: 'The side of the order. Values include:  0: Bid,  1: Ask'
                    examples:
                      - 0
                      - 1
                  amount:
                    type: string
                    description: The amount of the order.
                    examples:
                      - '1.0'
                  price:
                    type: string
                    description: The price of the order.
                    examples:
                      - '1500.0'
                  traderAddress:
                    type: string
                    description: >-
                      The trader address prefixed with the blockchain
                      discriminant of the trader who issues this order.
                    examples:
                      - '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
                  strategyIdHash:
                    type: string
                    description: The strategy of the trader which owns this order.
                    examples:
                      - main
                  orderType:
                    type: number
                    enum:
                      - 0
                      - 1
                      - 2
                      - 3
                    description: >-
                      The type of order. Values include:  0: Limit,  1: Market 
                      2: Stop  3: LimitPostOnly
                    examples:
                      - 0
                      - 1
                      - 2
                      - 3
                  stopPrice:
                    type: string
                    description: >-
                      The stop price for this order. Not currently an active
                      field.
                    examples:
                      - '0'
                  nonce:
                    type: string
                    description: The nonce sent by the trader when placing this order.
                    examples:
                      - >-
                        0x3136373332393531393331383537373332363800000000000000000000000000
                  signature:
                    type: string
                    description: >-
                      A signature which was used to verify the authenticity of
                      the order, when it was sent by the trader. Encrypted using
                      the public key exposed by the leader Operator.
                    examples:
                      - >-
                        0xf9b19b088e3d0ad2c6330231899e03e50b45a8c7a1f52082aa0e9a61391fd5a35d3aece9dd2d42132a25b0aef5ac1bda7aee87c0c0c25ab9525d5eeeff9787d81b
                  createdAt:
                    type: string
                    format: date-time
                    description: The time when this row was added to the database.
                    examples:
                      - '2023-01-06T16:37:27.929Z'
                required:
                  - epochId
                  - orderHash
                  - symbol
                  - side
                  - amount
                  - price
                  - traderAddress
                  - strategyIdHash
                  - orderType
                  - stopPrice
                  - nonce
                  - signature
                  - createdAt
                additionalProperties: false
                description: >-
                  The order intent from the taker associated with this fill.
                  Only present when reason is trade.
              takerFeeCollateral:
                type: string
                description: >-
                  The fee that was incurred to the taker side of the fill if
                  taker receives fees in USDC. Null otherwise
                examples:
                  - '1.7874'
              takerFeeDDX:
                type: string
                description: >-
                  The fee that was incurred to the taker side of the fill if
                  taker receives fees in DDX. Null otherwise
                examples:
                  - '1.7874'
              takerRealizedPnl:
                type: string
                description: >-
                  The realized profit and loss (not inclusive of fees) incurred
                  to the taker due to this fill.
                examples:
                  - '0'
              liquidatedTraderAddress:
                type: string
                description: >-
                  In the case that this was a liquidation fill, the trader
                  address prefixed with the blockchain discriminant of the
                  trader that was liquidated.
                examples:
                  - null
                  - '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
              liquidatedStrategyIdHash:
                type: string
                description: The liquidated strategy id hash
                examples:
                  - null
                  - '0x2576ebd1'
              makerOrderIntent:
                type: object
                properties:
                  epochId:
                    type: number
                    description: The epoch in which this transaction occured.
                    examples:
                      - 100
                  orderHash:
                    type: string
                    description: A hash of this order contents.
                    examples:
                      - '0xa3c4c1c18c6e72c4aea8cfa0a1868ac4bc0f9b6463e8c9687f'
                  symbol:
                    type: string
                    description: The symbol of the asset for this order.
                    examples:
                      - ETHP
                  side:
                    type: number
                    enum:
                      - 0
                      - 1
                    description: 'The side of the order. Values include:  0: Bid,  1: Ask'
                    examples:
                      - 0
                      - 1
                  amount:
                    type: string
                    description: The amount of the order.
                    examples:
                      - '1.0'
                  price:
                    type: string
                    description: The price of the order.
                    examples:
                      - '1500.0'
                  traderAddress:
                    type: string
                    description: >-
                      The trader address prefixed with the blockchain
                      discriminant of the trader who issues this order.
                    examples:
                      - '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
                  strategyIdHash:
                    type: string
                    description: The strategy of the trader which owns this order.
                    examples:
                      - main
                  orderType:
                    type: number
                    enum:
                      - 0
                      - 1
                      - 2
                      - 3
                    description: >-
                      The type of order. Values include:  0: Limit,  1: Market 
                      2: Stop  3: LimitPostOnly
                    examples:
                      - 0
                      - 1
                      - 2
                      - 3
                  stopPrice:
                    type: string
                    description: >-
                      The stop price for this order. Not currently an active
                      field.
                    examples:
                      - '0'
                  nonce:
                    type: string
                    description: The nonce sent by the trader when placing this order.
                    examples:
                      - >-
                        0x3136373332393531393331383537373332363800000000000000000000000000
                  signature:
                    type: string
                    description: >-
                      A signature which was used to verify the authenticity of
                      the order, when it was sent by the trader. Encrypted using
                      the public key exposed by the leader Operator.
                    examples:
                      - >-
                        0xf9b19b088e3d0ad2c6330231899e03e50b45a8c7a1f52082aa0e9a61391fd5a35d3aece9dd2d42132a25b0aef5ac1bda7aee87c0c0c25ab9525d5eeeff9787d81b
                  createdAt:
                    type: string
                    format: date-time
                    description: The time when this row was added to the database.
                    examples:
                      - '2023-01-06T16:37:27.929Z'
                required:
                  - epochId
                  - orderHash
                  - symbol
                  - side
                  - amount
                  - price
                  - traderAddress
                  - strategyIdHash
                  - orderType
                  - stopPrice
                  - nonce
                  - signature
                  - createdAt
                additionalProperties: false
                description: The order intent from the maker associated with this fill.
              createdAt:
                type: string
                format: date-time
                description: The time when this row was added to the database.
                examples:
                  - '2023-01-06T16:37:27.929Z'
            required:
              - globalOrdinal
              - epochId
              - reason
              - amount
              - symbol
              - makerOrderIntent
              - createdAt
            additionalProperties: false
            description: A fill from a transaction. Also includes cancels and liquidations.
          description: The value of the response
        success:
          type: boolean
          const: true
          description: Whether the request was successful
        timestamp:
          type: number
          description: The timestamp of the response
          examples:
            - 1673031089
      required:
        - nextGlobalOrdinal
        - success
        - timestamp
        - value
      description: Successful response for the Order Update API
    StatsAPIErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errorMsg:
          anyOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: false
      required:
        - success
      additionalProperties: false

````