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

# Gamma Snapshots (GEX)

> GEX aims to calculate the gamma exposure of Market Makers (MMs) and the resulting number of underlying contracts they must trade to keep their book delta-hedged. "Positive/long gamma" => more underlying stability because of "Buy low, sell high" "Negative/short gamma" => more underlying volatility because of "Sell low, buy high" Starting point is the direction of trades with our proprietary algorithm "AMBERDATA DIRECTION" composed of over 30 heuristics that estimate the "correct direction" = side of the initiator/aggressor of the trade at which other side there is "likely" a MMs. With this algorithm we are able to flag every trades by tracking the orderbook at millisecond level, to calculate and maintain a database of MMs gamma exposure




## OpenAPI

````yaml get /analytics/trades-flow/gamma-exposures-snapshots
openapi: 3.1.0
info:
  title: derivatives-api
  version: '2'
servers:
  - url: https://api.amberdata.com/markets/derivatives
security:
  - sec0: []
paths:
  /analytics/trades-flow/gamma-exposures-snapshots:
    get:
      summary: Gamma Snapshots (GEX)
      description: >
        GEX aims to calculate the gamma exposure of Market Makers (MMs) and the
        resulting number of underlying contracts they must trade to keep their
        book delta-hedged. "Positive/long gamma" => more underlying stability
        because of "Buy low, sell high" "Negative/short gamma" => more
        underlying volatility because of "Sell low, buy high" Starting point is
        the direction of trades with our proprietary algorithm "AMBERDATA
        DIRECTION" composed of over 30 heuristics that estimate the "correct
        direction" = side of the initiator/aggressor of the trade at which other
        side there is "likely" a MMs. With this algorithm we are able to flag
        every trades by tracking the orderbook at millisecond level, to
        calculate and maintain a database of MMs gamma exposure
      operationId: derivatives-trades-flow-gamma-gex-snapshots
      parameters:
        - name: exchange
          in: query
          description: >
            **[Required]** The exchange for which to retrieve the GEX.
            **[Examples]** `deribit | bybit | okex`
          required: true
          schema:
            type: string
            default: deribit
        - name: currency
          in: query
          description: >
            **[Required]** The underlying pair for which to retrieve the
            volatility cone. **[Examples]** `BTC | SOL_USDC`
          required: true
          schema:
            type: string
            default: BTC
        - 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-01-01'
        - 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-01-02'
        - 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
      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
                            currency:
                              type: string
                              example: BTC
                            snapshotTimestamp:
                              type: integer
                              example: 1717704000000
                            expirationTimestamp:
                              type: integer
                              example: 1717747200000
                            instrumentNormalized:
                              type: string
                              example: DERIBIT-BTC-07JUN24-52000.0-P
                            putCall:
                              type: string
                              example: P
                            dealerNetInventory:
                              type: number
                              example: 100.00000000000006
                            dealerTotalInventory:
                              type: number
                              example: 429.2
                            gammaLevel:
                              type: number
                              example: 0
                            indexPrice:
                              type: number
                              example: 70998.39
                      metadata:
                        type: object
                        properties:
                          api-version:
                            type: string
                            example: '2023-09-30'
              examples:
                success_response:
                  summary: Gamma snapshots (GEX) response
                  value:
                    status: 200
                    title: OK
                    description: Successful request
                    payload:
                      data:
                        - exchange: deribit
                          currency: BTC
                          snapshotTimestamp: 1717704000000
                          expirationTimestamp: 1717747200000
                          instrumentNormalized: DERIBIT-BTC-07JUN24-52000.0-P
                          putCall: P
                          dealerNetInventory: 100.00000000000006
                          dealerTotalInventory: 429.2
                          gammaLevel: 0
                          indexPrice: 70998.39
                        - exchange: deribit
                          currency: BTC
                          snapshotTimestamp: 1717704000000
                          expirationTimestamp: 1717747200000
                          instrumentNormalized: DERIBIT-BTC-07JUN24-54000.0-C
                          putCall: C
                          dealerNetInventory: 0
                          dealerTotalInventory: 0.1
                          gammaLevel: 0.0000010000000000000002
                          indexPrice: 68890.88
                        - exchange: deribit
                          currency: BTC
                          snapshotTimestamp: 1717704000000
                          expirationTimestamp: 1717747200000
                          instrumentNormalized: DERIBIT-BTC-07JUN24-54000.0-P
                          putCall: P
                          dealerNetInventory: -163.6
                          dealerTotalInventory: -214.9
                          gammaLevel: 0
                          indexPrice: 70849.39
                        - exchange: deribit
                          currency: BTC
                          snapshotTimestamp: 1717704000000
                          expirationTimestamp: 1717747200000
                          instrumentNormalized: DERIBIT-BTC-07JUN24-56000.0-P
                          putCall: P
                          dealerNetInventory: -148.19999999999993
                          dealerTotalInventory: -386.5
                          gammaLevel: 0
                          indexPrice: 70009.41
                        - exchange: deribit
                          currency: BTC
                          snapshotTimestamp: 1717704000000
                          expirationTimestamp: 1717747200000
                          instrumentNormalized: DERIBIT-BTC-07JUN24-58000.0-C
                          putCall: C
                          dealerNetInventory: 0
                          dealerTotalInventory: 0.2
                          gammaLevel: 0.0000020000000000000003
                          indexPrice: 68729.86
                        - exchange: deribit
                          currency: BTC
                          snapshotTimestamp: 1717704000000
                          expirationTimestamp: 1717747200000
                          instrumentNormalized: DERIBIT-BTC-07JUN24-58000.0-P
                          putCall: P
                          dealerNetInventory: 78.70000000000005
                          dealerTotalInventory: 123.3
                          gammaLevel: 0
                          indexPrice: 70698.95
                      metadata:
                        api-version: '2023-09-30'
        '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

````