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

# Swaps in a time or slot range

> Page through historical swaps within a `[start_time, end_time]` (Unix epoch **seconds**) or `[start_slot, end_slot]` range. Combine with the same filters as [/swaps](#tag/swaps/get/swaps).



## OpenAPI

````yaml /api-reference/openapi.json get /swaps/range
openapi: 3.1.0
info:
  title: Dexploit API
  version: 1.0.0
  description: Real-time and historical Solana DEX swap and OHLCV data.
servers:
  - url: https://api.dexploit.dev
    description: Production
security:
  - ApiKeyHeader: []
  - BearerAuth: []
  - ApiKeyQuery: []
paths:
  /swaps/range:
    get:
      tags:
        - Swaps
      summary: Swaps in a time or slot range
      description: >-
        Page through historical swaps within a `[start_time, end_time]` (Unix
        epoch **seconds**) or `[start_slot, end_slot]` range. Combine with the
        same filters as [/swaps](#tag/swaps/get/swaps).
      operationId: listSwapsRange
      parameters:
        - name: start_time
          in: query
          required: false
          schema:
            type: integer
          description: Unix epoch seconds.
        - name: end_time
          in: query
          required: false
          schema:
            type: integer
        - name: start_slot
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: end_slot
          in: query
          required: false
          schema:
            type: integer
            format: int64
        - name: token
          in: query
          required: false
          schema:
            type: string
        - name: trader
          in: query
          required: false
          schema:
            type: string
        - name: pool
          in: query
          required: false
          schema:
            type: string
        - name: is_buy
          in: query
          required: false
          schema:
            type: boolean
        - name: min_sol
          in: query
          required: false
          schema:
            type: integer
            format: int64
          description: >-
            Minimum swap size in **lamports**, not decimal SOL (1 SOL =
            1,000,000,000 lamports). The server parses this as a 64-bit unsigned
            integer, so a decimal value is rejected: `min_sol=20000.5` returns
            HTTP 400 `Failed to deserialize query string: min_sol: invalid digit
            found in string`. And `min_sol=20000` means 20,000 lamports (0.00002
            SOL), not 20,000 SOL.
        - name: dex
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 1000
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            default: 0
            minimum: 0
      responses:
        '200':
          description: Page of swaps
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapsPage'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    SwapsPage:
      type: object
      description: Paged list of swaps, shared by `/swaps`, `/swaps/range`, `/swaps/whale`.
      properties:
        swaps:
          type: array
          items:
            $ref: '#/components/schemas/Swap'
        total:
          type: integer
          description: Count of swaps in this page.
        has_more:
          type: boolean
          description: True if more rows match — increment `offset` to page.
    ErrorEnvelope:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: INVALID_PARAM
            message:
              type: string
              example: >-
                use pair_address; see /api/v1/pairs?token_address=X to discover
                pools
    Swap:
      type: object
      description: >-
        A single swap event from the raw swaps index. Same shape across
        `/swaps`, `/swaps/range`, `/swaps/whale`, `/swaps/{signature}`,
        `/swaps/trader/{wallet}`, `/swaps/token/{mint}`.


        Note that the streaming feeds (WebSocket and gRPC) use a *different*
        shape — see [WebSocket wire format](/streaming/websocket) — most notably
        `swap_type` (string) vs `is_buy` (bool) here, and `dex` as the string
        name vs `dex` as the integer ID here.
      properties:
        signature:
          type: string
          description: Solana transaction signature (base58).
        slot:
          type: integer
          format: int64
        timestamp:
          type: integer
          format: int64
          description: Unix epoch **milliseconds**.
        token_address:
          type: string
          description: Non-SOL side of the pool (the token being bought/sold).
        pair_address:
          type: string
          description: On-chain pool/LP account.
        user:
          type: string
          description: Trader wallet.
        is_buy:
          type: boolean
          description: '`true` if SOL → token; `false` if token → SOL.'
        dex:
          $ref: '#/components/schemas/DexId'
        sol_amount:
          type: integer
          format: int64
          description: Lamports (1 SOL = 1e9).
        token_amount:
          type: integer
          format: int64
          description: Token base units; divide by 10**`quote_decimals` for human-readable.
        fee:
          type: integer
          format: int64
          description: LP fee paid, in lamports.
        fee_bps:
          type: integer
          description: Effective LP fee, in basis points.
        creator_fee:
          type: integer
          format: int64
          description: Creator-set fee paid, in lamports (pump.fun + meteora-dbc).
        creator_fee_bps:
          type: integer
        price_per_token:
          type: number
          description: >-
            Realized fill price in **lamports per atomic token unit** — the raw
            stored value, NOT decimals-adjusted SOL. To get SOL per whole token:
            `price_per_token * 10**quote_decimals / 1e9`. Matches the definition
            on `ScreenerResultV2.price_per_token`. If you want the
            decimals-adjusted price directly, use `pool_price` instead — reading
            this field as SOL-per-token overstates it by 10**(9 -
            quote_decimals) (1000x for a 6-decimal token).
        pool_price:
          type: number
          description: >-
            Pool mid-price after the swap, in **SOL per whole token** (already
            decimals-adjusted). This is the decimals-adjusted companion to
            `price_per_token`, which is raw lamports per atomic unit.
        price_impact_bps:
          type: integer
          description: Difference between fill price and pre-swap mid, in basis points.
        base_decimals:
          type: integer
          description: Decimals of the *base* (SOL) side — typically 9.
        quote_decimals:
          type: integer
          description: Decimals of the *quote* (token) side.
        virtual_sol_reserves:
          type: integer
          format: int64
          description: Virtual SOL reserves (pump.fun bonding curve). 0 on non-pump pools.
        virtual_token_reserves:
          type: integer
          format: int64
        real_sol_reserves:
          type: integer
          format: int64
          description: Actual reserves on the pool after the swap.
        real_token_reserves:
          type: integer
          format: int64
        transfer_fee_in:
          type: integer
          format: int64
          description: >-
            Token-2022 transfer-fee paid on the input side (lamports/base
            units).
        transfer_fee_out:
          type: integer
          format: int64
        cashback:
          type: integer
          format: int64
          description: Cashback rebated to the trader (lamports).
        cashback_bps:
          type: integer
    DexId:
      type: integer
      description: |-
        Integer DEX identifier used in raw swap rows. Mapping:

        | ID | DEX |
        | -- | --- |
        | 1  | `pumpfun` |
        | 2  | `pumpswap` |
        | 3  | `raydium_amm` |
        | 4  | `raydium_clmm` |
        | 5  | `raydium_cpmm` |
        | 6  | `orca` |
        | 7  | `meteora_damm_v2` |
        | 8  | `meteora_dbc` |
        | 9  | `meteora_dlmm` |
        | 10 | `meteora_pools` |
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Preferred for swaps-api endpoints (`/swaps/*`, `/stats/*`, `/trending`,
        `/pool-events`).
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Required by the OHLCV endpoints (`/api/v1/*`) and accepted by every
        other endpoint. Send `Authorization: Bearer ohlcv_live_sk_<your_key>`.
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: >-
        Browser-friendly alternative to the Bearer header — accepted by every
        endpoint and required for WebSocket from the browser.

````