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

# LWAP

> Liquidity Weighted Average Price (LWAP) represents the average execution price achieved when trading through all resting orders in the order book (sweeping the book), up to a specified depth. For example, if you sell through the book down to 50 basis points away from the best-bid/best-ask, LWAP calculates the average execution price for that trade.



## OpenAPI

````yaml get /depth/lwap
openapi: 3.1.0
info:
  title: spot-analytics
  version: '2'
servers:
  - url: https://api.amberdata.com/markets/spot/analytics
security:
  - sec0: []
paths:
  /depth/lwap:
    get:
      summary: LWAP
      description: >-
        Liquidity Weighted Average Price (LWAP) represents the average execution
        price achieved when trading through all resting orders in the order book
        (sweeping the book), up to a specified depth. For example, if you sell
        through the book down to 50 basis points away from the
        best-bid/best-ask, LWAP calculates the average execution price for that
        trade.
      operationId: spot-analytics-order-book-depth-lwap
      parameters:
        - name: exchange
          in: query
          description: >-
            **[Required]** The exchange for which to retrieve listed spot
            instruments.

            **[Examples]** ` gdax | okex | binance | binanceus`
          required: true
          schema:
            type: string
            default: gdax
        - name: pair
          in: query
          description: |-
            **[Required]** The currency pair for the spot instrument.
            **[Examples]** ` btc_usd | btc_usdc | eth_usd `
          required: true
          schema:
            type: string
            default: btc_usd
        - name: startDate
          in: query
          description: >-
            **[Optional]** Payload only includes data after this date
            (inclusive).

            **[Formats]** `seconds | milliseconds | iso8601` 

            **[Examples]** `1578531600 | 1578531600000 | 2025-02-27`
          schema:
            type: string
            default: '2025-03-15'
        - name: endDate
          in: query
          description: >-
            **[Optional]** Payload only includes data up to this date
            (exclusive).

            **[Formats]** `seconds | milliseconds | iso8601` 

            **[Examples]** `1578531600 | 1578531600000 | 2025-02-27`
          schema:
            type: string
            default: '2025-03-16'
        - 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
            default: hr
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    status: 200
                    title: OK
                    description: Successful request
                    payload:
                      data:
                        - basisPoints005: 5.54432285
                          basisPoints005OrderCount: 61
                          basisPoints025: 55.42346636999996
                          basisPoints025OrderCount: 212
                          basisPoints050: 86.13989642000006
                          basisPoints050OrderCount: 264
                          basisPoints100: 162.79283695000004
                          basisPoints100OrderCount: 398
                          bestAskPrice: 84160.01
                          bestBidPrice: 84160
                          exchange: gdax
                          lwap005: 84182.63687387163
                          lwap005ExecutionVersusBBO: 0.026885540854415524
                          lwap005UsdMillion: 0.46673571719305906
                          lwap025: 84275.95356466963
                          lwap025ExecutionVersusBBO: 0.13776562606115927
                          lwap025UsdMillion: 4.670865478191145
                          lwap050: 84332.34147661841
                          lwap050ExecutionVersusBBO: 0.20476646404679055
                          lwap050UsdMillion: 7.264379159651985
                          lwap100: 84549.86045854498
                          lwap100ExecutionVersusBBO: 0.4632252996939812
                          lwap100UsdMillion: 13.764111647773168
                          midPrice: 84160.005
                          pair: btc_usd
                          side: ask
                          slippage005UsdVersusBBO: 12548.44219280892
                          slippage025UsdVersusBBO: 643484.7068504592
                          slippage050UsdVersusBBO: 1487501.2340171328
                          slippage100UsdVersusBBO: 6375884.743061143
                          spreadPercent: 0.000011882128565416923
                          timestamp: 2025-03-15 00:27:00 000
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  title:
                    type: string
                    example: OK
                  description:
                    type: string
                    example: Successful request
                  payload:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            basisPointsXXX:
                              type: number
                              example: 5.54432285
                              description: >-
                                The total volume size in coins (base) for xxx
                                bps away from BBO
                            basisPointsXXXOrderCount:
                              type: integer
                              example: 61
                              description: The total order count for xxx bps away from BBO
                            bestAskPrice:
                              type: number
                              example: 84160.01
                              description: The best ask price
                            bestBidPrice:
                              type: number
                              example: 84160
                              description: The best bid price
                            exchange:
                              type: string
                              example: gdax
                              description: The subject exchange
                            lwapXXX:
                              type: number
                              example: 84182.63687387163
                              description: >-
                                The executed liquidity average weighted price
                                from sweeping the book through xxx bps from BBO
                            lwapXXXExecutionVersusBBO:
                              type: number
                              example: 0.026885540854415524
                              description: >-
                                The slippage in decimal percentage terms from
                                sweeping the book through XXX bps through BBO
                            lwapXXXUsdMillion:
                              type: number
                              example: 0.46673571719305906
                              description: >-
                                The total executed volume in quote (often USD)
                                from sweeping the book through XXX bps through
                                BBO
                            midPrice:
                              type: number
                              example: 84160.005
                              description: The mid-price between BBO
                            pair:
                              type: string
                              example: btc_usd
                              description: The subject pair
                            side:
                              type: string
                              example: ask
                              description: The ask or bid side of the LWAP
                            slippageXXXUsdVersusBBO:
                              type: number
                              example: 12548.44219280892
                              description: >-
                                The average slippage in quote terms (often USD)
                                from sweeping the book through XXX bps through
                                BBO versus executing at BBO
                            spreadPercent:
                              type: number
                              example: 0.000011882128565416923
                              description: The absolute BBO spread divided by mid-price
                            timestamp:
                              type: string
                              example: 2025-03-15 00:27:00 000
                              description: The observation timestamp
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````