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

# Decorated Trades

> This endpoint returns option "times and sales" data that's decorated with pre-trade level-1 orderbook data and post-trade level-1 data. This is the core dataset of the Amberdata direction and GEX "Gamma Exposure" analysis. We use this orderbook impact to analyze the true aggressor of every trade, while assuming that market-makers (aka "dealers") are typically the passive trade participants. Some exchanges, such as "okex" and "bybit" will have volatility values in decimal format (ex: 97% iv will be noted as 0.97)




## OpenAPI

````yaml get /analytics/trades-flow/decorated-trades
openapi: 3.1.0
info:
  title: derivatives-api
  version: '2'
servers:
  - url: https://api.amberdata.com/markets/derivatives
security:
  - sec0: []
paths:
  /analytics/trades-flow/decorated-trades:
    get:
      summary: Decorated Trades
      description: >
        This endpoint returns option "times and sales" data that's decorated
        with pre-trade level-1 orderbook data and post-trade level-1 data. This
        is the core dataset of the Amberdata direction and GEX "Gamma Exposure"
        analysis. We use this orderbook impact to analyze the true aggressor of
        every trade, while assuming that market-makers (aka "dealers") are
        typically the passive trade participants. Some exchanges, such as "okex"
        and "bybit" will have volatility values in decimal format (ex: 97% iv
        will be noted as 0.97)
      operationId: derivatives-trades-flow-decorated-trades
      parameters:
        - name: exchange
          in: query
          description: >
            **[Required]** The exchange for which to retrieve the listed option
            level 1 quotes. **[Examples]** `deribit | okex | bybit`
          required: true
          schema:
            type: string
            default: deribit
        - name: currency
          in: query
          description: >
            **[Required]** The underlying currency for which there are listed
            option instruments. **[Examples]** `BTC | SOL_USDC` Note: inverse
            options have underlying currencies formatted as (BTC, ETH) while
            linear option currency formats include the stable coin in the same
            (SOL_USDC)
          required: true
          schema:
            type: string
            default: BTC
        - name: expiration
          in: query
          description: >
            **[Optional]** Filter records based on the specified expiration
            date. **[Examples]** `1578531600 | 1578531600000 |
            2020-09-01T01:00:00`
          schema:
            type: string
            format: date-time
        - name: instrument
          in: query
          description: >
            **[Optional]** Users can pass a single instrument in order to
            retrieve trade data for only the specified instrument.
            **[Examples]** `BTC-26APR24-100000-C`
          schema:
            type: string
        - name: putCall
          in: query
          description: |
            **[Optional]** The option type **[Examples]** `C | P`
          schema:
            type: string
        - name: startDate
          in: query
          description: >
            **[Optional]** Payload only includes data after this date
            (inclusive). **[Formats]** `seconds | milliseconds | iso8601`
            **[Examples]** `1578531600 | 1578531600000 | 2020-09-01T01:00:00`
          schema:
            type: string
            format: date-time
            default: '2024-05-01T00:00:00'
        - name: endDate
          in: query
          description: >
            **[Optional]** Payload only includes data before this date
            (exclusive). **[Formats]** `seconds | milliseconds | iso8601`
            **[Examples]** `1578531600 | 1578531600000 | 2020-09-01T01:00:00`
          schema:
            type: string
            format: date-time
            default: '2024-05-01T01:00:00'
        - name: strike
          in: query
          description: >
            **[Optional]** The option instrument subset with a given strike
            price. **[Examples]** `100000 | 3500`
          schema:
            type: integer
            format: int32
        - name: timeFormat
          in: query
          description: >
            **[Optional]** Time format of the timestamps in the return payload.
            **[Defaults]** `milliseconds | ms* | iso | iso8601 | hr |
            human_readable`
          schema:
            type: string
        - name: blockTradeId
          in: query
          description: >
            **[Optional]** This flag enables users to filter for only blockTrade
            or non-blockTrades. If the user wants everything returned they can
            choose to leave the parameter blank.
          schema:
            type: boolean
        - name: Accept-Encoding
          in: header
          schema:
            type: string
            default: gzip
      responses:
        '200':
          description: Successful request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                    default: 0
                  title:
                    type: string
                    example: OK
                  description:
                    type: string
                    example: Successful request
                  payload:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            exchange:
                              type: string
                              example: deribit
                            preTradeOrderbookTimestamp:
                              type: integer
                              example: 1716161307196
                            exchangeTimestamp:
                              type: integer
                              example: 1716161308175
                            postTradeOrderbookTimestamp:
                              type: integer
                              example: 1716161308179
                            tradeId:
                              type: string
                              example: '302085048'
                            instrument:
                              type: string
                              example: BTC-24MAY24-68000-C
                            instrumentNormalized:
                              type: string
                              example: DERIBIT-BTC-24MAY24-68000.0-C
                            currency:
                              type: string
                              example: BTC
                            expirationTimestamp:
                              type: integer
                              example: 1716537600000
                            strike:
                              type: integer
                              example: 68000
                            putCall:
                              type: string
                              example: C
                            blockTradeId:
                              type: string
                              nullable: true
                              example: null
                            numberOfLegs:
                              type: integer
                              example: 0
                            liquidation:
                              type: string
                              nullable: true
                              example: null
                            tickDirection:
                              type: string
                              example: Minus Tick
                            tradeAmount:
                              type: number
                              example: 0.3
                            tradeIv:
                              type: number
                              example: 49.55
                            price:
                              type: number
                              example: 0.0115
                            priceUsd:
                              type: number
                              example: 762.697135
                            indexPrice:
                              type: number
                              example: 66242.94
                            underlyingPrice:
                              type: number
                              example: 66321.49
                            volume24h:
                              type: number
                              example: 46
                            priceHigh24h:
                              type: number
                              example: 0.02
                            priceLow24h:
                              type: number
                              example: 0.012
                            preTradeBidVolume:
                              type: number
                              example: 21.1
                            preTradeBidIv:
                              type: number
                              example: 48.29
                            preTradeBidPrice:
                              type: number
                              example: 0.011
                            preTradeMidIv:
                              type: number
                              example: 48.92
                            preTradeMidPrice:
                              type: number
                              example: 0.01125
                            preTradeMarkIv:
                              type: number
                              example: 49.2
                            preTradeMarkPrice:
                              type: number
                              example: 0.0114
                            preTradeAskVolume:
                              type: number
                              example: 0.3
                            preTradeAskIv:
                              type: number
                              example: 49.55
                            preTradeAskPrice:
                              type: number
                              example: 0.0115
                            postTradeBidVolume:
                              type: number
                              example: 0.7
                            postTradeBidIv:
                              type: number
                              example: 49.55
                            postTradeBidPrice:
                              type: number
                              example: 0.0115
                            postTradeMidIv:
                              type: number
                              example: 50.18
                            postTradeMidPrice:
                              type: number
                              example: 0.01175
                            postTradeMarkIv:
                              type: number
                              example: 49.2
                            postTradeMarkPrice:
                              type: number
                              example: 0.0114
                            postTradeAskVolume:
                              type: number
                              example: 63.7
                            postTradeAskIv:
                              type: number
                              example: 50.81
                            postTradeAskPrice:
                              type: number
                              example: 0.012
                            delta:
                              type: number
                              example: 0.33062
                            gamma:
                              type: number
                              example: 0.0001
                            theta:
                              type: number
                              example: -148.29166
                            vega:
                              type: number
                              example: 26.257
                            rho:
                              type: number
                              example: 2.52671
                            preTradeOpenInterest:
                              type: number
                              example: 541.1
                            postTradeOpenInterest:
                              type: number
                              example: 541.1
                            openInterestChange:
                              type: number
                              example: 0
              examples:
                success_response:
                  summary: Successful decorated trades response
                  value:
                    status: 200
                    title: OK
                    description: Successful request
                    payload:
                      data:
                        - exchange: deribit
                          preTradeOrderbookTimestamp: 1716161307196
                          exchangeTimestamp: 1716161308175
                          postTradeOrderbookTimestamp: 1716161308179
                          tradeId: '302085048'
                          instrument: BTC-24MAY24-68000-C
                          instrumentNormalized: DERIBIT-BTC-24MAY24-68000.0-C
                          currency: BTC
                          expirationTimestamp: 1716537600000
                          strike: 68000
                          putCall: C
                          blockTradeId: null
                          numberOfLegs: 0
                          liquidation: null
                          tickDirection: Minus Tick
                          tradeAmount: 0.3
                          tradeIv: 49.55
                          price: 0.0115
                          priceUsd: 762.697135
                          indexPrice: 66242.94
                          underlyingPrice: 66321.49
                          volume24h: 46
                          priceHigh24h: 0.02
                          priceLow24h: 0.012
                          preTradeBidVolume: 21.1
                          preTradeBidIv: 48.29
                          preTradeBidPrice: 0.011
                          preTradeMidIv: 48.92
                          preTradeMidPrice: 0.01125
                          preTradeMarkIv: 49.2
                          preTradeMarkPrice: 0.0114
                          preTradeAskVolume: 0.3
                          preTradeAskIv: 49.55
                          preTradeAskPrice: 0.0115
                          postTradeBidVolume: 0.7
                          postTradeBidIv: 49.55
                          postTradeBidPrice: 0.0115
                          postTradeMidIv: 50.18
                          postTradeMidPrice: 0.01175
                          postTradeMarkIv: 49.2
                          postTradeMarkPrice: 0.0114
                          postTradeAskVolume: 63.7
                          postTradeAskIv: 50.81
                          postTradeAskPrice: 0.012
                          delta: 0.33062
                          gamma: 0.0001
                          theta: -148.29166
                          vega: 26.257
                          rho: 2.52671
                          preTradeOpenInterest: 541.1
                          postTradeOpenInterest: 541.1
                          openInterestChange: 0
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties: {}
              examples:
                error_response:
                  summary: Bad request example
                  value: {}
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````