# Pump Swap

### Common Properties

All decoded events include the following base properties from `BaseTransactionRecord`:

| Property          | Type             | JSON Type        | Description                                           |
| ----------------- | ---------------- | ---------------- | ----------------------------------------------------- |
| `uuid`            | `bigint`         | `string`         | Unique identifier for the transaction record          |
| `instructionPath` | `string`         | `string`         | Path to the instruction within the transaction        |
| `parentProgramId` | `string \| null` | `string \| null` | ID of the parent program if applicable                |
| `txSignature`     | `string`         | `string`         | Transaction signature                                 |
| `blockTime`       | `number`         | `number`         | Block timestamp                                       |
| `programId`       | `string`         | `string`         | Pump Fun AMM program ID                               |
| `eventType`       | `string`         | `string`         | Type of event (CREATE\_POOL, SWAP, DEPOSIT, WITHDRAW) |
| `decoderType`     | `DecoderType`    | `string`         | Decoder type identifier                               |
| `blockHeight`     | `number`         | `number`         | Block height                                          |
| `slot`            | `number`         | `number`         | Blockchain slot number                                |
| `txFee`           | `number`         | `number`         | Transaction fee in lamports                           |
| `txFeeUiAmount`   | `PreciseDecimal` | `string`         | UI-formatted transaction fee                          |

### CREATE\_POOL Event

Pool creation event for Pump Fun AMM.

| Property                   | Type             | JSON Type | Description                    |
| -------------------------- | ---------------- | --------- | ------------------------------ |
| `index`                    | `number`         | `number`  | Pool index                     |
| `baseAmountIn`             | `bigint`         | `string`  | Base token amount deposited    |
| `baseAmountInUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted base amount       |
| `quoteAmountIn`            | `bigint`         | `string`  | Quote token amount deposited   |
| `quoteAmountInUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted quote amount      |
| `timestamp`                | `string`         | `string`  | Pool creation timestamp        |
| `creator`                  | `string`         | `string`  | Pool creator address           |
| `baseMint`                 | `string`         | `string`  | Base token mint address        |
| `quoteMint`                | `string`         | `string`  | Quote token mint address       |
| `baseMintDecimals`         | `number`         | `number`  | Base token decimal places      |
| `quoteMintDecimals`        | `number`         | `number`  | Quote token decimal places     |
| `poolBaseAmount`           | `bigint`         | `string`  | Pool base token amount         |
| `poolBaseAmountUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted pool base amount  |
| `poolQuoteAmount`          | `bigint`         | `string`  | Pool quote token amount        |
| `poolQuoteAmountUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted pool quote amount |
| `minimumLiquidity`         | `bigint`         | `string`  | Minimum liquidity amount       |
| `minimumLiquidityUiAmount` | `PreciseDecimal` | `string`  | UI-formatted minimum liquidity |
| `initialLiquidity`         | `bigint`         | `string`  | Initial liquidity amount       |
| `initialLiquidityUiAmount` | `PreciseDecimal` | `string`  | UI-formatted initial liquidity |
| `lpTokenAmountOut`         | `bigint`         | `string`  | LP tokens minted               |
| `lpTokenAmountOutUiAmount` | `PreciseDecimal` | `string`  | UI-formatted LP tokens minted  |
| `poolBump`                 | `number`         | `number`  | Pool account bump seed         |
| `pool`                     | `string`         | `string`  | Pool account address           |
| `lpMint`                   | `string`         | `string`  | LP token mint address          |
| `userBaseTokenAccount`     | `string`         | `string`  | User's base token account      |
| `userQuoteTokenAccount`    | `string`         | `string`  | User's quote token account     |

### SWAP Event

Token swap event on Pump Fun AMM pool. The swap event has different properties depending on whether it's a buy or sell order.

#### Common SWAP Properties

| Property                           | Type             | JSON Type | Description                          |
| ---------------------------------- | ---------------- | --------- | ------------------------------------ |
| `timestamp`                        | `string`         | `string`  | Swap timestamp                       |
| `lpFeeBasisPoints`                 | `number`         | `number`  | LP fee in basis points               |
| `lpFee`                            | `bigint`         | `string`  | LP fee amount                        |
| `lpFeeUiAmount`                    | `PreciseDecimal` | `string`  | UI-formatted LP fee                  |
| `protocolFeeBasisPoints`           | `number`         | `number`  | Protocol fee in basis points         |
| `protocolFee`                      | `bigint`         | `string`  | Protocol fee amount                  |
| `protocolFeeUiAmount`              | `PreciseDecimal` | `string`  | UI-formatted protocol fee            |
| `userBaseTokenReserves`            | `bigint`         | `string`  | User base token reserves             |
| `userBaseTokenReservesUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user base reserves      |
| `userQuoteTokenReserves`           | `bigint`         | `string`  | User quote token reserves            |
| `userQuoteTokenReservesUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user quote reserves     |
| `poolBaseTokenReserves`            | `bigint`         | `string`  | Pool base token reserves             |
| `poolBaseTokenReservesUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted pool base reserves      |
| `poolQuoteTokenReserves`           | `bigint`         | `string`  | Pool quote token reserves            |
| `poolQuoteTokenReservesUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted pool quote reserves     |
| `pool`                             | `string`         | `string`  | Pool account address                 |
| `user`                             | `string`         | `string`  | User account address                 |
| `userBaseTokenAccount`             | `string`         | `string`  | User's base token account            |
| `userQuoteTokenAccount`            | `string`         | `string`  | User's quote token account           |
| `protocolFeeRecipient`             | `string`         | `string`  | Protocol fee recipient address       |
| `protocolFeeRecipientTokenAccount` | `string`         | `string`  | Protocol fee recipient token account |
| `price`                            | `PreciseDecimal` | `string`  | Actual swap price                    |
| `pricePost`                        | `PreciseDecimal` | `string`  | Price after swap                     |
| `userBasePreBalance`               | `bigint`         | `string`  | User base balance before swap        |
| `userBasePreBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted user base pre-balance   |
| `userBasePostBalance`              | `bigint`         | `string`  | User base balance after swap         |
| `userBasePostBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted user base post-balance  |
| `userQuotePreBalance`              | `bigint`         | `string`  | User quote balance before swap       |
| `userQuotePreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted user quote pre-balance  |
| `userQuotePostBalance`             | `bigint`         | `string`  | User quote balance after swap        |
| `userQuotePostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted user quote post-balance |
| `poolBasePreBalance`               | `bigint`         | `string`  | Pool base balance before swap        |
| `poolBasePreBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted pool base pre-balance   |
| `poolBasePostBalance`              | `bigint`         | `string`  | Pool base balance after swap         |
| `poolBasePostBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted pool base post-balance  |
| `poolQuotePreBalance`              | `bigint`         | `string`  | Pool quote balance before swap       |
| `poolQuotePreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted pool quote pre-balance  |
| `poolQuotePostBalance`             | `bigint`         | `string`  | Pool quote balance after swap        |
| `poolQuotePostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted pool quote post-balance |
| `quoteMint`                        | `string`         | `string`  | Quote token mint address             |
| `baseMint`                         | `string`         | `string`  | Base token mint address              |

#### BUY Order Properties

| Property                         | Type             | JSON Type | Description                           |
| -------------------------------- | ---------------- | --------- | ------------------------------------- |
| `isBuy`                          | `boolean`        | `boolean` | True for buy orders                   |
| `baseAmountOut`                  | `bigint`         | `string`  | Base tokens received                  |
| `baseAmountOutUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted base tokens received     |
| `maxQuoteAmountIn`               | `bigint`         | `string`  | Maximum quote tokens to spend         |
| `maxQuoteAmountInUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted max quote spend          |
| `quoteAmountIn`                  | `bigint`         | `string`  | Actual quote tokens spent             |
| `quoteAmountInUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted quote tokens spent       |
| `quoteAmountInWithLpFee`         | `bigint`         | `string`  | Quote amount including LP fee         |
| `quoteAmountInWithLpFeeUiAmount` | `PreciseDecimal` | `string`  | UI-formatted quote amount with LP fee |
| `userQuoteAmountIn`              | `bigint`         | `string`  | User's quote amount input             |
| `userQuoteAmountInUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted user quote input         |

#### SELL Order Properties

| Property                             | Type             | JSON Type | Description                              |
| ------------------------------------ | ---------------- | --------- | ---------------------------------------- |
| `isBuy`                              | `boolean`        | `boolean` | False for sell orders                    |
| `baseAmountIn`                       | `bigint`         | `string`  | Base tokens sold                         |
| `baseAmountInUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted base tokens sold            |
| `minQuoteAmountOut`                  | `bigint`         | `string`  | Minimum quote tokens to receive          |
| `minQuoteAmountOutUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted min quote receive           |
| `quoteAmountOut`                     | `bigint`         | `string`  | Actual quote tokens received             |
| `quoteAmountOutUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted quote tokens received       |
| `quoteAmountOutWithoutLpFee`         | `bigint`         | `string`  | Quote amount excluding LP fee            |
| `quoteAmountOutWithoutLpFeeUiAmount` | `PreciseDecimal` | `string`  | UI-formatted quote amount without LP fee |
| `userQuoteAmountOut`                 | `bigint`         | `string`  | User's quote amount output               |
| `userQuoteAmountOutUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted user quote output           |

### DEPOSIT Event

Liquidity deposit event for Pump Fun AMM.

| Property                         | Type             | JSON Type | Description                          |
| -------------------------------- | ---------------- | --------- | ------------------------------------ |
| `timestamp`                      | `string`         | `string`  | Deposit timestamp                    |
| `lpTokenAmountOut`               | `bigint`         | `string`  | LP tokens minted                     |
| `lpTokenAmountOutUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted LP tokens minted        |
| `maxBaseAmountIn`                | `bigint`         | `string`  | Maximum base tokens to deposit       |
| `maxBaseAmountInUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted max base deposit        |
| `maxQuoteAmountIn`               | `bigint`         | `string`  | Maximum quote tokens to deposit      |
| `maxQuoteAmountInUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted max quote deposit       |
| `userBaseTokenReserves`          | `bigint`         | `string`  | User base token reserves             |
| `userBaseTokenReservesUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user base reserves      |
| `userQuoteTokenReserves`         | `bigint`         | `string`  | User quote token reserves            |
| `userQuoteTokenReservesUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user quote reserves     |
| `poolBaseTokenReserves`          | `bigint`         | `string`  | Pool base token reserves             |
| `poolBaseTokenReservesUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted pool base reserves      |
| `poolQuoteTokenReserves`         | `bigint`         | `string`  | Pool quote token reserves            |
| `poolQuoteTokenReservesUiAmount` | `PreciseDecimal` | `string`  | UI-formatted pool quote reserves     |
| `baseAmountIn`                   | `bigint`         | `string`  | Actual base tokens deposited         |
| `baseAmountInUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted base deposit amount     |
| `quoteAmountIn`                  | `bigint`         | `string`  | Actual quote tokens deposited        |
| `quoteAmountInUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted quote deposit amount    |
| `lpMintSupply`                   | `bigint`         | `string`  | LP mint total supply                 |
| `lpMintSupplyUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted LP mint supply          |
| `pool`                           | `string`         | `string`  | Pool account address                 |
| `user`                           | `string`         | `string`  | User account address                 |
| `userBaseTokenAccount`           | `string`         | `string`  | User's base token account            |
| `userQuoteTokenAccount`          | `string`         | `string`  | User's quote token account           |
| `userPoolTokenAccount`           | `string`         | `string`  | User's LP token account              |
| `userBasePreBalance`             | `bigint`         | `string`  | User base balance before deposit     |
| `userBasePreBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted user base pre-balance   |
| `userBasePostBalance`            | `bigint`         | `string`  | User base balance after deposit      |
| `userBasePostBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user base post-balance  |
| `userQuotePreBalance`            | `bigint`         | `string`  | User quote balance before deposit    |
| `userQuotePreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user quote pre-balance  |
| `userQuotePostBalance`           | `bigint`         | `string`  | User quote balance after deposit     |
| `userQuotePostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user quote post-balance |
| `poolBasePreBalance`             | `bigint`         | `string`  | Pool base balance before deposit     |
| `poolBasePreBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted pool base pre-balance   |
| `poolBasePostBalance`            | `bigint`         | `string`  | Pool base balance after deposit      |
| `poolBasePostBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted pool base post-balance  |
| `poolQuotePreBalance`            | `bigint`         | `string`  | Pool quote balance before deposit    |
| `poolQuotePreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted pool quote pre-balance  |
| `poolQuotePostBalance`           | `bigint`         | `string`  | Pool quote balance after deposit     |
| `poolQuotePostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted pool quote post-balance |
| `quoteMint`                      | `string`         | `string`  | Quote token mint address             |
| `baseMint`                       | `string`         | `string`  | Base token mint address              |
| `lpMintPreBalance`               | `bigint`         | `string`  | LP mint balance before deposit       |
| `lpMintPreBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted LP mint pre-balance     |
| `lpMintPostBalance`              | `bigint`         | `string`  | LP mint balance after deposit        |
| `lpMintPostBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted LP mint post-balance    |
| `lpMint`                         | `string`         | `string`  | LP token mint address                |

### WITHDRAW Event

Liquidity withdrawal event for Pump Fun AMM.

| Property                         | Type             | JSON Type | Description                          |
| -------------------------------- | ---------------- | --------- | ------------------------------------ |
| `timestamp`                      | `string`         | `string`  | Withdrawal timestamp                 |
| `lpTokenAmountIn`                | `bigint`         | `string`  | LP tokens burned                     |
| `lpTokenAmountInUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted LP tokens burned        |
| `minBaseAmountOut`               | `bigint`         | `string`  | Minimum base tokens to receive       |
| `minBaseAmountOutUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted min base receive        |
| `minQuoteAmountOut`              | `bigint`         | `string`  | Minimum quote tokens to receive      |
| `minQuoteAmountOutUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted min quote receive       |
| `userBaseTokenReserves`          | `bigint`         | `string`  | User base token reserves             |
| `userBaseTokenReservesUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user base reserves      |
| `userQuoteTokenReserves`         | `bigint`         | `string`  | User quote token reserves            |
| `userQuoteTokenReservesUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user quote reserves     |
| `poolBaseTokenReserves`          | `bigint`         | `string`  | Pool base token reserves             |
| `poolBaseTokenReservesUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted pool base reserves      |
| `poolQuoteTokenReserves`         | `bigint`         | `string`  | Pool quote token reserves            |
| `poolQuoteTokenReservesUiAmount` | `PreciseDecimal` | `string`  | UI-formatted pool quote reserves     |
| `baseAmountOut`                  | `bigint`         | `string`  | Actual base tokens withdrawn         |
| `baseAmountOutUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted base withdrawal amount  |
| `quoteAmountOut`                 | `bigint`         | `string`  | Actual quote tokens withdrawn        |
| `quoteAmountOutUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted quote withdrawal amount |
| `lpMintSupply`                   | `bigint`         | `string`  | LP mint total supply                 |
| `lpMintSupplyUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted LP mint supply          |
| `pool`                           | `string`         | `string`  | Pool account address                 |
| `user`                           | `string`         | `string`  | User account address                 |
| `userBaseTokenAccount`           | `string`         | `string`  | User's base token account            |
| `userQuoteTokenAccount`          | `string`         | `string`  | User's quote token account           |
| `userPoolTokenAccount`           | `string`         | `string`  | User's LP token account              |
| `userBasePreBalance`             | `bigint`         | `string`  | User base balance before withdrawal  |
| `userBasePreBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted user base pre-balance   |
| `userBasePostBalance`            | `bigint`         | `string`  | User base balance after withdrawal   |
| `userBasePostBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user base post-balance  |
| `userQuotePreBalance`            | `bigint`         | `string`  | User quote balance before withdrawal |
| `userQuotePreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user quote pre-balance  |
| `userQuotePostBalance`           | `bigint`         | `string`  | User quote balance after withdrawal  |
| `userQuotePostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user quote post-balance |
| `poolBasePreBalance`             | `bigint`         | `string`  | Pool base balance before withdrawal  |
| `poolBasePreBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted pool base pre-balance   |
| `poolBasePostBalance`            | `bigint`         | `string`  | Pool base balance after withdrawal   |
| `poolBasePostBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted pool base post-balance  |
| `poolQuotePreBalance`            | `bigint`         | `string`  | Pool quote balance before withdrawal |
| `poolQuotePreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted pool quote pre-balance  |
| `poolQuotePostBalance`           | `bigint`         | `string`  | Pool quote balance after withdrawal  |
| `poolQuotePostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted pool quote post-balance |
| `quoteMint`                      | `string`         | `string`  | Quote token mint address             |
| `baseMint`                       | `string`         | `string`  | Base token mint address              |
| `lpMintPreBalance`               | `bigint`         | `string`  | LP mint balance before withdrawal    |
| `lpMintPreBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted LP mint pre-balance     |
| `lpMintPostBalance`              | `bigint`         | `string`  | LP mint balance after withdrawal     |
| `lpMintPostBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted LP mint post-balance    |
| `lpMint`                         | `string`         | `string`  | LP token mint address                |

### Data Types

* `bigint`: Large integer values for token amounts and fees
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for decimals, indices, and percentages
* `boolean`: True/false values for buy/sell indicators
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (PUMP\_FUN\_AMM)

### Usage

The decoder automatically determines the event type and returns the appropriate structure. All monetary values are provided in both raw (`bigint`) and UI-formatted (`PreciseDecimal`) versions for flexibility in different use cases. SWAP events are discriminated by the `isBuy` property to determine if it's a buy or sell order, with different specific properties for each type.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lyslabs.ai/decoders/pump-swap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
