> ## 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 of one transaction, by signature

> Look up the swaps emitted by a specific Solana transaction.

A signature names a *transaction*, and a transaction can hold more than one swap (a multi-hop route, or swaps on several venues), so the response is an envelope: `swaps` holds every swap of the transaction and `total` counts them. A transaction with one swap gives a one-element `swaps` array. The swaps are never paged, and they come back in a fixed order (see `swaps` in the response).

This route used to return one swap object with no envelope, which for a transaction with several swaps was one of them, chosen arbitrarily. See the [changelog](/changelog).



## OpenAPI

````yaml /api-reference/openapi.json get /swaps/{signature}
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/{signature}:
    get:
      tags:
        - Swaps
      summary: Swaps of one transaction, by signature
      description: >-
        Look up the swaps emitted by a specific Solana transaction.


        A signature names a *transaction*, and a transaction can hold more than
        one swap (a multi-hop route, or swaps on several venues), so the
        response is an envelope: `swaps` holds every swap of the transaction and
        `total` counts them. A transaction with one swap gives a one-element
        `swaps` array. The swaps are never paged, and they come back in a fixed
        order (see `swaps` in the response).


        This route used to return one swap object with no envelope, which for a
        transaction with several swaps was one of them, chosen arbitrarily. See
        the [changelog](/changelog).
      operationId: getSwapBySignature
      parameters:
        - name: signature
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Every swap of the transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignatureSwaps'
        '404':
          description: Signature not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapsApiError'
        '503':
          description: >-
            The lookup ran out of its time budget, so whether the swap exists is
            unknown (`error: service_unavailable`). Retry after the
            `Retry-After` interval. A 404 means the signature was looked up and
            is not there; a timeout is never reported as a 404.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                example: 5
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SwapsApiError'
components:
  schemas:
    SignatureSwaps:
      type: object
      description: Every swap of one transaction, returned by `GET /swaps/{signature}`.
      required:
        - signature
        - total
        - swaps
        - price_semantics
      properties:
        signature:
          type: string
          description: The transaction signature that was requested.
        total:
          type: integer
          description: >-
            Number of swaps in `swaps`. The swaps of one transaction are never
            paged, so this is always `swaps.length`.
        swaps:
          type: array
          items:
            $ref: '#/components/schemas/Swap'
          description: >-
            Every swap the transaction emitted, at least one. A transaction with
            one swap gives a one-element array. The order is fixed: ascending
            `slot`, `block_tx_index` and `ix_index`, then `dex` (the venue id),
            with a fixed final tie-break, so the same request always returns the
            same order. `ix_index` is numbered per decoder (see its
            description), so the order is the order the swaps ran in only among
            swaps read by the same decoder; across venues it is deterministic
            but not execution order.
        price_semantics:
          type: string
          description: >-
            A short, machine-readable note on how the price fields in this
            response are derived. Emitted on every response so a client never
            has to infer it from the docs. Treat it as informational text, not a
            stable enum — the wording may change as derivations change.
      example:
        signature: >-
          2B9pP1c1imNEcyCPBBnE9La3UYCkBMxzNehRLXNV4Hj7y2ZqB46JwopqYgsnTkRaajgs4x5aso5CdLGBJsNK4W22
        total: 2
        swaps:
          - timestamp: 1791398356000
            slot: 454305668
            signature: >-
              2B9pP1c1imNEcyCPBBnE9La3UYCkBMxzNehRLXNV4Hj7y2ZqB46JwopqYgsnTkRaajgs4x5aso5CdLGBJsNK4W22
            token_address: DU6JbpQshZU821X1JKQtcFfj4WRm34WFoixs2p8jnuBL
            pair_address: A7dPgUPsoEEG56ZopxsfyqvvMJ3tdAXM1ub86wEEFUJm
            user: FajP2FjmdGDxPwbhVStVVEkMQ2sC2nEayypBztviPfNM
            is_buy: false
            sol_amount: 54609143
            token_amount: 479835144917
            virtual_sol_reserves: 60499422171
            virtual_token_reserves: 532071201487917
            fee: 518787
            price_per_token: 0.00011380813510324691
            dex: 1
            real_sol_reserves: 30499422171
            real_token_reserves: 252171201487917
            creator_fee: 163828
            fee_bps: 95
            creator_fee_bps: 30
            price_impact_bps: -9
            base_decimals: 9
            quote_decimals: 6
            pool_price: 1.137055003199114e-7
            transfer_fee_in: 0
            transfer_fee_out: 0
            cashback: 0
            cashback_bps: 0
            ix_index: 0
            block_tx_index: 157
            time_source: 1
            agent_trade: 1
          - timestamp: 1791398356000
            slot: 454305668
            signature: >-
              2B9pP1c1imNEcyCPBBnE9La3UYCkBMxzNehRLXNV4Hj7y2ZqB46JwopqYgsnTkRaajgs4x5aso5CdLGBJsNK4W22
            token_address: 8sGfh5FLDenW2uSDbStnzAE2RaZYtvh81WdRChJTpump
            pair_address: 4r6FqXB4wbMxtgBMFBKQBuEFEvg9LJrgQLqvsWHGKnAK
            user: FajP2FjmdGDxPwbhVStVVEkMQ2sC2nEayypBztviPfNM
            is_buy: true
            sol_amount: 53260767
            token_amount: 1880897675995
            virtual_sol_reserves: 30217928086
            virtual_token_reserves: 1065261652305393
            fee: 505978
            price_per_token: 0.00002831667436232272
            dex: 1
            real_sol_reserves: 217928086
            real_token_reserves: 785361652305393
            creator_fee: 159783
            fee_bps: 95
            creator_fee_bps: 30
            price_impact_bps: -17
            base_decimals: 9
            quote_decimals: 6
            pool_price: 2.8366672188568576e-8
            transfer_fee_in: 0
            transfer_fee_out: 0
            cashback: 0
            cashback_bps: 0
            ix_index: 1
            block_tx_index: 157
            time_source: 1
            agent_trade: 1
        price_semantics: >-
          pool_price=RAW vault ratio, uncorrected (not a tradeable price);
          price_impact_bps=CORRECTED at read time, null where not computed; for
          an executed price use price_per_token. See
          https://docs.dexploit.dev/concepts/coverage
    SwapsApiError:
      type: object
      description: >-
        The error body of the swaps routes (`/swaps/...`), which is flat, unlike
        the `ErrorEnvelope` of the other APIs. Authentication and rate-limit
        errors (401, 429) come from the gateway and use `ErrorEnvelope`.
      required:
        - error
        - message
      properties:
        error:
          type: string
          enum:
            - not_found
            - invalid_parameter
            - database_error
            - internal_error
            - service_unavailable
          description: Machine-readable error kind.
        message:
          type: string
          description: Human-readable detail. Not a stable format.
      example:
        error: not_found
        message: >-
          Swap not found:
          43nGAPtVqZxiar6cbdqBg4DRTkG6gM2EsPzPz1igqWkLraYDZcygonrGXkAynXkFr8QocyG4BnefMBzVXMkbDYX2
    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: >-
            The price this trade executed at, in **lamports per atomic token
            unit** — it is exactly `sol_amount / token_amount`, computed from
            the trade's own two legs and nothing else. Scale it once for SOL per
            whole token: `price_per_token * 10**(quote_decimals -
            base_decimals)` (equivalently `price_per_token * 10**quote_decimals
            / 1e9`, since `base_decimals` is 9). Reading the raw value as
            SOL-per-token overstates it by 10**(9 - quote_decimals) — 1000x for
            a 6-decimal token. Because it never touches pool reserves, this is
            the one price field that is correct on all ten venues and across all
            history; prefer it over `pool_price` whenever you need a price a
            trade could actually fill at. Matches the definition on
            `ScreenerResultV2.price_per_token`.
        pool_price:
          type: number
          description: >-
            The ratio of the pool's **reported** SOL reserve to its **reported**
            token reserve, scaled to SOL per whole token and passed through as
            the venue published it. It is a reserve statistic, not a tradeable
            quote. On constant-product and bonding-curve pools it lands within
            about a fee of the executed price; on concentrated-liquidity pools
            (`raydium_clmm`, `orca`, `meteora_damm_v2`, `meteora_dlmm`) the
            reported reserves are whole-pool inventory rather than the liquidity
            at the active price, and on PumpSwap pools that migrated from the
            pump.fun bonding curve after mid-July 2026 the ratio understates the
            price by `(sol_reserve + 17.58) / sol_reserve`. Use
            `price_per_token` for the price a trade executed at. Per-venue
            measured gaps are in [Data coverage](/concepts/coverage).
        price_impact_bps:
          type:
            - integer
            - 'null'
          description: >-
            Nullable (GraphQL: `Int`; the WebSocket feed is nullable too).
            `null` where no impact was computed: on `meteora_dbc` and
            `meteora_pools`; on `orca`, `raydium_amm`, `raydium_cpmm`,
            `raydium_clmm`, `meteora_dlmm` and `meteora_damm_v2` for swaps from
            before that venue started computing it and for swaps that couldn't
            be priced; on trades by pump.fun's own Mayhem program (`agent_trade
            = 2`, and older zero-fee `pumpfun` trades by the same program); and
            on dust trades whose smaller leg (`sol_amount` or `token_amount`, in
            base units) is under 10,000, where one unit of rounding moves the
            executed price by more than 1 bp. On REST and GraphQL a `0` is a
            real reading: on `pumpfun` and `pumpswap` an impact under 1 bp
            (truncated). On the six venues above the value is the executed price
            against the pool's price just before the trade, pool fee included,
            rounded to the nearest bp, so it is never `0`; positive means the
            price moved against the trader. On `pumpfun` and `pumpswap` it is
            computed against the pool's own reserves (on `pumpfun` the curve
            after the trade, so it reads zero or negative). On `pumpswap` the
            comparison is corrected for the SOL a pump.fun-migrated pool holds
            outside the account the swap reports, so it does NOT inherit the
            understatement described for `pool_price`. It measures impact
            relative to the pool, not slippage against an external reference.
            REST and GraphQL clamp it to the Int16 range (−32,768 to 32,767);
            the WebSocket feed carries the full value. The gRPC streams don't
            carry this field.
        base_decimals:
          type: integer
          description: Decimals of the *base* (SOL) side — 9 on every venue.
        quote_decimals:
          type: integer
          description: >-
            Decimals of the *quote* side, i.e. **the token's** own decimals
            despite the name. Commonly 6, but 9 and other values are normal —
            read it per row.
        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: >-
            Pool reserves as reported alongside the swap. On the
            concentrated-liquidity venues these are whole-pool totals
            (TVL-like), not active-tick liquidity. On `meteora_pools` liquidity
            sits in shared dynamic vaults, so both reserve fields come back `0`.
        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
        block_tx_index:
          type: integer
          format: int64
          description: >-
            Position of the swap's transaction within its block. Swaps from
            before 2026-06-10 carry `0`.
        ix_index:
          type: integer
          description: >-
            The swap's index within its transaction, as numbered by the decoder
            that read it. Each decoder starts at `0`, so two swaps of one
            transaction on different venues can both be `0`. Among swaps read by
            the same decoder it follows the order they ran. Swaps from before
            2026-05-30 carry `0`.
    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.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.