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

# Swap

> Raw swap data capturing every token exchange on liquidity venues.

| Field                    | Type                                                          | Description                                   |
| ------------------------ | ------------------------------------------------------------- | --------------------------------------------- |
| `id`                     | *Integer*                                                     | Unique identifier for the swap                |
| `swap_type`              | *[Swap Type](#swap-type)*                                     | Type of swap pair based on token roles.       |
| `protocol`               | *[Protocol](/documentation/solana/dex/overview#data-sources)* | DEX protocol that executed the swap.          |
| `wallet_address`         | *String \[address]*                                           | Wallet address that initiated the swap        |
| `pool_address`           | *String \[address]*                                           | Pool address that executed the swap           |
| `token_address_in`       | *String \[address]*                                           | Token address being swapped from              |
| `token_address_out`      | *String \[address]*                                           | Token address being swapped to                |
| `token_amount_in`        | *Number*                                                      | Amount of input token swapped                 |
| `token_amount_out`       | *Number*                                                      | Amount of output token received               |
| `token_price_in`         | *Number \[USD]*                                               | Price of input token at swap time             |
| `token_price_out`        | *Number \[USD]*                                               | Price of output token at swap time            |
| `pre_token_balance_in`   | *Number*                                                      | Wallet's input token balance before the swap  |
| `pre_token_balance_out`  | *Number*                                                      | Wallet's output token balance before the swap |
| `post_token_balance_in`  | *Number*                                                      | Wallet's input token balance after the swap   |
| `post_token_balance_out` | *Number*                                                      | Wallet's output token balance after the swap  |
| `usd_amount_in`          | *Number \[USD]*                                               | Value of input tokens                         |
| `usd_amount_out`         | *Number \[USD]*                                               | Value of output tokens                        |
| `block_slot`             | *Integer*                                                     | Solana block slot number                      |
| `block_time`             | *String \[date-time]*                                         | Timestamp of the block                        |
| `tx_hash`                | *String*                                                      | Transaction signature                         |

## Swap Type

Classifies the swap by the roles of the two tokens exchanged. A *quote* is a reference asset (such as SOL or a stablecoin); a *token* is any other asset.

*Enum(String)*

| Value         | Description                      |
| ------------- | -------------------------------- |
| `quote_token` | Quote (sell) to token (buy) swap |
| `token_quote` | Token (sell) to quote (buy) swap |
| `token_token` | Token (sell) to token (buy) swap |
| `quote_quote` | Quote (sell) to quote (buy) swap |
