# Introduction

Last updated April 2025. Our stack is continuously expanding - follow us on Twitter or join our community on Discord to keep up with the latest.

## What is LYS Labs?

LYS Labs is a blockchain data infrastructure focused on both real-time structured data streams served under 14ms and contextualized, AI-ready data served in under 30ms. This allows clients - from high-frequency traders to AI model trainers - to react before the rest of the market even knows what happened.

### Context Matters

In Web3, data is power. But raw data from the blockchain is fragmented, noisy, and hard to use in real time. Raw blockchain data is just noise without context.

LYS transforms every transaction, event, and state change into contextualized, correlated, and enriched metrics that tell the full story - who is acting, why they might be acting, and how it connects to market dynamics.

We provide:

* **Real-time structured insights** – every decoded trade, token launch, or wallet movement is available instantly.
* **Custom ontologies & schemas** – define the exact data models you need for your strategies.
* **AI-ready pipelines** – ontology-grounded graphs powering retrieval-augmented generation (RAG) for intelligent agents and trading models.

With **<30ms** end-to-end latency from chain to your API or WebSocket stream, we don’t just deliver fast data - we deliver fast answers.

{% hint style="info" %}
**Offering at a glance**

* **14ms** – ultra-low-latency structured blockchain data
* **<30ms** – fully contextualized & contextualized data with correlations, aggregations, and enriched metrics
  {% endhint %}

## Your journey through these docs

This documentation is structured to mirror your learning curve:

{% stepper %}
{% step %}

### Start here

Understand the platform and use cases
{% endstep %}

{% step %}

### Dive into the architecture

Learn how the stack is built
{% endstep %}

{% step %}

### Explore the data

From raw Solana logs to decoded events
{% endstep %}

{% step %}

### Use the APIs

Live data, streaming endpoints, and GraphQL
{% endstep %}

{% step %}

### Build

Train AI models or build apps on top of LYS
{% endstep %}
{% endstepper %}

## Who we serve

LYS isn’t just another analytics dashboard - it’s an intelligence platform. Here's how different power users benefit:&#x20;

{% tabs fullWidth="true" %}
{% tab title="⚡ Traders" %}
For High Frequency Traders:

* Access structured wallet flows, PnL trails, and anomaly graphs in <14ms.
* Execute faster with contextual alpha; skip 90% of data munging.
* Use cases: Real PnL mapping, token flow velocity, backtestable signal construction.
  {% endtab %}

{% tab title=" 👾AI Agents" %}
For AI Agents and other automations:

* Plug agents directly into contextualized data graphs with no pre-processing.
* Deploy and monetize autonomous agents in hours.&#x20;
* Use cases: Auto-traders, copy- trading bots, NLP research agents.
  {% endtab %}

{% tab title="🤖 Bots" %}
For Trading Bots:

* NLP + streaming insights → bots that react to smart wallet flows and token events.&#x20;
* Build smarter bots without touching RPC.&#x20;
* Use cases: Pump.fun snipers, whale-watch bots, token rotation alerts.
  {% endtab %}

{% tab title="🧠 MEV" %}
For MEV Searchers and Quants:

* Direct access to block sequencing and mempool
* Transaction ordering for sandwich/backrun detection
* Arbitrage routing across DEXs at millisecond precision
  {% endtab %}

{% tab title="🌊 DeFi " %}
For DeFi protocols and LPs:

* Direct access to block sequencing and mempool
* Transaction ordering for sandwich/backrun detection
* Arbitrage routing across DEXs at millisecond precision
  {% endtab %}

{% tab title="🔒 Security" %}
For Security and Compliance:

* AML wallet clustering and transaction tracing
* Multi-hop anomaly detection for exploits and market manipulation
* Fully auditable query layer for compliance reporting
  {% endtab %}

{% tab title="📊 Research" %}
For Researchers and Aggregators:

* Real-time Solana data at subgraph-level latency
* Cross-chain analytics and historical snapshots
* Build your own dashboards or run custom ML pipelines
  {% endtab %}
  {% endtabs %}

## Key capabilities

### **1. Real-time pipelines**

* Solana decoded in 14ms
* Live trade and liquidity streaming
* Support for EVM chains (block-by-block) (coming soon)

### **2. Custom ontologies**

* Define your own schema over blockchain activity
* Baseline templates provided for fast start

### **3. Knowledge graphs**

* Multi-hop wallet, token, protocol relationships
* Graph-native queries for advanced insights

### **4. AI-Optimized retrieval**

* Ontology-Grounded RAG (OG-RAG) integration
* Built for LLMs and autonomous agents

## How it works: The LYS data journey

### **1. Raw data ingestion**

* Direct from full nodes, mempool, or Geyser (for Solana)
* Avoids third-party APIs = lower latency, more control

### **2. Parsing & decoding**

* Protocol-specific decoders identify real events (e.g. swaps, votes, liquidity adds)
* Outputs are normalized to shared schemas

### **3. Indexing & aggregation**

* Events are indexed in real time and written to memory + database
* Aggregators summarize trends (OHLCV, buy/sell counts, rug flags)

### **4. Contextualization**

* Link events across wallets and time
* Discover hidden correlations (e.g., airdrop farming, vote manipulation)

### **5. Delivery**

* APIs and WSS streams deliver data to bots, dashboards, or AI agents
* Sandbox enables querying in natural language, Cypher, or via API

> **Example:**&#x20;
>
> **Token Launch Detection**
>
> Here’s what happens when a token launches on Pump.fun:
>
> * Decoder detects token creation, wallet funding, and initial liquidity
> * Aggregator tracks early buys/sells, bundle flags, price rise
> * Sandbox shows key metrics like bonding % change or suspicious wallets
> * AI agents receive this context and decide whether to trade, alert, or ignore

## Getting started with LYS

{% hint style="info" %}
You don’t need to be an engineer to use LYS. But if you are, we’ll give you every hook you need.
{% endhint %}

**You can:**

* Use prebuilt aggregations (volume spikes, rug detection, bundle counts)
* Subscribe to live streams of decoded Solana events
* Train models on historical, structured token activity

### Up next

In the next section, we’ll explore the LYS Platform in detail - how it all connects, what we’ve built, and how every layer serves data.

<img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f449.png?version=8.0.0" alt="backhand index pointing right" data-size="line"> **Ready? Let’s go.**


# The Platform

LYS is more than just a data feed or analytics dashboard - it’s a composable, real-time data infrastructure stack. This section breaks down the functional layers of the LYS system - from how raw block

## Layered design philosophy

Everything in LYS is modular. Each component is purpose-built for a specific part of the data pipeline, and they all connect seamlessly.

| **Layer**        | **What It Does**                                 |
| ---------------- | ------------------------------------------------ |
| Raw Data Capture | Collect Solana blocks, transactions, logs        |
| Decoders         | Parse and classify events from protocol activity |
| Aggregators      | Compute trends, metrics, signals                 |
| APIs & WSS       | Deliver insights in real time or on demand       |
| Apps / Agents    | Built on the data: Solexys, dashboards, alerts   |

These layers can be consumed individually or as a whole - from bare metal streaming to AI-ready insight generation.

## Core components

### **1. Indexer**

* Built on Solana Geyser + custom fallbacks
* Streams blocks every 400ms
* Fully stateless, event-driven design

### **2. Decoders**

* Protocol-specific logic: Pump.fun, Raydium, Meteora, LaunchLab, and others
* Extract swap actions, bonding curves, governance events, wallet flows etc.
* Normalized into shared schemas for consistency

<img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f517.png?version=8.0.0" alt="link" data-size="line">[ See Decoder Structure →](/decoders)

### **3. Aggregators**

* Real-time and historical metrics computed on decoded events
* Designed for:
  * Price signals (ATH, volume spike)
  * Wallet stats (PnL, buy/sell ratio)
  * Token diagnostics (creator behavior, rug flags)

<img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f517.png?version=8.0.0" alt="link" data-size="line"> [Explore Aggregations →](/contextualized-data)

### **4. Data Distribution methods**

* WebSocket Streams
* REST APIs for structured querying (coming soon)
* GraphQL (coming soon)

<img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f517.png?version=8.0.0" alt="link" data-size="line"> [Use the APIs →](/apis-and-streams)

### **5. Applications**

* Dev Portal: Portal for managing API keys, subscription and API documentation along querying live/historical Solana data
* Fully programmatic access also available for power users

{% hint style="info" %}
Apps are clients of the same APIs exposed to you.
{% endhint %}

## Platform flow, from block-to-bot

Let’s walk through a simplified real-time journey:

{% stepper %}
{% step %}

### Indexer

Captures block #38,510,203 from Solana mainnet
{% endstep %}

{% step %}

### Decoders detect events (examples)

* LaunchLab token creation
* Pump.fun liquidity init
* 4 buys, 1 sell, and a bonding curve jump
  {% endstep %}

{% step %}

### Aggregators compute

* Volume spike > 2x rolling avg
* ATH hit
* 3 unique buyers, 1 is tagged “smart wallet”
  {% endstep %}

{% step %}

### Streams / APIs

* Bots subscribed to /tokens/alerts WSS stream are notified in <20ms
* Solexys agent receives JSON bundle for token assessment
* Dashboard updates with new chart data
  {% endstep %}
  {% endstepper %}

## Integration options

| **You Are...**         | **You Should Use...**                    |
| ---------------------- | ---------------------------------------- |
| Building a trading bot | Subscribe to real-time alerts via WSS    |
| Doing quant research   | Query historical APIs with full filters  |
| Training an AI model   | Use structured JSON from decoders        |
| Creating dashboards    | Embed REST calls or use Sandbox directly |
| Monitoring token risks | Filter by creator, sniper, bundle flags  |

## Composability by design

Every layer of the LYS platform is:

* **Modular:** Swap in your own models, frontends, or indicators
* **Low-latency:** Engineered for millisecond decision-making
* **Schema-first:** All decoded data adheres to a common structure
* **Graph-ready:** Enables multi-hop reasoning and clustering
* **AI-optimized:** Built to power both supervised models and agents. Data analytics and interpretation AI powered

{% hint style="info" %}
Use what you need. Ignore what you don’t. The platform adapts to you.
{% endhint %}

## What’s Next

Now that you understand how the platform is structured, it’s time to dig into the technical architecture - the services, pipelines, and infrastructure that make this all work.

<img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f449.png?version=8.0.0" alt="backhand index pointing right" data-size="line"> Continue to Architecture


# Architecture

The LYS platform is built from the ground up to deliver ultra-fast, structured, and AI-ready blockchain data. This architecture enables data ingestion, decoding, enrichment, aggregation, and delivery - all within milliseconds.

Here’s how the full system is structured:

```
LYS Data Stack
──────────────

DECODERS ─────┐
              │
              ├──> ETL: LYS Core
              │     └── Decodes and structures Solana blockchain events
              │
              ├──> Real-Time Aggregations
              │     └── Triggers: ATH, volume spikes, bundle detection
              │     └── Output: Live WSS streams for bots, dashboards
              │
              ├──> Historical Aggregations
              │     └── Indexed event storage for backtesting, PnL, token history
              │
              ├──> Solexys ETL
              │     └── Specialized decoding for agent insights and AI context
              │
              ├──> Solexys Blockchain API
              │     ├── Enriched token data for AI agents
              │     └── Solexys Frontend queries live metrics and wallet behavior
              │
              ├──> Solexys Off-Chain API
              │     └── Handles chat history, user-defined strats, watchlists
              │
              └──> Raw Data API & WebSocket
                    └── Raw decoded Solana block data in real time

```

### Data flow summary

1. **Raw ingestion**\
   Full Solana blocks ingested from Geyser + validator infrastructure.
2. **Protocol-specific decoding**\
   Custom parsers extract true on-chain intent from transactions.
3. **Event normalization**\
   Unified schema output: swaps, transfers, votes, launches, etc.
4. **Aggregation engines**\
   Real-time summarization (e.g volume, ATHs) + historical indexing.
5. **API layer**\
   REST + WebSocket endpoints for raw and enriched data delivery.
6. **Agent layer (Solexys)**\
   NLP-driven strategy interface backed by real-time intelligence.

{% hint style="info" %}
This architecture ensures that whether you're building trading bots, training AI agents, or doing advanced research - LYS delivers structured data with **speed, context, and precision.**
{% endhint %}


# APIs and Streams

Find out how to get access to supersonic data.

The LYS Labs API and WebSocket infrastructure gives you direct access to decoded blockchain events, real-time aggregations, and historical insights - all enriched and structured for programmatic use.

\
Whether you're building a trading bot, running an agent model, or querying historical behavior, the API layer is your interface into the LYS data platform.

### Overview

LYS APIs expose:

* Decoded Solana events (token swaps, mints, transfers, etc.)
* Real-time and historical aggregations
* Wallet- and token-level intelligence
* Validator performance data
* Custom signals (volume spikes, rug flags, etc.)

\
Data is streamed in real time or queried on demand.\
All endpoints are:

* Low-latency (sub-30ms responses)
* Enriched (decoded, normalized, and annotated)
* Tiered (free, pro, and enterprise plans)

### Plans

Both Structured & Aggregated data have a Free tier

<figure><img src="/files/DsGKlRYxnHKpmuZiSunq" alt="" width="375"><figcaption></figcaption></figure>

**Structured Data**

Real-time, unprocessed Solana blockchain data

{% columns %}
{% column width="50%" %}

<figure><img src="/files/7gqRR6Ir2oCzAI9SaEwX" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column width="50%" %}

<figure><img src="/files/9PuaXFiiOgV2epPZIMox" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

#### Aggregated Data

Pre-processed, analytics-ready blockchain insights

{% columns %}
{% column %}

<figure><img src="/files/B5y4qwXKambcLVVQIuC5" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

<figure><img src="/files/tDKuPKesMK3LmMf7JDJw" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### Next: Try the Sandbox

You’re now ready to jump into the developer experience.

<img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f449.png?version=8.0.0" alt="backhand index pointing right" data-size="line">[ Visit Dev Portal](https://dev-staging.lyslabs.ai/api-reference/websocket-api) to browse endpoints, get your key, and start building.

or&#x20;

[Contact Us for Enterprise ](mailto:sales@lyslabs.ai)access


# Structured Data

## Data Overview

> *In Solana’s ultra-fast ecosystem, every millisecond counts.*&#x20;

Our platform is engineered to process and decode entire blocks of 2,000–3,000 transactions in under 14 milliseconds, and can deliver actionable trading data from DEXs like Raydium, Pump.fun, Meteora, and Orca in under 4 milliseconds. This means while other systems may take up to 30 seconds to display insights, your AI agents, trading bots and strategies are already executing, giving you a significant competitive edge.

\
What does this mean for you? You get blazing-fast data - token swap summaries (candle data: open, close, high, low, and volume) are available instantly after a block is produced, making our solution perfect for high-frequency traders who need to move faster than the market. You’ll benefit from precision volume insights, staying ahead with real-time liquidity and volume data for tokens like "Justin Chill Guy" (+5.89%) or "LAB" (SOL pair dynamic pricing), ensuring you capitalize on every opportunity. Our liquidity intelligence lets you track pool balances, liquidity shifts, and token movements in real time, empowering you to refine strategies and manage risk proactively. Whether you’re running a high-frequency bot or optimizing trading strategies, our system puts you ahead of the game: faster data, smarter moves, better results.

\
We achieve this ultra-low latency by leveraging the Geyser plugin (and even without it), enabling rapid data streaming and aggregation. The core challenge was minimizing requests and efficiently parsing and decoding thousands of transactions per block - each block containing around 2,000–3,000 transactions and produced every 400ms. Our system processes, parses, decodes instruction data, logs, and accounts for balance changes in under 20ms on a standard laptop. For comparison, platforms like Dexscreener display a 30-second delay relative to our real-time data. This low-latency data transfer is essential for high-frequency trading, ensuring data is processed and available for consumption almost instantly. On each block, we summarize token swaps as candle data (open, close, min, max, volume), streaming it in under 20ms for immediate use by trading bots, agents or other HFTs.

### Performance Benchmarks

| Feature                             | Latency (ms) |
| ----------------------------------- | ------------ |
| Full block decode (2,000–3,000 txs) | < 14         |
| DEX swap enrichment                 | < 4          |
| Swap + candle data generation       | < 20         |
| Geyser-indexed block fetch          | \~4          |
| Dexscreener comparison              | \~30,000     |

\
Our approach relies on a highly optimized indexer with 14ms latency for retrieving the latest block by running services alongside our nodes and using Geyser. We decode entire Solana blocks, parse data, and extract DEX events and token transfers within 2–20ms. Real-time aggregation covers token buys, sells, volumes, platforms used, and candle data. We also track bad actor wallets, monitor SOL/token movements, and deploy predictive models to forecast if a token will reach specific bonding curve percentages. Rug detection is performed at the creation event of a token, providing early warnings for risk management.LYS Labs offers Solana data containing all token activity (create, mint, burn, transfers). This includes wallet-to-wallet transfers as well as dex activity like Pump.fun, Pump Swap, Raydium AMM and LaunchLab events.

\
We will support more projects and types of aggregations in the future and on demand.

<details>

<summary><img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f50d.png?version=8.0.0" alt="magnifying glass tilted left" data-size="line"> <strong>Features</strong></summary>

* Token transfer data containing pre and post balances per event (usually only available via transaction trace)
* Position of event in Tx execution tree
* Parent program calling the event
* DEX swap data containing:
  * Pre and post price
  * Pre and post liquidity pool balance
  * Pre and post bonding curve percentage (where applicable)
  * Bundle detection
  * Volume bot detection
  * Market cap of the token (virtual and real)
  * Token creator tracking
  * Trading platform/bot detection (Photon, BullX, BloomBot, etc.)

</details>


# WebSocket API Reference

Real-time streaming API for Solana transactions

### Connection Details

* **WebSocket URL:**  `ws://solana-mainnet-api-vip.lyslabs.ai:8080`
* **Protocol:** WebSocket (WSS for production)
* **Authentication:** API Key via query parameter

### Message Types

<details>

<summary>subscription</summary>

Confirmation of successful subscription to transaction stream.

```json
{
   "type":"subscription",
   "status":"success"
}
```

</details>

<details>

<summary>transaction</summary>

Individual transaction data with comprehensive details.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"5xG...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "eventType":"TRANSFER",
      "decoderType":"SPL_TOKEN",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "sourceAccount":"7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
      "sourceOwner":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "destinationAccount":"J6QN6yzGfvGgJVQHfP7VTNf6i2gTgtJfYXMYrKXLmqQs",
      "destinationOwner":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount":"1000000",
      "uiAmount":{
         "value":"1.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      }
   }
}
```

</details>

<details>

<summary>transactions</summary>

Batch of multiple transactions for efficiency.

```json
{
   "type":"transactions",
   "data":[
      {
         "txSignature":"5xG...",
         "blockTime":1234567890,
         "blockHeight":123456789,
         "slot":123456789,
         "programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
         "eventType":"TRANSFER",
         "decoderType":"SPL_TOKEN",
         "txFee":5000,
         "txFeeUiAmount":{
            "value":"0.000005",
            "type":"PreciseDecimal",
            "isCustomDecoderValue":true
         }
      },
      {
         "txSignature":"3zB...",
         "blockTime":1234567890,
         "blockHeight":123456789,
         "slot":123456789,
         "programId":"11111111111111111111111111111111",
         "eventType":"TRANSFER",
         "decoderType":"SYSTEM_PROGRAM",
         "txFee":5000,
         "txFeeUiAmount":{
            "value":"0.000005",
            "type":"PreciseDecimal",
            "isCustomDecoderValue":true
         }
      }
   ]
}
```

</details>

<details>

<summary>block</summary>

Complete block data including all transactions and metadata.

```json
{
   "type":"block",
   "data":{
      "slot":"123456789",
      "blockhash":"H4ATKcfMvSpGpR1P2HRqvZ5pjS7zLMH5sQPvLhJGzLHb",
      "blockTime":{
         "timestamp":"1234567890"
      },
      "blockHeight":{
         "blockHeight":"123456789"
      },
      "parentSlot":"123456788",
      "parentBlockhash":"5M1iqGGY7gKNkLNMB4oaLJzJf9VLvQs1EM3AqhzFZzEm",
      "executedTransactionCount":"42",
      "transactions":[
         {
            "signature":"5xG...",
            "isVote":false,
            "transaction":{
               "signatures":[
                  "5xG..."
               ],
               "message":{
                  "header":{
                     "numRequiredSignatures":1,
                     "numReadonlySignedAccounts":0,
                     "numReadonlyUnsignedAccounts":3
                  },
                  "accountKeys":[
                     "Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
                     "7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
                     "J6QN6yzGfvGgJVQHfP7VTNf6i2gTgtJfYXMYrKXLmqQs",
                     "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
                  ],
                  "recentBlockhash":"H4ATKcfMvSpGpR1P2HRqvZ5pjS7zLMH5sQPvLhJGzLHb",
                  "instructions":[
                     {
                        "programIdIndex":3,
                        "accounts":"010203",
                        "data":"0200000064000000"
                     }
                  ],
                  "versioned":false,
                  "addressTableLookups":[
                     
                  ]
               }
            },
            "meta":{
               "err":null,
               "fee":"5000",
               "preBalances":[
                  "10000000000",
                  "10000000",
                  "5000000"
               ],
               "postBalances":[
                  "9999995000",
                  "9000000",
                  "6000000"
               ],
               "innerInstructions":[
                  
               ],
               "innerInstructionsNone":false,
               "logMessages":[
                  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke",
                  "Program log: Transfer 1 token",
                  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success"
               ],
               "logMessagesNone":false,
               "preTokenBalances":[
                  
               ],
               "postTokenBalances":[
                  
               ],
               "rewards":[
                  
               ],
               "loadedWritableAddresses":[
                  
               ],
               "loadedReadonlyAddresses":[
                  
               ],
               "returnDataNone":true,
               "computeUnitsConsumed":"200000"
            },
            "index":"0"
         }
      ]
   }
}
```

</details>

<details>

<summary>info</summary>

Server information and status messages.

```json
{
   "type":"info",
   "message":"Connected to Solana mainnet"
}
```

</details>

<details>

<summary>error</summary>

Error messages and troubleshooting information.

```json
{
   "type":"error",
   "message":"Rate limit exceeded",
   "code":"RATE_LIMIT"
}
```

</details>

### Detailed Event Examples

Below are examples of decoded events for different transaction types.

#### SPL Token Events

<details>

<summary><strong>Token Transfer</strong></summary>

A token transfer between two accounts.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"5xG...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "eventType":"TRANSFER",
      "decoderType":"SPL_TOKEN",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "sourceAccount":"7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
      "sourceOwner":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "destinationAccount":"J6QN6yzGfvGgJVQHfP7VTNf6i2gTgtJfYXMYrKXLmqQs",
      "destinationOwner":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "amount":"1000000",
      "uiAmount":{
         "value":"1.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "sourcePreAmount":"10000000",
      "sourcePreUiAmount":{
         "value":"10.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "sourcePostAmount":"9000000",
      "sourcePostUiAmount":{
         "value":"9.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "destinationPreAmount":"5000000",
      "destinationPreUiAmount":{
         "value":"5.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "destinationPostAmount":"6000000",
      "destinationPostUiAmount":{
         "value":"6.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      }
   }
}
```

</details>

<details>

<summary><strong>Token Mint</strong></summary>

Minting new tokens to an account.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"2xM...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "eventType":"MINT",
      "decoderType":"SPL_TOKEN",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "destinationAccount":"J6QN6yzGfvGgJVQHfP7VTNf6i2gTgtJfYXMYrKXLmqQs",
      "destinationOwner":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "amount":"5000000",
      "uiAmount":{
         "value":"5.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "destinationPreAmount":"1000000",
      "destinationPreUiAmount":{
         "value":"1.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "destinationPostAmount":"6000000",
      "destinationPostUiAmount":{
         "value":"6.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      }
   }
}
```

</details>

<details>

<summary><strong>Token Burn</strong></summary>

Burning tokens from an account.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"3zB...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
      "eventType":"BURN",
      "decoderType":"SPL_TOKEN",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "sourceAccount":"7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
      "sourceOwner":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "amount":"2000000",
      "uiAmount":{
         "value":"2.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "sourcePreAmount":"10000000",
      "sourcePreUiAmount":{
         "value":"10.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "sourcePostAmount":"8000000",
      "sourcePostUiAmount":{
         "value":"8.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      }
   }
}
```

</details>

#### System Program Events

<details>

<summary><strong>SOL Transfer</strong></summary>

A native SOL transfer between accounts.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"4yS...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"11111111111111111111111111111111",
      "eventType":"TRANSFER",
      "decoderType":"SYSTEM_PROGRAM",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "fromAccount":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "toAccount":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "amount":"1000000000",
      "uiAmount":{
         "value":"1.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "fromPreBalance":"10000000000",
      "fromPreUiBalance":{
         "value":"10.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "fromPostBalance":"8995000000",
      "fromPostUiBalance":{
         "value":"8.99500",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "toPreBalance":"5000000000",
      "toPreUiBalance":{
         "value":"5.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "toPostBalance":"6000000000",
      "toPostUiBalance":{
         "value":"6.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      }
   }
}
```

</details>

#### Raydium Events

<details>

<summary><strong>Raydium AMM Swap</strong></summary>

A token swap on Raydium AMM.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"5Rz...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
      "eventType":"SWAP",
      "decoderType":"RAYDIUM_AMM",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "amm":"58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2",
      "tokenInMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "tokenOutMint":"So11111111111111111111111111111111111111112",
      "tokenInAmount":"100000000",
      "tokenInUiAmount":{
         "value":"100.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "tokenOutAmount":"25000000000",
      "tokenOutUiAmount":{
         "value":"25.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "userTokenInAccount":"7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
      "userTokenOutAccount":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "userAuthority":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN"
   }
}
```

</details>

<details>

<summary><strong>Raydium CLMM Add Liquidity</strong></summary>

Adding liquidity to a Raydium CLMM pool.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"3Jk...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"7quA6MBdYNbS9pPcqbCKC7Ge4XfyBnNzgT5cQXJNVMbF",
      "eventType":"ADD_LIQUIDITY",
      "decoderType":"RAYDIUM_CLMM",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "poolId":"61R1ndXxvsWXXkWSyNkCxnzwd3zUNB8Q2ibmkiLPC8ht",
      "tokenA":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "tokenB":"So11111111111111111111111111111111111111112",
      "tokenAAmount":"50000000",
      "tokenAUiAmount":{
         "value":"50.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "tokenBAmount":"10000000000",
      "tokenBUiAmount":{
         "value":"10.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "liquidity":"1234567890",
      "lowerTick":"-10000",
      "upperTick":"10000",
      "owner":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN"
   }
}
```

</details>

#### Meteora Events

<details>

<summary><strong>Meteora DLMM Add Position</strong></summary>

Adding a position to a Meteora DLMM pool.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"4Xp...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"dLMMatey9Nw3R4aPaPMBZ4zBPEK5L9oka9Yc2NkjMPz",
      "eventType":"ADD_POSITION",
      "decoderType":"METEORA_DLMM",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "pool":"9JUjWjAyXTMB4ZXcV7nk3p6Gg1fWAAoSck4b4AwrKAqt",
      "tokenA":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "tokenB":"So11111111111111111111111111111111111111112",
      "tokenAAmount":"60000000",
      "tokenAUiAmount":{
         "value":"60.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "tokenBAmount":"12000000000",
      "tokenBUiAmount":{
         "value":"12.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "lowerBound":"4500000",
      "upperBound":"5500000",
      "owner":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "positionId":"7"
   }
}
```

</details>

<details>

<summary><strong>Meteora DAMM Swap</strong></summary>

A token swap on Meteora DAMM.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"2Yz...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"dAMM3isQyZzGYvWYqUWM8aC5yVkBVKNBDJcZYZNZRiR",
      "eventType":"SWAP",
      "decoderType":"METEORA_DAMM",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "pool":"8JUjWjAyXTMB4ZXcV7nk3p6Gg1fWAAoSck4b4AwrKAqt",
      "inputMint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "outputMint":"So11111111111111111111111111111111111111112",
      "inputAmount":"75000000",
      "inputUiAmount":{
         "value":"75.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "outputAmount":"15000000000",
      "outputUiAmount":{
         "value":"15.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "inputTokenAccount":"7RCz8wb6WXxUhAigry8PmjtiD2RS3tEyMqXrwAPMUQy3",
      "outputTokenAccount":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "authority":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN"
   }
}
```

</details>

#### Pump Fun Events

<details>

<summary><strong>Pump Fun Buy</strong></summary>

A buy transaction on Pump Fun.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"3Ks...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"PFDNYqYvHQpZMGVi5uQkGKqvSYZ9Pv5HB3qBzP82hk1",
      "eventType":"BUY",
      "decoderType":"PUMP_FUN",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "subject":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "buyer":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "amount":"1000000000",
      "uiAmount":{
         "value":"1.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "supply":"10000000000",
      "supplyUi":{
         "value":"10.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "buyPrice":"2500000000",
      "buyPriceUi":{
         "value":"2.5",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "protocolFee":"125000000",
      "protocolFeeUi":{
         "value":"0.125",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "subjectFee":"125000000",
      "subjectFeeUi":{
         "value":"0.125",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      }
   }
}
```

</details>

#### LaunchLab Events

<details>

<summary><strong>LaunchLab Create Token</strong></summary>

Creating a new token on LaunchLab.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"5Lp...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"LLapECMqaGQq1CKxhLqyoGKKFCkvmVBXXbKLLXUQNdZ",
      "eventType":"CREATE_TOKEN",
      "decoderType":"LAUNCHLAB",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "mint":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "creator":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "name":"Example Token",
      "symbol":"EXT",
      "decimals":9,
      "initialSupply":"1000000000000",
      "initialSupplyUi":{
         "value":"1000.0",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "metadata":{
         "website":"https://example.com",
         "description":"An example token for demonstration"
      }
   }
}
```

</details>

#### Boop Fun Events

<details>

<summary><strong>Boop Fun Boop</strong></summary>

A boop action on Boop Fun.

```json
{
   "type":"transaction",
   "data":{
      "txSignature":"2Bp...",
      "blockTime":1234567890,
      "blockHeight":123456789,
      "slot":123456789,
      "programId":"BoPFuNVvt5Kf4Y6Uf4yyNPM9wkXJTQQPd3hUvtSVZG9d",
      "eventType":"BOOP",
      "decoderType":"BOOP_FUN",
      "txFee":5000,
      "txFeeUiAmount":{
         "value":"0.000005",
         "type":"PreciseDecimal",
         "isCustomDecoderValue":true
      },
      "booper":"Ht7CkowEPZ5yHQpQQhzhgHqfy6LxhYYG4PAsZbMdaLXs",
      "boopee":"2SsLFGMgWmTCJ9Cxe1qHbHpTcivas1VdNLYJaKT4GGqN",
      "boopCount":42,
      "timestamp":1234567890
   }
}
```

</details>


# Decoders

## Introduction

Decoders are the foundational layer of LYS’s data processing stack. They are specialized modules that interpret and transform raw blockchain instructions, logs, and token transfers into structured, enriched data. Each protocol - whether a DEX, launchpad, or validator client - has its own decoder that understands its unique logic and events.

## Why decoders matter

Without decoders, raw blockchain data is nearly unusable for real-time decision-making. Decoders translate that noise into signals.

* **Raw input**: low-level instructions and logs from Solana blocks
* **Decoded output:** typed events with labeled fields (buy/sell, user, mint, amount, fees, bonding %, etc.)
* **Next layer:** feeds into aggregation systems (for OHLCV, rug detection, volume spikes, user stats, etc.)

## Architecture

Each decoder:

* Parses transactions in real-time
* Extracts known program IDs (per protocol)
* Normalizes data into a shared schema
* Streams decoded results into MongoDB + WebSocket servers

## Use Cases

Decoders directly enable:

* The Solexys frontend (launchpad strategy analysis)
* Historical & real-time API access for clients
* High-frequency bot pipelines
* Real-time WSS subscriptions
* Triggered alerts (volume, rug risk, top wallet moves)


# Boop.fun

This document describes the output structure for the Boop Fun decoder functions. The decoder handles two main event types: INITIALIZE and 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`         | Boop Fun program ID                            |
| `eventType`       | `string`         | `string`         | Type of event (INITIALIZE, SWAP)               |
| `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                   |

### INITIALIZE Event

Token initialization event for Boop Fun.

| Property                       | Type             | JSON Type | Description                         |
| ------------------------------ | ---------------- | --------- | ----------------------------------- |
| `mint`                         | `string`         | `string`  | Token mint address                  |
| `name`                         | `string`         | `string`  | Token name                          |
| `symbol`                       | `string`         | `string`  | Token symbol                        |
| `uri`                          | `string`         | `string`  | Token metadata URI                  |
| `virtualTokenReserves`         | `bigint`         | `string`  | Virtual token reserves              |
| `virtualTokenReservesUiAmount` | `PreciseDecimal` | `string`  | UI-formatted virtual token reserves |
| `virtualSolReserves`           | `bigint`         | `string`  | Virtual SOL reserves                |
| `virtualSolReservesUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted virtual SOL reserves   |
| `tokenTotalSupply`             | `bigint`         | `string`  | Total token supply                  |
| `tokenTotalSupplyUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted total token supply     |
| `user`                         | `string`         | `string`  | User/creator address                |
| `tokenAccount`                 | `string`         | `string`  | Token account address               |
| `solVault`                     | `string`         | `string`  | SOL vault address                   |
| `tokenVault`                   | `string`         | `string`  | Token vault address                 |
| `creatorInitialTokens`         | `bigint`         | `string`  | Creator's initial token amount      |
| `creatorInitialTokensUiAmount` | `PreciseDecimal` | `string`  | UI-formatted creator initial tokens |

### SWAP Event

Token swap event on Boop Fun.

| Property                              | Type             | JSON Type | Description                                |
| ------------------------------------- | ---------------- | --------- | ------------------------------------------ |
| `mint`                                | `string`         | `string`  | Token mint address                         |
| `user`                                | `string`         | `string`  | User address                               |
| `tokenAccount`                        | `string`         | `string`  | Token account address                      |
| `solAccount`                          | `string`         | `string`  | SOL account address                        |
| `tokenVault`                          | `string`         | `string`  | Token vault address                        |
| `solVault`                            | `string`         | `string`  | SOL vault address                          |
| `isBuy`                               | `boolean`        | `boolean` | True for buy orders, false for sell orders |
| `amount`                              | `bigint`         | `string`  | Amount swapped                             |
| `amountUiAmount`                      | `PreciseDecimal` | `string`  | UI-formatted amount swapped                |
| `solAmount`                           | `bigint`         | `string`  | SOL amount involved in swap                |
| `solAmountUiAmount`                   | `PreciseDecimal` | `string`  | UI-formatted SOL amount                    |
| `tokenAmount`                         | `bigint`         | `string`  | Token amount involved in swap              |
| `tokenAmountUiAmount`                 | `PreciseDecimal` | `string`  | UI-formatted token amount                  |
| `virtualSolReserves`                  | `bigint`         | `string`  | Virtual SOL reserves after swap            |
| `virtualSolReservesUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted virtual SOL reserves          |
| `virtualTokenReserves`                | `bigint`         | `string`  | Virtual token reserves after swap          |
| `virtualTokenReservesUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted virtual token reserves        |
| `userSolAccountPreBalance`            | `bigint`         | `string`  | User SOL balance before swap               |
| `userSolAccountPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user SOL pre-balance          |
| `userSolAccountPostBalance`           | `bigint`         | `string`  | User SOL balance after swap                |
| `userSolAccountPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user SOL post-balance         |
| `userTokenAccountPreBalance`          | `bigint`         | `string`  | User token balance before swap             |
| `userTokenAccountPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token pre-balance        |
| `userTokenAccountPostBalance`         | `bigint`         | `string`  | User token balance after swap              |
| `userTokenAccountPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token post-balance       |
| `tokenVaultPreBalance`                | `bigint`         | `string`  | Token vault balance before swap            |
| `tokenVaultPreBalanceUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted token vault pre-balance       |
| `tokenVaultPostBalance`               | `bigint`         | `string`  | Token vault balance after swap             |
| `tokenVaultPostBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token vault post-balance      |
| `solVaultPreBalance`                  | `bigint`         | `string`  | SOL vault balance before swap              |
| `solVaultPreBalanceUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted SOL vault pre-balance         |
| `solVaultPostBalance`                 | `bigint`         | `string`  | SOL vault balance after swap               |
| `solVaultPostBalanceUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted SOL vault post-balance        |

### Data Types

* `bigint`: Large integer values for token amounts and reserves
* `string`: Text values for addresses, names, symbols, and URIs
* `number`: Numeric values for other integer values
* `boolean`: True/false values for buy/sell direction
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (BOOP\_FUN)

### 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. The Boop Fun decoder handles token initialization and swapping mechanics with virtual reserve management and balance tracking.


# LaunchLab

This document describes the output structure for the LaunchLab decoder functions. The decoder handles three main event types: SWAP, CREATE, and MIGRATE\_CPMM.

### 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`         | LaunchLab program ID                           |
| `eventType`       | `string`         | `string`         | Type of event (SWAP, CREATE, MIGRATE\_CPMM)    |
| `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                   |

### SWAP Event&#x20;

Token swap event on LaunchLab bonding curve.

| Property                  | Type             | JSON Type | Description                                |
| ------------------------- | ---------------- | --------- | ------------------------------------------ |
| `mint`                    | `string`         | `string`  | Token mint address                         |
| `isBuy`                   | `boolean`        | `boolean` | True for buy orders, false for sell orders |
| `user`                    | `string`         | `string`  | User account address                       |
| `poolState`               | `string`         | `string`  | Pool state account address                 |
| `totalBaseSell`           | `bigint`         | `string`  | Total base tokens available for sale       |
| `totalBaseSellUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted total base sell amount        |
| `virtualBase`             | `bigint`         | `string`  | Virtual base reserves                      |
| `virtualBaseUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted virtual base reserves         |
| `virtualQuote`            | `bigint`         | `string`  | Virtual quote reserves                     |
| `virtualQuoteUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted virtual quote reserves        |
| `realBaseBefore`          | `bigint`         | `string`  | Real base reserves before swap             |
| `realBaseBeforeUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted real base before swap         |
| `realQuoteBefore`         | `bigint`         | `string`  | Real quote reserves before swap            |
| `realQuoteBeforeUiAmount` | `PreciseDecimal` | `string`  | UI-formatted real quote before swap        |
| `realBaseAfter`           | `bigint`         | `string`  | Real base reserves after swap              |
| `realBaseAfterUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted real base after swap          |
| `realQuoteAfter`          | `bigint`         | `string`  | Real quote reserves after swap             |
| `realQuoteAfterUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted real quote after swap         |
| `amountIn`                | `bigint`         | `string`  | Input token amount                         |
| `amountInUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted input amount                  |
| `amountOut`               | `bigint`         | `string`  | Output token amount                        |
| `amountOutUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted output amount                 |
| `protocolFee`             | `bigint`         | `string`  | Protocol fee amount                        |
| `protocolFeeUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted protocol fee                  |
| `platformFee`             | `bigint`         | `string`  | Platform fee amount                        |
| `platformFeeUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted platform fee                  |
| `shareFee`                | `bigint`         | `string`  | Share fee amount                           |
| `shareFeeUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted share fee                     |
| `poolStatus`              | `string`         | `string`  | Current pool status                        |

### CREATE Event

Token creation event on LaunchLab.

| Property  | Type     | JSON Type | Description           |
| --------- | -------- | --------- | --------------------- |
| `name`    | `string` | `string`  | Token name            |
| `symbol`  | `string` | `string`  | Token symbol          |
| `uri`     | `string` | `string`  | Token metadata URI    |
| `creator` | `string` | `string`  | Token creator address |
| `mint`    | `string` | `string`  | Token mint address    |

### MIGRATE\_CPMM Event

Token migration event to CPMM pool.

| Property          | Type     | JSON Type | Description                     |
| ----------------- | -------- | --------- | ------------------------------- |
| `mint`            | `string` | `string`  | Token mint address              |
| `quoteMint`       | `string` | `string`  | Quote token mint address        |
| `programId`       | `string` | `string`  | Target program ID for migration |
| `cpSwapProgramId` | `string` | `string`  | CP swap program ID              |
| `payer`           | `string` | `string`  | Transaction payer address       |

### Data Types

* `bigint`: Large integer values for token amounts and fees
* `string`: Text values for addresses, names, and identifiers
* `boolean`: True/false values for buy/sell indicators
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (LAUNCHLAB)

### 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. The LaunchLab decoder handles bonding curve mechanics with comprehensive fee tracking and migration capabilities.


# Meteora DAMM V2

This document describes the output structure for the Meteora DAMM V2 (Dynamic Automated Market Maker Version 2) decoder functions. The decoder handles four main event types: INITIALIZE\_POOL, SWAP, ADD\_LIQUIDITY, and REMOVE\_ALL\_LIQUIDITY.

### 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`         | Meteora DAMM V2 program ID                                                     |
| `eventType`       | `string`         | `string`         | Type of event (INITIALIZE\_POOL, SWAP, ADD\_LIQUIDITY, REMOVE\_ALL\_LIQUIDITY) |
| `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                                                   |

### INITIALIZE\_POOL Event

Pool initialization event for Meteora DAMM V2.

| Property             | Type             | JSON Type | Description                    |
| -------------------- | ---------------- | --------- | ------------------------------ |
| `pool`               | `string`         | `string`  | Pool account address           |
| `position`           | `string`         | `string`  | Position account address       |
| `positionNftAccount` | `string`         | `string`  | Position NFT account address   |
| `tokenAMint`         | `string`         | `string`  | Token A mint address           |
| `tokenBMint`         | `string`         | `string`  | Token B mint address           |
| `tokenAVault`        | `string`         | `string`  | Token A vault address          |
| `tokenBVault`        | `string`         | `string`  | Token B vault address          |
| `payerTokenA`        | `string`         | `string`  | Payer's token A account        |
| `payerTokenB`        | `string`         | `string`  | Payer's token B account        |
| `liquidity`          | `bigint`         | `string`  | Initial liquidity amount       |
| `liquidityUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted initial liquidity |
| `sqrtPrice`          | `bigint`         | `string`  | Square root price              |
| `sqrtPriceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted square root price |

### SWAP Event

Token swap event on Meteora DAMM V2 pool.

| Property                         | Type             | JSON Type | Description                             |
| -------------------------------- | ---------------- | --------- | --------------------------------------- |
| `tokenAMint`                     | `string`         | `string`  | Token A mint address                    |
| `tokenBMint`                     | `string`         | `string`  | Token B mint address                    |
| `tokenADecimals`                 | `number`         | `number`  | Token A decimal places                  |
| `tokenBDecimals`                 | `number`         | `number`  | Token B decimal places                  |
| `amountIn`                       | `bigint`         | `string`  | Input token amount                      |
| `amountInUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted input amount               |
| `amountOut`                      | `bigint`         | `string`  | Output token amount                     |
| `amountOutUiAmount`              | `PreciseDecimal` | `string`  | UI-formatted output amount              |
| `minimumAmountOut`               | `bigint`         | `string`  | Minimum acceptable output amount        |
| `minimumAmountOutUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted minimum output amount      |
| `slippageAmount`                 | `bigint`         | `string`  | Slippage amount                         |
| `slippageAmountUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted slippage amount            |
| `expectedAmountOut`              | `bigint`         | `string`  | Expected output amount                  |
| `expectedAmountOutUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted expected output amount     |
| `slippageTolerance`              | `bigint`         | `string`  | Slippage tolerance                      |
| `slippageToleranceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted slippage tolerance         |
| `actualPrice`                    | `bigint`         | `string`  | Actual swap price                       |
| `actualPriceUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted actual price               |
| `slippagePercentage`             | `bigint`         | `string`  | Slippage percentage                     |
| `slippagePercentageUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted slippage percentage        |
| `inputTokenPostBalance`          | `bigint`         | `string`  | Input token balance after swap          |
| `inputTokenPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted input token post-balance   |
| `outputTokenPostBalance`         | `bigint`         | `string`  | Output token balance after swap         |
| `outputTokenPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted output token post-balance  |
| `tokenAVaultPostBalance`         | `bigint`         | `string`  | Token A vault balance after swap        |
| `tokenAVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token A vault post-balance |
| `tokenBVaultPostBalance`         | `bigint`         | `string`  | Token B vault balance after swap        |
| `tokenBVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token B vault post-balance |
| `inputTokenPreBalance`           | `bigint`         | `string`  | Input token balance before swap         |
| `inputTokenPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted input token pre-balance    |
| `outputTokenPreBalance`          | `bigint`         | `string`  | Output token balance before swap        |
| `outputTokenPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted output token pre-balance   |
| `tokenAVaultPreBalance`          | `bigint`         | `string`  | Token A vault balance before swap       |
| `tokenAVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token A vault pre-balance  |
| `tokenBVaultPreBalance`          | `bigint`         | `string`  | Token B vault balance before swap       |
| `tokenBVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token B vault pre-balance  |
| `pricePre`                       | `bigint`         | `string`  | Price before swap                       |
| `pricePreUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted price before swap          |
| `pricePost`                      | `bigint`         | `string`  | Price after swap                        |
| `pricePostUiAmount`              | `PreciseDecimal` | `string`  | UI-formatted price after swap           |
| `lpFee`                          | `bigint`         | `string`  | Liquidity provider fee amount           |
| `lpFeeUiAmount`                  | `PreciseDecimal` | `string`  | UI-formatted LP fee                     |
| `protocolFee`                    | `bigint`         | `string`  | Protocol fee amount                     |
| `protocolFeeUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted protocol fee               |
| `partnerFee`                     | `bigint`         | `string`  | Partner fee amount                      |
| `partnerFeeUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted partner fee                |
| `referralFee`                    | `bigint`         | `string`  | Referral fee amount                     |
| `referralFeeUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted referral fee               |
| `isInputTokenA`                  | `boolean`        | `boolean` | Whether the input token is token A      |

### ADD\_LIQUIDITY Event

Liquidity addition event for Meteora DAMM V2 pool.

| Property                           | Type             | JSON Type | Description                               |
| ---------------------------------- | ---------------- | --------- | ----------------------------------------- |
| `pool`                             | `string`         | `string`  | Pool account address                      |
| `position`                         | `string`         | `string`  | Position account address                  |
| `tokenAAccount`                    | `string`         | `string`  | Token A account address                   |
| `tokenBAccount`                    | `string`         | `string`  | Token B account address                   |
| `tokenAMint`                       | `string`         | `string`  | Token A mint address                      |
| `tokenBMint`                       | `string`         | `string`  | Token B mint address                      |
| `liquidityDelta`                   | `bigint`         | `string`  | Change in liquidity amount                |
| `liquidityDeltaUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted liquidity delta              |
| `tokenAAmountThreshold`            | `bigint`         | `string`  | Token A amount threshold                  |
| `tokenAAmountThresholdUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token A threshold            |
| `tokenBAmountThreshold`            | `bigint`         | `string`  | Token B amount threshold                  |
| `tokenBAmountThresholdUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token B threshold            |
| `tokenAAccountPostBalance`         | `bigint`         | `string`  | Token A account balance after addition    |
| `tokenAAccountPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token A account post-balance |
| `tokenBAccountPostBalance`         | `bigint`         | `string`  | Token B account balance after addition    |
| `tokenBAccountPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token B account post-balance |
| `tokenAVaultPostBalance`           | `bigint`         | `string`  | Token A vault balance after addition      |
| `tokenAVaultPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token A vault post-balance   |
| `tokenBVaultPostBalance`           | `bigint`         | `string`  | Token B vault balance after addition      |
| `tokenBVaultPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token B vault post-balance   |
| `tokenAAccountPreBalance`          | `bigint`         | `string`  | Token A account balance before addition   |
| `tokenAAccountPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token A account pre-balance  |
| `tokenBAccountPreBalance`          | `bigint`         | `string`  | Token B account balance before addition   |
| `tokenBAccountPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token B account pre-balance  |
| `tokenAVaultPreBalance`            | `bigint`         | `string`  | Token A vault balance before addition     |
| `tokenAVaultPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token A vault pre-balance    |
| `tokenBVaultPreBalance`            | `bigint`         | `string`  | Token B vault balance before addition     |
| `tokenBVaultPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token B vault pre-balance    |
| `owner`                            | `string`         | `string`  | Position owner address                    |
| `tokenAAmountIn`                   | `bigint`         | `string`  | Token A amount deposited                  |
| `tokenAAmountInUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted token A deposit amount       |
| `tokenBAmountIn`                   | `bigint`         | `string`  | Token B amount deposited                  |
| `tokenBAmountInUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted token B deposit amount       |

### REMOVE\_ALL\_LIQUIDITY Event

Complete liquidity removal event for Meteora DAMM V2 pool.

| Property                           | Type             | JSON Type | Description                               |
| ---------------------------------- | ---------------- | --------- | ----------------------------------------- |
| `pool`                             | `string`         | `string`  | Pool account address                      |
| `position`                         | `string`         | `string`  | Position account address                  |
| `tokenAAccount`                    | `string`         | `string`  | Token A account address                   |
| `tokenBAccount`                    | `string`         | `string`  | Token B account address                   |
| `tokenAVault`                      | `string`         | `string`  | Token A vault address                     |
| `tokenBVault`                      | `string`         | `string`  | Token B vault address                     |
| `tokenAAmountThreshold`            | `bigint`         | `string`  | Token A amount threshold                  |
| `tokenAAmountThresholdUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token A threshold            |
| `tokenBAmountThreshold`            | `bigint`         | `string`  | Token B amount threshold                  |
| `tokenBAmountThresholdUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token B threshold            |
| `tokenAAmountOut`                  | `bigint`         | `string`  | Token A amount withdrawn                  |
| `tokenAAmountOutUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted token A withdrawal amount    |
| `tokenBAmountOut`                  | `bigint`         | `string`  | Token B amount withdrawn                  |
| `tokenBAmountOutUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted token B withdrawal amount    |
| `tokenAAccountPostBalance`         | `bigint`         | `string`  | Token A account balance after removal     |
| `tokenAAccountPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token A account post-balance |
| `tokenBAccountPostBalance`         | `bigint`         | `string`  | Token B account balance after removal     |
| `tokenBAccountPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token B account post-balance |
| `tokenAVaultPostBalance`           | `bigint`         | `string`  | Token A vault balance after removal       |
| `tokenAVaultPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token A vault post-balance   |
| `tokenBVaultPostBalance`           | `bigint`         | `string`  | Token B vault balance after removal       |
| `tokenBVaultPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token B vault post-balance   |
| `tokenAAccountPreBalance`          | `bigint`         | `string`  | Token A account balance before removal    |
| `tokenAAccountPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token A account pre-balance  |
| `tokenBAccountPreBalance`          | `bigint`         | `string`  | Token B account balance before removal    |
| `tokenBAccountPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token B account pre-balance  |
| `tokenAVaultPreBalance`            | `bigint`         | `string`  | Token A vault balance before removal      |
| `tokenAVaultPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token A vault pre-balance    |
| `tokenBVaultPreBalance`            | `bigint`         | `string`  | Token B vault balance before removal      |
| `tokenBVaultPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token B vault pre-balance    |
| `owner`                            | `string`         | `string`  | Position owner address                    |

### Data Types

* `bigint`: Large integer values for token amounts, prices, and liquidity
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for decimals and other integer values
* `boolean`: True/false values for token input indicators
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (METEORA\_DAMM\_V2)

### 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. The DAMM V2 decoder handles concentrated liquidity mechanics with position management, multiple fee tiers, and advanced slippage protection.


# Meteora DAMM

This document describes the output structure for the Meteora DAMM (Dynamic Automated Market Maker) decoder functions. The decoder handles four main event types: INITIALIZE\_PERMISSIONLESS\_CONSTANT\_PRODUCT\_POOL\_WITH\_CONFIG2, SWAP, ADD\_BALANCE\_LIQUIDITY, and REMOVE\_BALANCE\_LIQUIDITY.

### 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`         | Meteora DAMM program ID                                                                                                                       |
| `eventType`       | `string`         | `string`         | Type of event (INITIALIZE\_PERMISSIONLESS\_CONSTANT\_PRODUCT\_POOL\_WITH\_CONFIG2, SWAP, ADD\_BALANCE\_LIQUIDITY, REMOVE\_BALANCE\_LIQUIDITY) |
| `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                                                                                                                  |

### INITIALIZE\_PERMISSIONLESS\_CONSTANT\_PRODUCT\_POOL\_WITH\_CONFIG2 Event

Constant product pool initialization event.

| Property               | Type             | JSON Type | Description                         |
| ---------------------- | ---------------- | --------- | ----------------------------------- |
| `lpMint`               | `string`         | `string`  | LP token mint address               |
| `mint`                 | `string`         | `string`  | Pool mint address                   |
| `tokenBMint`           | `string`         | `string`  | Token B mint address                |
| `tokenAVault`          | `string`         | `string`  | Token A vault address               |
| `tokenBVault`          | `string`         | `string`  | Token B vault address               |
| `tokenAAmount`         | `bigint`         | `string`  | Initial token A amount              |
| `tokenAAmountUiAmount` | `PreciseDecimal` | `string`  | UI-formatted initial token A amount |
| `tokenBAmount`         | `bigint`         | `string`  | Initial token B amount              |
| `tokenBAmountUiAmount` | `PreciseDecimal` | `string`  | UI-formatted initial token B amount |

### SWAP Event

Token swap event on Meteora DAMM pool.

| Property                             | Type             | JSON Type | Description                                |
| ------------------------------------ | ---------------- | --------- | ------------------------------------------ |
| `tokenAMint`                         | `string`         | `string`  | Token A mint address                       |
| `tokenBMint`                         | `string`         | `string`  | Token B mint address                       |
| `tokenADecimals`                     | `number`         | `number`  | Token A decimal places                     |
| `tokenBDecimals`                     | `number`         | `number`  | Token B decimal places                     |
| `amountIn`                           | `bigint`         | `string`  | Input token amount                         |
| `amountInUiAmount`                   | `PreciseDecimal` | `string`  | UI-formatted input amount                  |
| `amountOut`                          | `bigint`         | `string`  | Output token amount                        |
| `amountOutUiAmount`                  | `PreciseDecimal` | `string`  | UI-formatted output amount                 |
| `minimumAmountOut`                   | `bigint`         | `string`  | Minimum acceptable output amount           |
| `minimumAmountOutUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted minimum output amount         |
| `slippageAmount`                     | `bigint`         | `string`  | Slippage amount                            |
| `slippageAmountUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted slippage amount               |
| `expectedAmountOut`                  | `bigint`         | `string`  | Expected output amount                     |
| `expectedAmountOutUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted expected output amount        |
| `slippageTolerance`                  | `bigint`         | `string`  | Slippage tolerance                         |
| `slippageToleranceUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted slippage tolerance            |
| `actualPrice`                        | `bigint`         | `string`  | Actual swap price                          |
| `actualPriceUiAmount`                | `PreciseDecimal` | `string`  | UI-formatted actual price                  |
| `slippagePercentage`                 | `bigint`         | `string`  | Slippage percentage                        |
| `slippagePercentageUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted slippage percentage           |
| `userSourcePostBalance`              | `bigint`         | `string`  | User source balance after swap             |
| `userSourcePostBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted user source post-balance      |
| `userDestinationPostBalance`         | `bigint`         | `string`  | User destination balance after swap        |
| `userDestinationPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user destination post-balance |
| `tokenAVaultPostBalance`             | `bigint`         | `string`  | Token A vault balance after swap           |
| `tokenAVaultPostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted token A vault post-balance    |
| `tokenBVaultPostBalance`             | `bigint`         | `string`  | Token B vault balance after swap           |
| `tokenBVaultPostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted token B vault post-balance    |
| `userSourcePreBalance`               | `bigint`         | `string`  | User source balance before swap            |
| `userSourcePreBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted user source pre-balance       |
| `userDestinationPreBalance`          | `bigint`         | `string`  | User destination balance before swap       |
| `userDestinationPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user destination pre-balance  |
| `tokenAVaultPreBalance`              | `bigint`         | `string`  | Token A vault balance before swap          |
| `tokenAVaultPreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted token A vault pre-balance     |
| `tokenBVaultPreBalance`              | `bigint`         | `string`  | Token B vault balance before swap          |
| `tokenBVaultPreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted token B vault pre-balance     |
| `pricePre`                           | `bigint`         | `string`  | Price before swap                          |
| `pricePreUiAmount`                   | `PreciseDecimal` | `string`  | UI-formatted price before swap             |
| `pricePost`                          | `bigint`         | `string`  | Price after swap                           |
| `pricePostUiAmount`                  | `PreciseDecimal` | `string`  | UI-formatted price after swap              |
| `protocolTokenFeeAmount`             | `bigint`         | `string`  | Protocol token fee amount                  |
| `protocolTokenFeeAmountUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted protocol token fee            |
| `isInputTokenA`                      | `boolean`        | `boolean` | Whether the input token is token A         |

### ADD\_BALANCE\_LIQUIDITY Event

Liquidity addition event for Meteora DAMM pool.

| Property                         | Type             | JSON Type | Description                             |
| -------------------------------- | ---------------- | --------- | --------------------------------------- |
| `lpMintAddress`                  | `string`         | `string`  | LP token mint address                   |
| `userPoolLp`                     | `string`         | `string`  | User's LP pool account                  |
| `tokenAVault`                    | `string`         | `string`  | Token A vault address                   |
| `tokenBVault`                    | `string`         | `string`  | Token B vault address                   |
| `userAToken`                     | `string`         | `string`  | User's token A account                  |
| `userBToken`                     | `string`         | `string`  | User's token B account                  |
| `lpAVault`                       | `string`         | `string`  | LP token A vault address                |
| `lpBVault`                       | `string`         | `string`  | LP token B vault address                |
| `lpAMintVault`                   | `string`         | `string`  | LP A mint vault address                 |
| `lpBMintVault`                   | `string`         | `string`  | LP B mint vault address                 |
| `tokenAAmountIn`                 | `bigint`         | `string`  | Token A amount deposited                |
| `tokenAAmountInUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted token A deposit amount     |
| `tokenBAmountIn`                 | `bigint`         | `string`  | Token B amount deposited                |
| `tokenBAmountInUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted token B deposit amount     |
| `lpTokenAmountOut`               | `bigint`         | `string`  | LP tokens minted                        |
| `lpTokenAmountOutUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted LP tokens minted           |
| `maximumTokenAAmount`            | `bigint`         | `string`  | Maximum token A amount to deposit       |
| `maximumTokenAAmountUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted maximum token A amount     |
| `maximumTokenBAmount`            | `bigint`         | `string`  | Maximum token B amount to deposit       |
| `maximumTokenBAmountUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted maximum token B amount     |
| `userATokenPostBalance`          | `bigint`         | `string`  | User token A balance after deposit      |
| `userATokenPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token A post-balance  |
| `userBTokenPostBalance`          | `bigint`         | `string`  | User token B balance after deposit      |
| `userBTokenPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token B post-balance  |
| `lpTokenPostBalance`             | `bigint`         | `string`  | LP token balance after deposit          |
| `lpTokenPostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted LP token post-balance      |
| `tokenAVaultPostBalance`         | `bigint`         | `string`  | Token A vault balance after deposit     |
| `tokenAVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token A vault post-balance |
| `tokenBVaultPostBalance`         | `bigint`         | `string`  | Token B vault balance after deposit     |
| `tokenBVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token B vault post-balance |
| `userATokenPreBalance`           | `bigint`         | `string`  | User token A balance before deposit     |
| `userATokenPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user token A pre-balance   |
| `userBTokenPreBalance`           | `bigint`         | `string`  | User token B balance before deposit     |
| `userBTokenPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user token B pre-balance   |
| `lpTokenPreBalance`              | `bigint`         | `string`  | LP token balance before deposit         |
| `lpTokenPreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted LP token pre-balance       |
| `tokenAVaultPreBalance`          | `bigint`         | `string`  | Token A vault balance before deposit    |
| `tokenAVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token A vault pre-balance  |
| `tokenBVaultPreBalance`          | `bigint`         | `string`  | Token B vault balance before deposit    |
| `tokenBVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token B vault pre-balance  |

### REMOVE\_BALANCE\_LIQUIDITY Event

Liquidity removal event for Meteora DAMM pool.

| Property                         | Type             | JSON Type | Description                             |
| -------------------------------- | ---------------- | --------- | --------------------------------------- |
| `lpMintAddress`                  | `string`         | `string`  | LP token mint address                   |
| `userPoolLp`                     | `string`         | `string`  | User's LP pool account                  |
| `tokenAVault`                    | `string`         | `string`  | Token A vault address                   |
| `tokenBVault`                    | `string`         | `string`  | Token B vault address                   |
| `userAToken`                     | `string`         | `string`  | User's token A account                  |
| `userBToken`                     | `string`         | `string`  | User's token B account                  |
| `lpAVault`                       | `string`         | `string`  | LP token A vault address                |
| `lpBVault`                       | `string`         | `string`  | LP token B vault address                |
| `lpAMintVault`                   | `string`         | `string`  | LP A mint vault address                 |
| `lpBMintVault`                   | `string`         | `string`  | LP B mint vault address                 |
| `tokenAAmountOut`                | `bigint`         | `string`  | Token A amount withdrawn                |
| `tokenAAmountOutUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted token A withdrawal amount  |
| `tokenBAmountOut`                | `bigint`         | `string`  | Token B amount withdrawn                |
| `tokenBAmountOutUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted token B withdrawal amount  |
| `lpTokenAmountIn`                | `bigint`         | `string`  | LP tokens burned                        |
| `lpTokenAmountInUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted LP tokens burned           |
| `minimumTokenAAmount`            | `bigint`         | `string`  | Minimum token A amount to receive       |
| `minimumTokenAAmountUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted minimum token A amount     |
| `minimumTokenBAmount`            | `bigint`         | `string`  | Minimum token B amount to receive       |
| `minimumTokenBAmountUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted minimum token B amount     |
| `userATokenPostBalance`          | `bigint`         | `string`  | User token A balance after withdrawal   |
| `userATokenPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token A post-balance  |
| `userBTokenPostBalance`          | `bigint`         | `string`  | User token B balance after withdrawal   |
| `userBTokenPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token B post-balance  |
| `lpTokenPostBalance`             | `bigint`         | `string`  | LP token balance after withdrawal       |
| `lpTokenPostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted LP token post-balance      |
| `tokenAVaultPostBalance`         | `bigint`         | `string`  | Token A vault balance after withdrawal  |
| `tokenAVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token A vault post-balance |
| `tokenBVaultPostBalance`         | `bigint`         | `string`  | Token B vault balance after withdrawal  |
| `tokenBVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted token B vault post-balance |
| `userATokenPreBalance`           | `bigint`         | `string`  | User token A balance before withdrawal  |
| `userATokenPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user token A pre-balance   |
| `userBTokenPreBalance`           | `bigint`         | `string`  | User token B balance before withdrawal  |
| `userBTokenPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user token B pre-balance   |
| `lpTokenPreBalance`              | `bigint`         | `string`  | LP token balance before withdrawal      |
| `lpTokenPreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted LP token pre-balance       |
| `tokenAVaultPreBalance`          | `bigint`         | `string`  | Token A vault balance before withdrawal |
| `tokenAVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token A vault pre-balance  |
| `tokenBVaultPreBalance`          | `bigint`         | `string`  | Token B vault balance before withdrawal |
| `tokenBVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted token B vault pre-balance  |

### Data Types

* `bigint`: Large integer values for token amounts and prices
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for decimals and other integer values
* `boolean`: True/false values for token input indicators
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (METEORA\_DAMM)

### 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. The DAMM decoder handles constant product automated market maker mechanics with comprehensive balance tracking, slippage calculation, and liquidity management.


# Meteora DBC

This document describes the output structure for the Meteora DBC (Dynamic Bond Curve) decoder functions. The decoder handles four main event types: INITIALIZE\_VIRTUAL\_POOL\_WITH\_SPL\_TOKEN, SWAP, MIGRATE\_METEORA\_DAMM, and MIGRATE\_METEORA\_DAMM\_V2.

### 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`         | Meteora DBC program ID                                                                                                |
| `eventType`       | `string`         | `string`         | Type of event (INITIALIZE\_VIRTUAL\_POOL\_WITH\_SPL\_TOKEN, SWAP, MIGRATE\_METEORA\_DAMM, MIGRATE\_METEORA\_DAMM\_V2) |
| `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                                                                                          |

### INITIALIZE\_VIRTUAL\_POOL\_WITH\_SPL\_TOKEN Event

Virtual pool initialization event with SPL token.

| Property     | Type     | JSON Type | Description               |
| ------------ | -------- | --------- | ------------------------- |
| `name`       | `string` | `string`  | Token name                |
| `symbol`     | `string` | `string`  | Token symbol              |
| `uri`        | `string` | `string`  | Token metadata URI        |
| `creator`    | `string` | `string`  | Pool creator address      |
| `mint`       | `string` | `string`  | Token mint address        |
| `pool`       | `string` | `string`  | Virtual pool address      |
| `quoteMint`  | `string` | `string`  | Quote token mint address  |
| `baseVault`  | `string` | `string`  | Base token vault address  |
| `quoteVault` | `string` | `string`  | Quote token vault address |

### SWAP Event

Token swap event on Meteora DBC virtual pool.

| Property                                 | Type             | JSON Type | Description                                |
| ---------------------------------------- | ---------------- | --------- | ------------------------------------------ |
| `isBuy`                                  | `boolean`        | `boolean` | True for buy orders, false for sell orders |
| `pool`                                   | `string`         | `string`  | Virtual pool address                       |
| `config`                                 | `string`         | `string`  | Pool configuration address                 |
| `hasReferral`                            | `boolean`        | `boolean` | Whether the swap has a referral            |
| `inputTokenAccount`                      | `string`         | `string`  | Input token account address                |
| `outputTokenAccount`                     | `string`         | `string`  | Output token account address               |
| `baseVault`                              | `string`         | `string`  | Base token vault address                   |
| `quoteVault`                             | `string`         | `string`  | Quote token vault address                  |
| `baseMint`                               | `string`         | `string`  | Base token mint address                    |
| `quoteMint`                              | `string`         | `string`  | Quote token mint address                   |
| `price`                                  | `bigint`         | `string`  | Current swap price                         |
| `priceUiAmount`                          | `PreciseDecimal` | `string`  | UI-formatted current price                 |
| `pricePre`                               | `bigint`         | `string`  | Price before swap                          |
| `pricePreUiAmount`                       | `PreciseDecimal` | `string`  | UI-formatted price before swap             |
| `pricePost`                              | `bigint`         | `string`  | Price after swap                           |
| `pricePostUiAmount`                      | `PreciseDecimal` | `string`  | UI-formatted price after swap              |
| `minimumAmountOut`                       | `bigint`         | `string`  | Minimum acceptable output amount           |
| `minimumAmountOutUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted minimum output amount         |
| `nextSqrtPrice`                          | `bigint`         | `string`  | Next square root price                     |
| `nextSqrtPriceUiAmount`                  | `PreciseDecimal` | `string`  | UI-formatted next square root price        |
| `tradingFee`                             | `bigint`         | `string`  | Trading fee amount                         |
| `tradingFeeUiAmount`                     | `PreciseDecimal` | `string`  | UI-formatted trading fee                   |
| `protocolFee`                            | `bigint`         | `string`  | Protocol fee amount                        |
| `protocolFeeUiAmount`                    | `PreciseDecimal` | `string`  | UI-formatted protocol fee                  |
| `referralFee`                            | `bigint`         | `string`  | Referral fee amount                        |
| `referralFeeUiAmount`                    | `PreciseDecimal` | `string`  | UI-formatted referral fee                  |
| `currentTimestamp`                       | `number`         | `number`  | Current timestamp                          |
| `baseVaultPreBalance`                    | `bigint`         | `string`  | Base vault balance before swap             |
| `baseVaultPreBalanceUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted base vault pre-balance        |
| `quoteVaultPreBalance`                   | `bigint`         | `string`  | Quote vault balance before swap            |
| `quoteVaultPreBalanceUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted quote vault pre-balance       |
| `inputAccountAmountPreBalance`           | `bigint`         | `string`  | Input account balance before swap          |
| `inputAccountAmountPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted input account pre-balance     |
| `outputAccountAmountPreBalance`          | `bigint`         | `string`  | Output account balance before swap         |
| `outputAccountAmountPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted output account pre-balance    |
| `baseVaultPostBalance`                   | `bigint`         | `string`  | Base vault balance after swap              |
| `baseVaultPostBalanceUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted base vault post-balance       |
| `quoteVaultPostBalance`                  | `bigint`         | `string`  | Quote vault balance after swap             |
| `quoteVaultPostBalanceUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted quote vault post-balance      |
| `inputAccountAmountPostBalance`          | `bigint`         | `string`  | Input account balance after swap           |
| `inputAccountAmountPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted input account post-balance    |
| `outputAccountAmountPostBalance`         | `bigint`         | `string`  | Output account balance after swap          |
| `outputAccountAmountPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted output account post-balance   |
| `amountIn`                               | `bigint`         | `string`  | Input token amount                         |
| `amountInUiAmount`                       | `PreciseDecimal` | `string`  | UI-formatted input amount                  |
| `amountOut`                              | `bigint`         | `string`  | Output token amount                        |
| `amountOutUiAmount`                      | `PreciseDecimal` | `string`  | UI-formatted output amount                 |
| `sqrtStartPrice`                         | `bigint`         | `string`  | Starting square root price                 |
| `sqrtPricePre`                           | `bigint`         | `string`  | Square root price before swap              |
| `sqrtPricePreUiAmount`                   | `PreciseDecimal` | `string`  | UI-formatted sqrt price before swap        |
| `sqrtPricePost`                          | `bigint`         | `string`  | Square root price after swap               |
| `sqrtPricePostUiAmount`                  | `PreciseDecimal` | `string`  | UI-formatted sqrt price after swap         |
| `virtualLiquidity`                       | `bigint`         | `string`  | Virtual liquidity amount                   |
| `virtualLiquidityUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted virtual liquidity             |

### MIGRATE\_METEORA\_DAMM Event

Migration event from DBC to Meteora DAMM.

| Property            | Type     | JSON Type | Description                 |
| ------------------- | -------- | --------- | --------------------------- |
| `virtualPool`       | `string` | `string`  | Source virtual pool address |
| `migrationMetadata` | `string` | `string`  | Migration metadata account  |
| `pool`              | `string` | `string`  | Destination pool address    |
| `lpMint`            | `string` | `string`  | LP token mint address       |
| `tokenAMint`        | `string` | `string`  | Token A mint address        |
| `tokenBMint`        | `string` | `string`  | Token B mint address        |
| `AVault`            | `string` | `string`  | Token A vault address       |
| `BVault`            | `string` | `string`  | Token B vault address       |
| `ATokenVault`       | `string` | `string`  | Token A token vault address |
| `BTokenVault`       | `string` | `string`  | Token B token vault address |
| `AlpVault`          | `string` | `string`  | Token A LP vault address    |
| `BlPVault`          | `string` | `string`  | Token B LP vault address    |

### MIGRATE\_METEORA\_DAMM\_V2 Event

Migration event from DBC to Meteora DAMM V2.

| Property                   | Type     | JSON Type | Description                         |
| -------------------------- | -------- | --------- | ----------------------------------- |
| `virtualPool`              | `string` | `string`  | Source virtual pool address         |
| `migrationMetadata`        | `string` | `string`  | Migration metadata account          |
| `pool`                     | `string` | `string`  | Destination pool address            |
| `firstPositionNftMint`     | `string` | `string`  | First position NFT mint address     |
| `firstPositionNftAccount`  | `string` | `string`  | First position NFT account address  |
| `firstPosition`            | `string` | `string`  | First position account address      |
| `secondPositionNftMint`    | `string` | `string`  | Second position NFT mint address    |
| `secondPositionNftAccount` | `string` | `string`  | Second position NFT account address |
| `secondPosition`           | `string` | `string`  | Second position account address     |
| `baseMint`                 | `string` | `string`  | Base token mint address             |
| `quoteMint`                | `string` | `string`  | Quote token mint address            |

### Data Types

* `bigint`: Large integer values for token amounts and prices
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for timestamps and other integer values
* `boolean`: True/false values for swap direction and referral indicators
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (METEORA\_DBC)

### 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. The DBC decoder handles dynamic bonding curve mechanics with comprehensive price tracking, fee calculation, and migration capabilities to other Meteora protocols.


# Meteora DLMM

This document describes the output structure for the Meteora DLMM (Dynamic Liquidity Market Maker) decoder functions. The decoder handles six main event types: INITIALIZE\_LB\_PAIR, SWAP, REMOVE\_LIQUIDITY, ADD\_LIQUIDITY, INCREASE\_LIQUIDITY, and DECREASE\_LIQUIDITY.

### 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`         | Meteora DLMM program ID                                                                                                 |
| `eventType`       | `string`         | `string`         | Type of event (INITIALIZE\_LB\_PAIR, SWAP, REMOVE\_LIQUIDITY, ADD\_LIQUIDITY, INCREASE\_LIQUIDITY, DECREASE\_LIQUIDITY) |
| `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                                                                                            |

### INITIALIZE\_LB\_PAIR Event

Liquidity book pair initialization event.

| Property                   | Type     | JSON Type | Description                    |
| -------------------------- | -------- | --------- | ------------------------------ |
| `tokenXMint`               | `string` | `string`  | Token X mint address           |
| `tokenYMint`               | `string` | `string`  | Token Y mint address           |
| `tokenXDecimals`           | `number` | `number`  | Token X decimal places         |
| `tokenYDecimals`           | `number` | `number`  | Token Y decimal places         |
| `binStep`                  | `number` | `number`  | Bin step size                  |
| `baseFactor`               | `number` | `number`  | Base factor for price bins     |
| `filterPeriod`             | `number` | `number`  | Filter period                  |
| `decayPeriod`              | `number` | `number`  | Decay period                   |
| `reductionFactor`          | `number` | `number`  | Reduction factor               |
| `variableFeeControl`       | `number` | `number`  | Variable fee control parameter |
| `maxVolatilityAccumulated` | `number` | `number`  | Maximum volatility accumulated |
| `minBinId`                 | `number` | `number`  | Minimum bin ID                 |
| `maxBinId`                 | `number` | `number`  | Maximum bin ID                 |
| `protocolShare`            | `number` | `number`  | Protocol share percentage      |
| `baseFeeRate`              | `number` | `number`  | Base fee rate                  |

### SWAP Event

Token swap event on Meteora DLMM pool.

| Property                        | Type             | JSON Type | Description                               |
| ------------------------------- | ---------------- | --------- | ----------------------------------------- |
| `lbPair`                        | `string`         | `string`  | Liquidity book pair address               |
| `userTokenX`                    | `string`         | `string`  | User's token X account                    |
| `userTokenY`                    | `string`         | `string`  | User's token Y account                    |
| `reserveX`                      | `string`         | `string`  | Token X reserve address                   |
| `reserveY`                      | `string`         | `string`  | Token Y reserve address                   |
| `amountIn`                      | `bigint`         | `string`  | Input token amount                        |
| `amountInUiAmount`              | `PreciseDecimal` | `string`  | UI-formatted input amount                 |
| `amountOut`                     | `bigint`         | `string`  | Output token amount                       |
| `amountOutUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted output amount                |
| `swapForY`                      | `boolean`        | `boolean` | True if swapping for token Y              |
| `fee`                           | `bigint`         | `string`  | Swap fee amount                           |
| `feeUiAmount`                   | `PreciseDecimal` | `string`  | UI-formatted swap fee                     |
| `protocolFee`                   | `bigint`         | `string`  | Protocol fee amount                       |
| `protocolFeeUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted protocol fee                 |
| `feeBps`                        | `number`         | `number`  | Fee in basis points                       |
| `hostFee`                       | `bigint`         | `string`  | Host fee amount                           |
| `hostFeeUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted host fee                     |
| `startBinId`                    | `number`         | `number`  | Starting bin ID for swap                  |
| `endBinId`                      | `number`         | `number`  | Ending bin ID for swap                    |
| `reserveXPostBalance`           | `bigint`         | `string`  | Token X reserve balance after swap        |
| `reserveXPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token X reserve post-balance |
| `reserveYPostBalance`           | `bigint`         | `string`  | Token Y reserve balance after swap        |
| `reserveYPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token Y reserve post-balance |
| `userTokenXPostBalance`         | `bigint`         | `string`  | User token X balance after swap           |
| `userTokenXPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token X post-balance    |
| `userTokenYPostBalance`         | `bigint`         | `string`  | User token Y balance after swap           |
| `userTokenYPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token Y post-balance    |
| `reserveXPreBalance`            | `bigint`         | `string`  | Token X reserve balance before swap       |
| `reserveXPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token X reserve pre-balance  |
| `reserveYPreBalance`            | `bigint`         | `string`  | Token Y reserve balance before swap       |
| `reserveYPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token Y reserve pre-balance  |
| `userTokenXPreBalance`          | `bigint`         | `string`  | User token X balance before swap          |
| `userTokenXPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token X pre-balance     |
| `userTokenYPreBalance`          | `bigint`         | `string`  | User token Y balance before swap          |
| `userTokenYPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token Y pre-balance     |

### REMOVE\_LIQUIDITY Event

Liquidity removal event for Meteora DLMM pool.

| Property                        | Type             | JSON Type | Description                               |
| ------------------------------- | ---------------- | --------- | ----------------------------------------- |
| `position`                      | `string`         | `string`  | Position account address                  |
| `lbPair`                        | `string`         | `string`  | Liquidity book pair address               |
| `userTokenX`                    | `string`         | `string`  | User's token X account                    |
| `userTokenY`                    | `string`         | `string`  | User's token Y account                    |
| `reserveX`                      | `string`         | `string`  | Token X reserve address                   |
| `reserveY`                      | `string`         | `string`  | Token Y reserve address                   |
| `binId`                         | `number`         | `number`  | Bin ID for liquidity removal              |
| `bpsToRemove`                   | `number`         | `number`  | Basis points to remove                    |
| `amountXOut`                    | `bigint`         | `string`  | Token X amount withdrawn                  |
| `amountXOutUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted token X withdrawal amount    |
| `amountYOut`                    | `bigint`         | `string`  | Token Y amount withdrawn                  |
| `amountYOutUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted token Y withdrawal amount    |
| `reserveXPostBalance`           | `bigint`         | `string`  | Token X reserve balance after removal     |
| `reserveXPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token X reserve post-balance |
| `reserveYPostBalance`           | `bigint`         | `string`  | Token Y reserve balance after removal     |
| `reserveYPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token Y reserve post-balance |
| `userTokenXPostBalance`         | `bigint`         | `string`  | User token X balance after removal        |
| `userTokenXPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token X post-balance    |
| `userTokenYPostBalance`         | `bigint`         | `string`  | User token Y balance after removal        |
| `userTokenYPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token Y post-balance    |
| `reserveXPreBalance`            | `bigint`         | `string`  | Token X reserve balance before removal    |
| `reserveXPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token X reserve pre-balance  |
| `reserveYPreBalance`            | `bigint`         | `string`  | Token Y reserve balance before removal    |
| `reserveYPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token Y reserve pre-balance  |
| `userTokenXPreBalance`          | `bigint`         | `string`  | User token X balance before removal       |
| `userTokenXPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token X pre-balance     |
| `userTokenYPreBalance`          | `bigint`         | `string`  | User token Y balance before removal       |
| `userTokenYPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token Y pre-balance     |

### ADD\_LIQUIDITY Event

Liquidity addition event for Meteora DLMM pool.

| Property                        | Type             | JSON Type | Description                               |
| ------------------------------- | ---------------- | --------- | ----------------------------------------- |
| `position`                      | `string`         | `string`  | Position account address                  |
| `lbPair`                        | `string`         | `string`  | Liquidity book pair address               |
| `userTokenX`                    | `string`         | `string`  | User's token X account                    |
| `userTokenY`                    | `string`         | `string`  | User's token Y account                    |
| `reserveX`                      | `string`         | `string`  | Token X reserve address                   |
| `reserveY`                      | `string`         | `string`  | Token Y reserve address                   |
| `binId`                         | `number`         | `number`  | Bin ID for liquidity addition             |
| `amount`                        | `bigint`         | `string`  | Liquidity amount added                    |
| `amountUiAmount`                | `PreciseDecimal` | `string`  | UI-formatted liquidity amount             |
| `amountXIn`                     | `bigint`         | `string`  | Token X amount deposited                  |
| `amountXInUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted token X deposit amount       |
| `amountYIn`                     | `bigint`         | `string`  | Token Y amount deposited                  |
| `amountYInUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted token Y deposit amount       |
| `reserveXPostBalance`           | `bigint`         | `string`  | Token X reserve balance after addition    |
| `reserveXPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token X reserve post-balance |
| `reserveYPostBalance`           | `bigint`         | `string`  | Token Y reserve balance after addition    |
| `reserveYPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token Y reserve post-balance |
| `userTokenXPostBalance`         | `bigint`         | `string`  | User token X balance after addition       |
| `userTokenXPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token X post-balance    |
| `userTokenYPostBalance`         | `bigint`         | `string`  | User token Y balance after addition       |
| `userTokenYPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token Y post-balance    |
| `reserveXPreBalance`            | `bigint`         | `string`  | Token X reserve balance before addition   |
| `reserveXPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token X reserve pre-balance  |
| `reserveYPreBalance`            | `bigint`         | `string`  | Token Y reserve balance before addition   |
| `reserveYPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token Y reserve pre-balance  |
| `userTokenXPreBalance`          | `bigint`         | `string`  | User token X balance before addition      |
| `userTokenXPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token X pre-balance     |
| `userTokenYPreBalance`          | `bigint`         | `string`  | User token Y balance before addition      |
| `userTokenYPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token Y pre-balance     |

### INCREASE\_LIQUIDITY Event

Liquidity increase event for existing positions.

| Property                        | Type             | JSON Type | Description                               |
| ------------------------------- | ---------------- | --------- | ----------------------------------------- |
| `position`                      | `string`         | `string`  | Position account address                  |
| `lbPair`                        | `string`         | `string`  | Liquidity book pair address               |
| `userTokenX`                    | `string`         | `string`  | User's token X account                    |
| `userTokenY`                    | `string`         | `string`  | User's token Y account                    |
| `reserveX`                      | `string`         | `string`  | Token X reserve address                   |
| `reserveY`                      | `string`         | `string`  | Token Y reserve address                   |
| `liquidityAmount`               | `bigint`         | `string`  | Liquidity amount increased                |
| `liquidityAmountUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted liquidity increase amount    |
| `amountXIn`                     | `bigint`         | `string`  | Token X amount deposited                  |
| `amountXInUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted token X deposit amount       |
| `amountYIn`                     | `bigint`         | `string`  | Token Y amount deposited                  |
| `amountYInUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted token Y deposit amount       |
| `activeBinId`                   | `number`         | `number`  | Active bin ID                             |
| `reserveXPostBalance`           | `bigint`         | `string`  | Token X reserve balance after increase    |
| `reserveXPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token X reserve post-balance |
| `reserveYPostBalance`           | `bigint`         | `string`  | Token Y reserve balance after increase    |
| `reserveYPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token Y reserve post-balance |
| `userTokenXPostBalance`         | `bigint`         | `string`  | User token X balance after increase       |
| `userTokenXPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token X post-balance    |
| `userTokenYPostBalance`         | `bigint`         | `string`  | User token Y balance after increase       |
| `userTokenYPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token Y post-balance    |
| `reserveXPreBalance`            | `bigint`         | `string`  | Token X reserve balance before increase   |
| `reserveXPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token X reserve pre-balance  |
| `reserveYPreBalance`            | `bigint`         | `string`  | Token Y reserve balance before increase   |
| `reserveYPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token Y reserve pre-balance  |
| `userTokenXPreBalance`          | `bigint`         | `string`  | User token X balance before increase      |
| `userTokenXPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token X pre-balance     |
| `userTokenYPreBalance`          | `bigint`         | `string`  | User token Y balance before increase      |
| `userTokenYPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token Y pre-balance     |

### DECREASE\_LIQUIDITY Event

Liquidity decrease event for existing positions.

| Property                        | Type             | JSON Type | Description                               |
| ------------------------------- | ---------------- | --------- | ----------------------------------------- |
| `position`                      | `string`         | `string`  | Position account address                  |
| `lbPair`                        | `string`         | `string`  | Liquidity book pair address               |
| `userTokenX`                    | `string`         | `string`  | User's token X account                    |
| `userTokenY`                    | `string`         | `string`  | User's token Y account                    |
| `reserveX`                      | `string`         | `string`  | Token X reserve address                   |
| `reserveY`                      | `string`         | `string`  | Token Y reserve address                   |
| `liquidityAmount`               | `bigint`         | `string`  | Liquidity amount decreased                |
| `liquidityAmountUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted liquidity decrease amount    |
| `amountXOut`                    | `bigint`         | `string`  | Token X amount withdrawn                  |
| `amountXOutUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted token X withdrawal amount    |
| `amountYOut`                    | `bigint`         | `string`  | Token Y amount withdrawn                  |
| `amountYOutUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted token Y withdrawal amount    |
| `binId`                         | `number`         | `number`  | Bin ID for liquidity decrease             |
| `reserveXPostBalance`           | `bigint`         | `string`  | Token X reserve balance after decrease    |
| `reserveXPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token X reserve post-balance |
| `reserveYPostBalance`           | `bigint`         | `string`  | Token Y reserve balance after decrease    |
| `reserveYPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted token Y reserve post-balance |
| `userTokenXPostBalance`         | `bigint`         | `string`  | User token X balance after decrease       |
| `userTokenXPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token X post-balance    |
| `userTokenYPostBalance`         | `bigint`         | `string`  | User token Y balance after decrease       |
| `userTokenYPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token Y post-balance    |
| `reserveXPreBalance`            | `bigint`         | `string`  | Token X reserve balance before decrease   |
| `reserveXPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token X reserve pre-balance  |
| `reserveYPreBalance`            | `bigint`         | `string`  | Token Y reserve balance before decrease   |
| `reserveYPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token Y reserve pre-balance  |
| `userTokenXPreBalance`          | `bigint`         | `string`  | User token X balance before decrease      |
| `userTokenXPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token X pre-balance     |
| `userTokenYPreBalance`          | `bigint`         | `string`  | User token Y balance before decrease      |
| `userTokenYPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token Y pre-balance     |

### Data Types

* `bigint`: Large integer values for token amounts, fees, and liquidity
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for bin IDs, basis points, and other integer values
* `boolean`: True/false values for swap direction
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (METEORA\_DLMM)

### 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. The DLMM decoder handles dynamic liquidity market maker mechanics with bin-based liquidity management, variable fees, and concentrated liquidity features.


# Pump Swap

This document describes the output structure for the Pump Fun AMM decoder functions. The decoder handles four main event types: CREATE\_POOL, SWAP (with buy/sell variants), DEPOSIT, and WITHDRAW.

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


# Pump Fun

This document describes the output structure for the Pump Fun decoder functions. The decoder handles four main event types: SWAP, COMPLETE, CREATE, and MIGRATE.

### 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 program ID                             |
| `eventType`       | `string`         | `string`         | Type of event (SWAP, COMPLETE, CREATE, MIGRATE) |
| `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                    |

### SWAP Event

Token swap event on Pump Fun bonding curve.

| Property                       | Type             | JSON Type | Description                                   |
| ------------------------------ | ---------------- | --------- | --------------------------------------------- |
| `maxSolCost`                   | `bigint`         | `string`  | Maximum SOL cost for buy orders (optional)    |
| `maxSolCostUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted max SOL cost (optional)          |
| `minSolOutput`                 | `bigint`         | `string`  | Minimum SOL output for sell orders (optional) |
| `minSolOutputUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted min SOL output (optional)        |
| `mint`                         | `string`         | `string`  | Token mint address                            |
| `isBuy`                        | `boolean`        | `boolean` | True for buy orders, false for sell orders    |
| `account`                      | `string`         | `string`  | User's token account                          |
| `owner`                        | `string`         | `string`  | Account owner address                         |
| `bondingCurve`                 | `string`         | `string`  | Bonding curve account address                 |
| `solAmount`                    | `bigint`         | `string`  | SOL amount involved in swap                   |
| `solAmountUiAmount`            | `PreciseDecimal` | `string`  | UI-formatted SOL amount                       |
| `price`                        | `PreciseDecimal` | `string`  | Actual swap price                             |
| `pricePost`                    | `PreciseDecimal` | `string`  | Price after swap                              |
| `marketCapSol`                 | `bigint`         | `string`  | Market cap in SOL                             |
| `marketCapSolAmount`           | `bigint`         | `string`  | Market cap SOL amount                         |
| `marketCapSolAmountUi`         | `PreciseDecimal` | `string`  | UI-formatted market cap SOL                   |
| `marketCapPumpSol`             | `PreciseDecimal` | `string`  | Pump Fun market cap in SOL                    |
| `marketCapPumpSolAmount`       | `bigint`         | `string`  | Pump Fun market cap SOL amount                |
| `marketCapPumpSolUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted Pump Fun market cap SOL          |
| `tokenAmount`                  | `bigint`         | `string`  | Token amount involved in swap                 |
| `tokenUiAmount`                | `PreciseDecimal` | `string`  | UI-formatted token amount                     |
| `virtualSolReserves`           | `bigint`         | `string`  | Virtual SOL reserves                          |
| `virtualSolReservesAmount`     | `bigint`         | `string`  | Virtual SOL reserves amount                   |
| `virtualSolReservesUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted virtual SOL reserves             |
| `virtualTokenReserves`         | `bigint`         | `string`  | Virtual token reserves                        |
| `virtualTokenReservesAmount`   | `bigint`         | `string`  | Virtual token reserves amount                 |
| `virtualTokenReservesUiAmount` | `PreciseDecimal` | `string`  | UI-formatted virtual token reserves           |
| `bondingCurvePrePercentage`    | `number`         | `number`  | Bonding curve completion before swap (%)      |
| `bondingCurvePostPercentage`   | `number`         | `number`  | Bonding curve completion after swap (%)       |
| `bondingPreBalance`            | `bigint`         | `string`  | Bonding curve balance before swap             |
| `bondingPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted bonding pre-balance              |
| `bondingPreBalanceAmount`      | `bigint`         | `string`  | Bonding pre-balance amount                    |
| `bondingPostBalance`           | `bigint`         | `string`  | Bonding curve balance after swap              |
| `bondingPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted bonding post-balance             |
| `bondingPostBalanceAmount`     | `bigint`         | `string`  | Bonding post-balance amount                   |
| `userTokenPreBalance`          | `bigint`         | `string`  | User token balance before swap                |
| `userTokenPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token pre-balance           |
| `userTokenPreBalanceAmount`    | `bigint`         | `string`  | User token pre-balance amount                 |
| `userTokenPostBalance`         | `bigint`         | `string`  | User token balance after swap                 |
| `userTokenPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token post-balance          |
| `userTokenPostBalanceAmount`   | `bigint`         | `string`  | User token post-balance amount                |
| `realSolReserves`              | `bigint`         | `string`  | Real SOL reserves                             |
| `realSolReservesUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted real SOL reserves                |
| `realTokenReserves`            | `bigint`         | `string`  | Real token reserves                           |
| `realTokenReservesUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted real token reserves              |
| `feeRecipient`                 | `string`         | `string`  | Fee recipient address                         |
| `feeBasisPoints`               | `bigint`         | `string`  | Fee in basis points                           |
| `fee`                          | `bigint`         | `string`  | Fee amount                                    |
| `creator`                      | `string`         | `string`  | Token creator address                         |
| `creatorFeeBasisPoints`        | `bigint`         | `string`  | Creator fee in basis points                   |
| `creatorFee`                   | `bigint`         | `string`  | Creator fee amount                            |

### COMPLETE Event

Bonding curve completion event when token graduates to Raydium.

| Property       | Type     | JSON Type | Description                   |
| -------------- | -------- | --------- | ----------------------------- |
| `user`         | `string` | `string`  | User who completed the curve  |
| `mint`         | `string` | `string`  | Token mint address            |
| `bondingCurve` | `string` | `string`  | Bonding curve account address |
| `timestamp`    | `string` | `string`  | Event timestamp               |

### CREATE Event

Token creation event on Pump Fun.

| Property               | Type     | JSON Type | Description                               |
| ---------------------- | -------- | --------- | ----------------------------------------- |
| `name`                 | `string` | `string`  | Token name                                |
| `symbol`               | `string` | `string`  | Token symbol                              |
| `uri`                  | `string` | `string`  | Token metadata URI                        |
| `creator`              | `string` | `string`  | Token creator address                     |
| `mint`                 | `string` | `string`  | Token mint address                        |
| `bondingCurve`         | `string` | `string`  | Bonding curve account address             |
| `timestamp`            | `string` | `string`  | Creation timestamp                        |
| `virtualTokenReserves` | `string` | `string`  | Initial virtual token reserves (optional) |
| `virtualSolReserves`   | `string` | `string`  | Initial virtual SOL reserves (optional)   |
| `realTokenReserves`    | `string` | `string`  | Initial real token reserves (optional)    |
| `tokenTotalSupply`     | `string` | `string`  | Total token supply (optional)             |

### MIGRATE Event

Token migration event when moving from bonding curve to Raydium.

| Property                   | Type             | JSON Type | Description                      |
| -------------------------- | ---------------- | --------- | -------------------------------- |
| `user`                     | `string`         | `string`  | User who initiated migration     |
| `mint`                     | `string`         | `string`  | Token mint address               |
| `mintAmount`               | `bigint`         | `string`  | Amount of tokens minted          |
| `mintAmountUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted mint amount         |
| `solAmount`                | `bigint`         | `string`  | SOL amount involved in migration |
| `solAmountUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted SOL amount          |
| `poolMigrationFee`         | `bigint`         | `string`  | Pool migration fee               |
| `poolMigrationFeeUiAmount` | `PreciseDecimal` | `string`  | UI-formatted migration fee       |
| `bondingCurve`             | `string`         | `string`  | Bonding curve account address    |
| `timestamp`                | `string`         | `string`  | Migration timestamp              |
| `pool`                     | `string`         | `string`  | Destination pool address         |

### Data Types

* `bigint`: Large integer values for token amounts and prices
* `string`: Text values for addresses, names, symbols, and timestamps
* `number`: Numeric values for percentages and other integer values
* `boolean`: True/false values for buy/sell direction
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (PUMP\_FUN)

### 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. The Pump Fun decoder handles bonding curve mechanics with comprehensive price tracking, market cap calculations, and virtual/real reserve management.


# Raydium AMM

This document describes the output structure for the Raydium AMM decoder functions. The decoder handles four main event types: INITIALIZE2, SWAP, ADD\_LIQUIDITY, and WITHDRAW\_PNL.

### 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`         | Raydium AMM program ID                                           |
| `eventType`       | `string`         | `string`         | Type of event (INITIALIZE2, SWAP, ADD\_LIQUIDITY, WITHDRAW\_PNL) |
| `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                                     |

### INITIALIZE2 Event

AMM pool initialization event.

| Property                 | Type             | JSON Type | Description                      |
| ------------------------ | ---------------- | --------- | -------------------------------- |
| `lpMint`                 | `string`         | `string`  | LP token mint address            |
| `mint`                   | `string`         | `string`  | Pool mint address                |
| `pcMint`                 | `string`         | `string`  | PC (quote) token mint address    |
| `userWallet`             | `string`         | `string`  | User wallet address              |
| `amm`                    | `string`         | `string`  | AMM pool account address         |
| `poolCoinTokenAccount`   | `string`         | `string`  | Pool coin token account          |
| `poolPcTokenAccount`     | `string`         | `string`  | Pool PC token account            |
| `poolWithdrawQueue`      | `string`         | `string`  | Pool withdraw queue account      |
| `ammTargetOrders`        | `string`         | `string`  | AMM target orders account        |
| `poolTempLp`             | `string`         | `string`  | Pool temporary LP account        |
| `nonce`                  | `number`         | `number`  | Pool nonce value                 |
| `openTime`               | `string`         | `string`  | Pool opening timestamp           |
| `initPcAmount`           | `bigint`         | `string`  | Initial PC token amount          |
| `initPcAmountUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted initial PC amount   |
| `initCoinAmount`         | `bigint`         | `string`  | Initial coin token amount        |
| `initCoinAmountUiAmount` | `PreciseDecimal` | `string`  | UI-formatted initial coin amount |

### SWAP Event

Token swap event on Raydium AMM.

| Property                             | Type             | JSON Type | Description                                |
| ------------------------------------ | ---------------- | --------- | ------------------------------------------ |
| `amountIn`                           | `bigint`         | `string`  | Input token amount                         |
| `amountInUiAmount`                   | `PreciseDecimal` | `string`  | UI-formatted input amount                  |
| `amountOut`                          | `bigint`         | `string`  | Output token amount                        |
| `amountOutUiAmount`                  | `PreciseDecimal` | `string`  | UI-formatted output amount                 |
| `minimumAmountOut`                   | `bigint`         | `string`  | Minimum acceptable output amount           |
| `minimumAmountOutUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted minimum output amount         |
| `inputMint`                          | `string`         | `string`  | Input token mint address                   |
| `outputMint`                         | `string`         | `string`  | Output token mint address                  |
| `userSourceTokenAccount`             | `string`         | `string`  | User's source token account                |
| `userDestinationTokenAccount`        | `string`         | `string`  | User's destination token account           |
| `poolCoinTokenAccount`               | `string`         | `string`  | Pool coin token account                    |
| `poolPcTokenAccount`                 | `string`         | `string`  | Pool PC token account                      |
| `pricePre`                           | `PreciseDecimal` | `string`  | Price before swap                          |
| `pricePost`                          | `PreciseDecimal` | `string`  | Price after swap                           |
| `expectedAmountIn`                   | `bigint`         | `string`  | Expected input amount                      |
| `expectedAmountInUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted expected input amount         |
| `expectedAmountOut`                  | `bigint`         | `string`  | Expected output amount                     |
| `expectedAmountOutUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted expected output amount        |
| `slippageTolerance`                  | `number`         | `number`  | Slippage tolerance percentage              |
| `slippagePercentage`                 | `number`         | `number`  | Actual slippage percentage                 |
| `slippageAmount`                     | `bigint`         | `string`  | Slippage amount                            |
| `slippageAmountUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted slippage amount               |
| `actualPrice`                        | `PreciseDecimal` | `string`  | Actual swap price                          |
| `userSourcePreBalance`               | `bigint`         | `string`  | User source balance before swap            |
| `userSourcePreBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted user source pre-balance       |
| `userSourcePostBalance`              | `bigint`         | `string`  | User source balance after swap             |
| `userSourcePostBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted user source post-balance      |
| `userDestinationPreBalance`          | `bigint`         | `string`  | User destination balance before swap       |
| `userDestinationPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user destination pre-balance  |
| `userDestinationPostBalance`         | `bigint`         | `string`  | User destination balance after swap        |
| `userDestinationPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user destination post-balance |
| `poolCoinPreBalance`                 | `bigint`         | `string`  | Pool coin balance before swap              |
| `poolCoinPreBalanceUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted pool coin pre-balance         |
| `poolCoinPostBalance`                | `bigint`         | `string`  | Pool coin balance after swap               |
| `poolCoinPostBalanceUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted pool coin post-balance        |
| `poolPcPreBalance`                   | `bigint`         | `string`  | Pool PC balance before swap                |
| `poolPcPreBalanceUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted pool PC pre-balance           |
| `poolPcPostBalance`                  | `bigint`         | `string`  | Pool PC balance after swap                 |
| `poolPcPostBalanceUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted pool PC post-balance          |

### ADD\_LIQUIDITY Event

Liquidity provision event for Raydium AMM.

| Property                      | Type             | JSON Type | Description                         |
| ----------------------------- | ---------------- | --------- | ----------------------------------- |
| `mint`                        | `string`         | `string`  | Pool mint address                   |
| `maxCoinAmount`               | `bigint`         | `string`  | Maximum coin amount to deposit      |
| `maxCoinAmountUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted max coin amount        |
| `maxPcAmount`                 | `bigint`         | `string`  | Maximum PC amount to deposit        |
| `maxPcAmountUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted max PC amount          |
| `coinAmountIn`                | `bigint`         | `string`  | Actual coin amount deposited        |
| `coinAmountInUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted coin deposit amount    |
| `pcAmountIn`                  | `bigint`         | `string`  | Actual PC amount deposited          |
| `pcAmountInUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted PC deposit amount      |
| `lpTokenAmountOut`            | `bigint`         | `string`  | LP tokens minted                    |
| `lpTokenAmountOutUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted LP tokens minted       |
| `baseSide`                    | `string`         | `string`  | Base side specification             |
| `lpMintAddress`               | `string`         | `string`  | LP token mint address               |
| `poolCoinToken`               | `string`         | `string`  | Pool coin token account             |
| `poolPcToken`                 | `string`         | `string`  | Pool PC token account               |
| `userCoinTokenAccount`        | `string`         | `string`  | User's coin token account           |
| `userPcTokenAccount`          | `string`         | `string`  | User's PC token account             |
| `lpTokenAccount`              | `string`         | `string`  | User's LP token account             |
| `userCoinPreBalance`          | `bigint`         | `string`  | User coin balance before deposit    |
| `userCoinPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user coin pre-balance  |
| `userCoinPostBalance`         | `bigint`         | `string`  | User coin balance after deposit     |
| `userCoinPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user coin post-balance |
| `userPcPreBalance`            | `bigint`         | `string`  | User PC balance before deposit      |
| `userPcPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user PC pre-balance    |
| `userPcPostBalance`           | `bigint`         | `string`  | User PC balance after deposit       |
| `userPcPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user PC post-balance   |
| `userLpPreBalance`            | `bigint`         | `string`  | User LP balance before deposit      |
| `userLpPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted user LP pre-balance    |
| `userLpPostBalance`           | `bigint`         | `string`  | User LP balance after deposit       |
| `userLpPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted user LP post-balance   |
| `poolCoinPreBalance`          | `bigint`         | `string`  | Pool coin balance before deposit    |
| `poolCoinPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted pool coin pre-balance  |
| `poolCoinPostBalance`         | `bigint`         | `string`  | Pool coin balance after deposit     |
| `poolCoinPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted pool coin post-balance |
| `poolPcPreBalance`            | `bigint`         | `string`  | Pool PC balance before deposit      |
| `poolPcPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted pool PC pre-balance    |
| `poolPcPostBalance`           | `bigint`         | `string`  | Pool PC balance after deposit       |
| `poolPcPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted pool PC post-balance   |

### WITHDRAW\_PNL Event

Profit and loss withdrawal event from Serum to AMM pool.

| Property                            | Type             | JSON Type | Description                                |
| ----------------------------------- | ---------------- | --------- | ------------------------------------------ |
| `mint`                              | `string`         | `string`  | Pool mint address                          |
| `coinAmountOut`                     | `bigint`         | `string`  | Coin amount withdrawn                      |
| `coinAmountOutUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted coin withdrawal amount        |
| `pcAmountOut`                       | `bigint`         | `string`  | PC amount withdrawn                        |
| `pcAmountOutUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted PC withdrawal amount          |
| `poolCoinToken`                     | `string`         | `string`  | Pool coin token account                    |
| `poolPcToken`                       | `string`         | `string`  | Pool PC token account                      |
| `coinPnlToken`                      | `string`         | `string`  | Coin PnL token account                     |
| `pcPnlToken`                        | `string`         | `string`  | PC PnL token account                       |
| `serumCoinVault`                    | `string`         | `string`  | Serum coin vault account                   |
| `serumPcVault`                      | `string`         | `string`  | Serum PC vault account                     |
| `poolCoinPreBalance`                | `bigint`         | `string`  | Pool coin balance before withdrawal        |
| `poolCoinPreBalanceUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted pool coin pre-balance         |
| `poolCoinPostBalance`               | `bigint`         | `string`  | Pool coin balance after withdrawal         |
| `poolCoinPostBalanceUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted pool coin post-balance        |
| `poolPcPreBalance`                  | `bigint`         | `string`  | Pool PC balance before withdrawal          |
| `poolPcPreBalanceUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted pool PC pre-balance           |
| `poolPcPostBalance`                 | `bigint`         | `string`  | Pool PC balance after withdrawal           |
| `poolPcPostBalanceUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted pool PC post-balance          |
| `coinPnlPreBalance`                 | `bigint`         | `string`  | Coin PnL balance before withdrawal         |
| `coinPnlPreBalanceUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted coin PnL pre-balance          |
| `coinPnlPostBalance`                | `bigint`         | `string`  | Coin PnL balance after withdrawal          |
| `coinPnlPostBalanceUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted coin PnL post-balance         |
| `pcPnlPreBalance`                   | `bigint`         | `string`  | PC PnL balance before withdrawal           |
| `pcPnlPreBalanceUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted PC PnL pre-balance            |
| `pcPnlPostBalance`                  | `bigint`         | `string`  | PC PnL balance after withdrawal            |
| `pcPnlPostBalanceUiAmount`          | `PreciseDecimal` | `string`  | UI-formatted PC PnL post-balance           |
| `serumCoinVaultPreBalance`          | `bigint`         | `string`  | Serum coin vault balance before withdrawal |
| `serumCoinVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted serum coin vault pre-balance  |
| `serumCoinVaultPostBalance`         | `bigint`         | `string`  | Serum coin vault balance after withdrawal  |
| `serumCoinVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted serum coin vault post-balance |
| `serumPcVaultPreBalance`            | `bigint`         | `string`  | Serum PC vault balance before withdrawal   |
| `serumPcVaultPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted serum PC vault pre-balance    |
| `serumPcVaultPostBalance`           | `bigint`         | `string`  | Serum PC vault balance after withdrawal    |
| `serumPcVaultPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted serum PC vault post-balance   |

### Data Types

* `bigint`: Large integer values for token amounts
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for percentages, nonces, and timestamps
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (RAYDIUM\_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. The AMM decoder handles both coin and PC (quote) tokens with comprehensive balance tracking.


# Raydium CLMM

This document describes the output structure for the Raydium CLMM (Concentrated Liquidity Market Maker) decoder functions. The decoder handles five main event types: CREATE\_POOL, SWAP, INCREASE\_LIQUIDITY\_V2, DECREASE\_LIQUIDITY\_V2, and OPEN\_POSITION\_TOKEN\_22\_NFT.

### 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`         | Raydium CLMM program ID                                                                                              |
| `eventType`       | `string`         | `string`         | Type of event (CREATE\_POOL, SWAP, INCREASE\_LIQUIDITY\_V2, DECREASE\_LIQUIDITY\_V2, OPEN\_POSITION\_TOKEN\_22\_NFT) |
| `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

Concentrated liquidity pool creation event.

| Property       | Type     | JSON Type | Description                     |
| -------------- | -------- | --------- | ------------------------------- |
| `mint`         | `string` | `string`  | Pool mint address               |
| `token0Mint`   | `string` | `string`  | Token0 mint address             |
| `token0Vault`  | `string` | `string`  | Token0 vault address            |
| `token1Vault`  | `string` | `string`  | Token1 vault address            |
| `sqrtPriceX64` | `bigint` | `string`  | Square root price in X64 format |
| `openTime`     | `string` | `string`  | Pool opening timestamp          |

### SWAP Event

Token swap event in concentrated liquidity pool.

| Property                         | Type             | JSON Type | Description                            |
| -------------------------------- | ---------------- | --------- | -------------------------------------- |
| `amountIn`                       | `bigint`         | `string`  | Input token amount                     |
| `amountInUiAmount`               | `PreciseDecimal` | `string`  | UI-formatted input amount              |
| `amountOut`                      | `bigint`         | `string`  | Output token amount                    |
| `amountOutUiAmount`              | `PreciseDecimal` | `string`  | UI-formatted output amount             |
| `otherAmountThreshold`           | `bigint`         | `string`  | Amount threshold for the other token   |
| `otherAmountThresholdUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted amount threshold          |
| `sqrtPriceLimitX64`              | `bigint`         | `string`  | Square root price limit in X64 format  |
| `isBaseInput`                    | `boolean`        | `boolean` | Whether the base token is the input    |
| `inputMint`                      | `string`         | `string`  | Input token mint address               |
| `outputMint`                     | `string`         | `string`  | Output token mint address              |
| `inputTokenAccount`              | `string`         | `string`  | Input token account address            |
| `outputTokenAccount`             | `string`         | `string`  | Output token account address           |
| `inputVault`                     | `string`         | `string`  | Input vault address                    |
| `outputVault`                    | `string`         | `string`  | Output vault address                   |
| `pricePre`                       | `PreciseDecimal` | `string`  | Price before swap                      |
| `pricePost`                      | `PreciseDecimal` | `string`  | Price after swap                       |
| `slippageTolerance`              | `number`         | `number`  | Slippage tolerance percentage          |
| `slippagePercentage`             | `number`         | `number`  | Actual slippage percentage             |
| `slippageAmount`                 | `bigint`         | `string`  | Slippage amount                        |
| `slippageAmountUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted slippage amount           |
| `inputTokenPreBalance`           | `bigint`         | `string`  | Input token balance before swap        |
| `inputTokenPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted input token pre-balance   |
| `inputTokenPostBalance`          | `bigint`         | `string`  | Input token balance after swap         |
| `inputTokenPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted input token post-balance  |
| `outputTokenPreBalance`          | `bigint`         | `string`  | Output token balance before swap       |
| `outputTokenPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted output token pre-balance  |
| `outputTokenPostBalance`         | `bigint`         | `string`  | Output token balance after swap        |
| `outputTokenPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted output token post-balance |
| `inputVaultPreBalance`           | `bigint`         | `string`  | Input vault balance before swap        |
| `inputVaultPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted input vault pre-balance   |
| `inputVaultPostBalance`          | `bigint`         | `string`  | Input vault balance after swap         |
| `inputVaultPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted input vault post-balance  |
| `outputVaultPreBalance`          | `bigint`         | `string`  | Output vault balance before swap       |
| `outputVaultPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted output vault pre-balance  |
| `outputVaultPostBalance`         | `bigint`         | `string`  | Output vault balance after swap        |
| `outputVaultPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted output vault post-balance |

### INCREASE\_LIQUIDITY\_V2 Event

Liquidity addition event for existing positions.

| Property                         | Type             | JSON Type | Description                        |
| -------------------------------- | ---------------- | --------- | ---------------------------------- |
| `mint0`                          | `string`         | `string`  | Token0 mint address                |
| `mint1`                          | `string`         | `string`  | Token1 mint address                |
| `amountDeposited0`               | `bigint`         | `string`  | Amount of token0 deposited         |
| `amountDeposited0UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token0 deposit amount |
| `amountDeposited1`               | `bigint`         | `string`  | Amount of token1 deposited         |
| `amountDeposited1UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token1 deposit amount |
| `liquidity`                      | `bigint`         | `string`  | Liquidity amount added             |
| `amount0Max`                     | `bigint`         | `string`  | Maximum token0 amount              |
| `amount0MaxUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted max token0 amount     |
| `amount1Max`                     | `bigint`         | `string`  | Maximum token1 amount              |
| `amount1MaxUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted max token1 amount     |
| `postTokenBalance0`              | `bigint`         | `string`  | Token0 balance after deposit       |
| `postTokenBalance0UiAmount`      | `PreciseDecimal` | `string`  | UI-formatted token0 post-balance   |
| `postTokenBalance1`              | `bigint`         | `string`  | Token1 balance after deposit       |
| `postTokenBalance1UiAmount`      | `PreciseDecimal` | `string`  | UI-formatted token1 post-balance   |
| `preTokenBalance0`               | `bigint`         | `string`  | Token0 balance before deposit      |
| `preTokenBalance0UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token0 pre-balance    |
| `preTokenBalance1`               | `bigint`         | `string`  | Token1 balance before deposit      |
| `preTokenBalance1UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token1 pre-balance    |
| `tokenVault0PostBalance`         | `bigint`         | `string`  | Vault0 balance after deposit       |
| `tokenVault0PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted vault0 post-balance   |
| `tokenVault1PostBalance`         | `bigint`         | `string`  | Vault1 balance after deposit       |
| `tokenVault1PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted vault1 post-balance   |
| `tokenVault0PreBalance`          | `bigint`         | `string`  | Vault0 balance before deposit      |
| `tokenVault0PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted vault0 pre-balance    |
| `tokenVault1PreBalance`          | `bigint`         | `string`  | Vault1 balance before deposit      |
| `tokenVault1PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted vault1 pre-balance    |
| `protocolPosition`               | `string`         | `string`  | Protocol position account          |
| `personalPosition`               | `string`         | `string`  | Personal position account          |
| `tickArrayLower`                 | `string`         | `string`  | Lower tick array account           |
| `tickArrayUpper`                 | `string`         | `string`  | Upper tick array account           |
| `tokenAccount0`                  | `string`         | `string`  | Token0 account address             |
| `tokenAccount1`                  | `string`         | `string`  | Token1 account address             |
| `tokenVault0`                    | `string`         | `string`  | Token0 vault address               |
| `tokenVault1`                    | `string`         | `string`  | Token1 vault address               |

### DECREASE\_LIQUIDITY\_V2 Event

Liquidity removal event from existing positions.

| Property                         | Type             | JSON Type | Description                           |
| -------------------------------- | ---------------- | --------- | ------------------------------------- |
| `mint0`                          | `string`         | `string`  | Token0 mint address                   |
| `mint1`                          | `string`         | `string`  | Token1 mint address                   |
| `protocolPosition`               | `string`         | `string`  | Protocol position account             |
| `personalPosition`               | `string`         | `string`  | Personal position account             |
| `tickArrayLower`                 | `string`         | `string`  | Lower tick array account              |
| `tickArrayUpper`                 | `string`         | `string`  | Upper tick array account              |
| `recipientTokenAccount0`         | `string`         | `string`  | Recipient token0 account              |
| `recipientTokenAccount1`         | `string`         | `string`  | Recipient token1 account              |
| `tokenVault0`                    | `string`         | `string`  | Token0 vault address                  |
| `tokenVault1`                    | `string`         | `string`  | Token1 vault address                  |
| `liquidity`                      | `bigint`         | `string`  | Liquidity amount removed              |
| `amount0Min`                     | `bigint`         | `string`  | Minimum token0 amount                 |
| `amount0MinUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted min token0 amount        |
| `amount1Min`                     | `bigint`         | `string`  | Minimum token1 amount                 |
| `amount1MinUiAmount`             | `PreciseDecimal` | `string`  | UI-formatted min token1 amount        |
| `amountWithdrawn0`               | `bigint`         | `string`  | Amount of token0 withdrawn            |
| `amountWithdrawn0UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token0 withdrawal amount |
| `amountWithdrawn1`               | `bigint`         | `string`  | Amount of token1 withdrawn            |
| `amountWithdrawn1UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token1 withdrawal amount |
| `postTokenBalance0`              | `bigint`         | `string`  | Token0 balance after withdrawal       |
| `postTokenBalance0UiAmount`      | `PreciseDecimal` | `string`  | UI-formatted token0 post-balance      |
| `postTokenBalance1`              | `bigint`         | `string`  | Token1 balance after withdrawal       |
| `postTokenBalance1UiAmount`      | `PreciseDecimal` | `string`  | UI-formatted token1 post-balance      |
| `preTokenBalance0`               | `bigint`         | `string`  | Token0 balance before withdrawal      |
| `preTokenBalance0UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token0 pre-balance       |
| `preTokenBalance1`               | `bigint`         | `string`  | Token1 balance before withdrawal      |
| `preTokenBalance1UiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token1 pre-balance       |
| `tokenVault0PostBalance`         | `bigint`         | `string`  | Vault0 balance after withdrawal       |
| `tokenVault0PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted vault0 post-balance      |
| `tokenVault1PostBalance`         | `bigint`         | `string`  | Vault1 balance after withdrawal       |
| `tokenVault1PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted vault1 post-balance      |
| `tokenVault0PreBalance`          | `bigint`         | `string`  | Vault0 balance before withdrawal      |
| `tokenVault0PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted vault0 pre-balance       |
| `tokenVault1PreBalance`          | `bigint`         | `string`  | Vault1 balance before withdrawal      |
| `tokenVault1PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted vault1 pre-balance       |

### OPEN\_POSITION\_TOKEN\_22\_NFT Event

New position opening event with Token-22 NFT.

| Property                   | Type             | JSON Type | Description                       |
| -------------------------- | ---------------- | --------- | --------------------------------- |
| `positionNftAccount`       | `string`         | `string`  | Position NFT account address      |
| `tokenAccount0`            | `string`         | `string`  | Token0 account address            |
| `tokenAccount1`            | `string`         | `string`  | Token1 account address            |
| `tokenVault0`              | `string`         | `string`  | Token0 vault address              |
| `tokenVault1`              | `string`         | `string`  | Token1 vault address              |
| `token0Balance`            | `bigint`         | `string`  | Token0 balance                    |
| `token1Balance`            | `bigint`         | `string`  | Token1 balance                    |
| `token0BalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token0 balance       |
| `token1BalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted token1 balance       |
| `tickLowerIndex`           | `number`         | `number`  | Lower tick index for the position |
| `tickUpperIndex`           | `number`         | `number`  | Upper tick index for the position |
| `tickArrayLowerStartIndex` | `number`         | `number`  | Lower tick array start index      |
| `tickArrayUpperStartIndex` | `number`         | `number`  | Upper tick array start index      |
| `liquidity`                | `bigint`         | `string`  | Initial liquidity amount          |
| `amount0Max`               | `bigint`         | `string`  | Maximum token0 amount             |
| `amount1Max`               | `bigint`         | `string`  | Maximum token1 amount             |
| `amount0MaxUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted max token0 amount    |
| `amount1MaxUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted max token1 amount    |
| `mint0`                    | `string`         | `string`  | Token0 mint address               |
| `mint1`                    | `string`         | `string`  | Token1 mint address               |

### Data Types

* `bigint`: Large integer values for token amounts and liquidity
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for tick indices and timestamps
* `boolean`: True/false values for input type indicators
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (RAYDIUM\_CLMM)

### 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. The CLMM decoder handles concentrated liquidity positions with tick-based pricing and NFT-based position management.


# Raydium CPMM

This document describes the output structure for the Raydium CPMM decoder functions. The decoder handles four main event types: INITIALIZE, SWAP\_BASE\_INPUT, DEPOSIT, and WITHDRAW.

### 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`         | Raydium CPMM program ID                                          |
| `eventType`       | `string`         | `string`         | Type of event (INITIALIZE, SWAP\_BASE\_INPUT, 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                                     |

### INITIALIZE Event

Pool initialization event for Raydium CPMM.

| Property              | Type             | JSON Type | Description                        |
| --------------------- | ---------------- | --------- | ---------------------------------- |
| `mint`                | `string`         | `string`  | Pool mint address                  |
| `token0Mint`          | `string`         | `string`  | Token0 mint address                |
| `lpMint`              | `string`         | `string`  | LP token mint address              |
| `creatorToken0`       | `string`         | `string`  | Creator's token0 account           |
| `creatorToken1`       | `string`         | `string`  | Creator's token1 account           |
| `creatorLpToken`      | `string`         | `string`  | Creator's LP token account         |
| `token0Vault`         | `string`         | `string`  | Token0 vault address               |
| `token1Vault`         | `string`         | `string`  | Token1 vault address               |
| `initAmount0`         | `bigint`         | `string`  | Initial amount of token0           |
| `initAmount0UiAmount` | `PreciseDecimal` | `string`  | UI-formatted initial token0 amount |
| `initAmount1`         | `bigint`         | `string`  | Initial amount of token1           |
| `initAmount1UiAmount` | `PreciseDecimal` | `string`  | UI-formatted initial token1 amount |
| `openTime`            | `string`         | `string`  | Pool opening timestamp             |

### SWAP\_BASE\_INPUT Event

Token swap event in Raydium CPMM pool.

| Property                           | Type             | JSON Type | Description                              |
| ---------------------------------- | ---------------- | --------- | ---------------------------------------- |
| `amountIn`                         | `bigint`         | `string`  | Input token amount                       |
| `amountInUiAmount`                 | `PreciseDecimal` | `string`  | UI-formatted input amount                |
| `amountOut`                        | `bigint`         | `string`  | Output token amount                      |
| `amountOutUiAmount`                | `PreciseDecimal` | `string`  | UI-formatted output amount               |
| `minimumAmountOut`                 | `bigint`         | `string`  | Minimum acceptable output amount         |
| `minimumAmountOutUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted minimum output amount       |
| `inputMint`                        | `string`         | `string`  | Input token mint address                 |
| `outputMint`                       | `string`         | `string`  | Output token mint address                |
| `inputVault`                       | `string`         | `string`  | Input vault address                      |
| `outputVault`                      | `string`         | `string`  | Output vault address                     |
| `pricePre`                         | `PreciseDecimal` | `string`  | Price before swap                        |
| `pricePost`                        | `PreciseDecimal` | `string`  | Price after swap                         |
| `actualPrice`                      | `PreciseDecimal` | `string`  | Actual swap price                        |
| `expectedAmountIn`                 | `PreciseDecimal` | `string`  | Expected input amount                    |
| `slippagePercentage`               | `number`         | `number`  | Actual slippage percentage               |
| `slippageTolerance`                | `number`         | `number`  | Slippage tolerance percentage            |
| `slippageAmount`                   | `bigint`         | `string`  | Slippage amount                          |
| `slippageAmountUiAmount`           | `PreciseDecimal` | `string`  | UI-formatted slippage amount             |
| `inputVaultPreBalance`             | `bigint`         | `string`  | Input vault balance before swap          |
| `inputVaultPreBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted input vault pre-balance     |
| `inputVaultPostBalance`            | `bigint`         | `string`  | Input vault balance after swap           |
| `inputVaultPostBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted input vault post-balance    |
| `outputVaultPreBalance`            | `bigint`         | `string`  | Output vault balance before swap         |
| `outputVaultPreBalanceUiAmount`    | `PreciseDecimal` | `string`  | UI-formatted output vault pre-balance    |
| `outputVaultPostBalance`           | `bigint`         | `string`  | Output vault balance after swap          |
| `outputVaultPostBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted output vault post-balance   |
| `inputAccountPostBalance`          | `bigint`         | `string`  | Input account balance after swap         |
| `inputAccountPostBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted input account post-balance  |
| `inputAccountPreBalance`           | `bigint`         | `string`  | Input account balance before swap        |
| `inputAccountPreBalanceUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted input account pre-balance   |
| `outputAccountPostBalance`         | `bigint`         | `string`  | Output account balance after swap        |
| `outputAccountPostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted output account post-balance |
| `outputAccountPreBalance`          | `bigint`         | `string`  | Output account balance before swap       |
| `outputAccountPreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted output account pre-balance  |

### DEPOSIT Event

Liquidity deposit event for Raydium CPMM.

| Property                        | Type             | JSON Type | Description                           |
| ------------------------------- | ---------------- | --------- | ------------------------------------- |
| `lpTokenAmount`                 | `bigint`         | `string`  | LP token amount minted                |
| `lpTokenAmountUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted LP token amount          |
| `maximumToken0Amount`           | `bigint`         | `string`  | Maximum token0 amount to deposit      |
| `maximumToken0AmountUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted maximum token0 amount    |
| `maximumToken1Amount`           | `bigint`         | `string`  | Maximum token1 amount to deposit      |
| `maximumToken1AmountUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted maximum token1 amount    |
| `token0AmountIn`                | `bigint`         | `string`  | Actual token0 amount deposited        |
| `token0AmountInUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted token0 deposit amount    |
| `token1AmountIn`                | `bigint`         | `string`  | Actual token1 amount deposited        |
| `token1AmountInUiAmount`        | `PreciseDecimal` | `string`  | UI-formatted token1 deposit amount    |
| `vault0Mint`                    | `string`         | `string`  | Vault0 mint address                   |
| `vault1Mint`                    | `string`         | `string`  | Vault1 mint address                   |
| `token0Account`                 | `string`         | `string`  | User's token0 account                 |
| `token1Account`                 | `string`         | `string`  | User's token1 account                 |
| `token0Vault`                   | `string`         | `string`  | Token0 vault address                  |
| `token1Vault`                   | `string`         | `string`  | Token1 vault address                  |
| `lpMint`                        | `string`         | `string`  | LP token mint address                 |
| `userToken0PreBalance`          | `bigint`         | `string`  | User token0 balance before deposit    |
| `userToken0PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token0 pre-balance  |
| `userToken0PostBalance`         | `bigint`         | `string`  | User token0 balance after deposit     |
| `userToken0PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token0 post-balance |
| `userToken1PreBalance`          | `bigint`         | `string`  | User token1 balance before deposit    |
| `userToken1PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token1 pre-balance  |
| `userToken1PostBalance`         | `bigint`         | `string`  | User token1 balance after deposit     |
| `userToken1PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token1 post-balance |
| `userLpPreBalance`              | `bigint`         | `string`  | User LP balance before deposit        |
| `userLpPreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted user LP pre-balance      |
| `userLpPostBalance`             | `bigint`         | `string`  | User LP balance after deposit         |
| `userLpPostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted user LP post-balance     |
| `vault0PreBalance`              | `bigint`         | `string`  | Vault0 balance before deposit         |
| `vault0PreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted vault0 pre-balance       |
| `vault0PostBalance`             | `bigint`         | `string`  | Vault0 balance after deposit          |
| `vault0PostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted vault0 post-balance      |
| `vault1PreBalance`              | `bigint`         | `string`  | Vault1 balance before deposit         |
| `vault1PreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted vault1 pre-balance       |
| `vault1PostBalance`             | `bigint`         | `string`  | Vault1 balance after deposit          |
| `vault1PostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted vault1 post-balance      |

### WITHDRAW Event

Liquidity withdrawal event for Raydium CPMM.

| Property                        | Type             | JSON Type | Description                           |
| ------------------------------- | ---------------- | --------- | ------------------------------------- |
| `lpTokenAmount`                 | `bigint`         | `string`  | LP token amount burned                |
| `lpTokenAmountUiAmount`         | `PreciseDecimal` | `string`  | UI-formatted LP token amount          |
| `minimumToken0Amount`           | `bigint`         | `string`  | Minimum token0 amount to receive      |
| `minimumToken0AmountUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted minimum token0 amount    |
| `minimumToken1Amount`           | `bigint`         | `string`  | Minimum token1 amount to receive      |
| `minimumToken1AmountUiAmount`   | `PreciseDecimal` | `string`  | UI-formatted minimum token1 amount    |
| `token0AmountOut`               | `bigint`         | `string`  | Actual token0 amount withdrawn        |
| `token0AmountOutUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token0 withdrawal amount |
| `token1AmountOut`               | `bigint`         | `string`  | Actual token1 amount withdrawn        |
| `token1AmountOutUiAmount`       | `PreciseDecimal` | `string`  | UI-formatted token1 withdrawal amount |
| `vault0Mint`                    | `string`         | `string`  | Vault0 mint address                   |
| `vault1Mint`                    | `string`         | `string`  | Vault1 mint address                   |
| `token0Account`                 | `string`         | `string`  | User's token0 account                 |
| `token1Account`                 | `string`         | `string`  | User's token1 account                 |
| `token0Vault`                   | `string`         | `string`  | Token0 vault address                  |
| `token1Vault`                   | `string`         | `string`  | Token1 vault address                  |
| `lpMint`                        | `string`         | `string`  | LP token mint address                 |
| `userToken0PreBalance`          | `bigint`         | `string`  | User token0 balance before withdrawal |
| `userToken0PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token0 pre-balance  |
| `userToken0PostBalance`         | `bigint`         | `string`  | User token0 balance after withdrawal  |
| `userToken0PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token0 post-balance |
| `userToken1PreBalance`          | `bigint`         | `string`  | User token1 balance before withdrawal |
| `userToken1PreBalanceUiAmount`  | `PreciseDecimal` | `string`  | UI-formatted user token1 pre-balance  |
| `userToken1PostBalance`         | `bigint`         | `string`  | User token1 balance after withdrawal  |
| `userToken1PostBalanceUiAmount` | `PreciseDecimal` | `string`  | UI-formatted user token1 post-balance |
| `userLpPreBalance`              | `bigint`         | `string`  | User LP balance before withdrawal     |
| `userLpPreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted user LP pre-balance      |
| `userLpPostBalance`             | `bigint`         | `string`  | User LP balance after withdrawal      |
| `userLpPostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted user LP post-balance     |
| `vault0PreBalance`              | `bigint`         | `string`  | Vault0 balance before withdrawal      |
| `vault0PreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted vault0 pre-balance       |
| `vault0PostBalance`             | `bigint`         | `string`  | Vault0 balance after withdrawal       |
| `vault0PostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted vault0 post-balance      |
| `vault1PreBalance`              | `bigint`         | `string`  | Vault1 balance before withdrawal      |
| `vault1PreBalanceUiAmount`      | `PreciseDecimal` | `string`  | UI-formatted vault1 pre-balance       |
| `vault1PostBalance`             | `bigint`         | `string`  | Vault1 balance after withdrawal       |
| `vault1PostBalanceUiAmount`     | `PreciseDecimal` | `string`  | UI-formatted vault1 post-balance      |

### Data Types

* `bigint`: Large integer values for token amounts
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for percentages and timestamps
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (RAYDIUM\_CPMM)

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


# SPL Token Transfers

This document describes the output structure for the SPL Token decoder functions. The decoder handles five main event types: TRANSFER, MINT, BURN, INITIALIZE\_ACCOUNT, and CLOSE\_ACCOUNT.

### 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`         | SPL Token program ID                                                      |
| `eventType`       | `string`         | `string`         | Type of event (TRANSFER, MINT, BURN, INITIALIZE\_ACCOUNT, CLOSE\_ACCOUNT) |
| `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                                              |

### TRANSFER Event

Token transfer event between accounts.

| Property                  | Type             | JSON Type | Description                                  |
| ------------------------- | ---------------- | --------- | -------------------------------------------- |
| `sourceAccount`           | `string`         | `string`  | Source token account address                 |
| `sourceOwner`             | `string`         | `string`  | Owner of the source account                  |
| `destinationAccount`      | `string`         | `string`  | Destination token account address            |
| `destinationOwner`        | `string`         | `string`  | Owner of the destination account             |
| `mint`                    | `string`         | `string`  | Token mint address                           |
| `amount`                  | `bigint`         | `string`  | Transfer amount in raw units                 |
| `uiAmount`                | `PreciseDecimal` | `string`  | UI-formatted transfer amount                 |
| `sourcePreUiAmount`       | `PreciseDecimal` | `string`  | Source account balance before transfer       |
| `sourcePreAmount`         | `bigint`         | `string`  | Source account balance before transfer (raw) |
| `sourcePostUiAmount`      | `PreciseDecimal` | `string`  | Source account balance after transfer        |
| `sourcePostAmount`        | `bigint`         | `string`  | Source account balance after transfer (raw)  |
| `destinationPreUiAmount`  | `PreciseDecimal` | `string`  | Destination balance before transfer          |
| `destinationPreAmount`    | `bigint`         | `string`  | Destination balance before transfer (raw)    |
| `destinationPostUiAmount` | `PreciseDecimal` | `string`  | Destination balance after transfer           |
| `destinationPostAmount`   | `bigint`         | `string`  | Destination balance after transfer (raw)     |

### MINT Event

Token minting event where new tokens are created.

| Property                  | Type             | JSON Type | Description                              |
| ------------------------- | ---------------- | --------- | ---------------------------------------- |
| `mint`                    | `string`         | `string`  | Token mint address                       |
| `destinationAccount`      | `string`         | `string`  | Account receiving minted tokens          |
| `destinationOwner`        | `string`         | `string`  | Owner of the destination account         |
| `amount`                  | `bigint`         | `string`  | Amount of tokens minted (raw)            |
| `uiAmount`                | `PreciseDecimal` | `string`  | UI-formatted minted amount               |
| `destinationPreUiAmount`  | `PreciseDecimal` | `string`  | Destination balance before minting       |
| `destinationPreAmount`    | `bigint`         | `string`  | Destination balance before minting (raw) |
| `destinationPostUiAmount` | `PreciseDecimal` | `string`  | Destination balance after minting        |
| `destinationPostAmount`   | `bigint`         | `string`  | Destination balance after minting (raw)  |

### BURN Event

Token burning event where tokens are destroyed.

| Property             | Type             | JSON Type | Description                                 |
| -------------------- | ---------------- | --------- | ------------------------------------------- |
| `mint`               | `string`         | `string`  | Token mint address                          |
| `sourceAccount`      | `string`         | `string`  | Account from which tokens are burned        |
| `sourceOwner`        | `string`         | `string`  | Owner of the source account                 |
| `amount`             | `bigint`         | `string`  | Amount of tokens burned (raw)               |
| `uiAmount`           | `PreciseDecimal` | `string`  | UI-formatted burned amount                  |
| `sourcePreUiAmount`  | `PreciseDecimal` | `string`  | Source account balance before burning       |
| `sourcePreAmount`    | `bigint`         | `string`  | Source account balance before burning (raw) |
| `sourcePostUiAmount` | `PreciseDecimal` | `string`  | Source account balance after burning        |
| `sourcePostAmount`   | `bigint`         | `string`  | Source account balance after burning (raw)  |

### INITIALIZE\_ACCOUNT Event

Token account initialization event.

| Property  | Type     | JSON Type | Description                       |
| --------- | -------- | --------- | --------------------------------- |
| `mint`    | `string` | `string`  | Token mint address                |
| `account` | `string` | `string`  | Newly initialized account address |
| `owner`   | `string` | `string`  | Owner of the initialized account  |

### CLOSE\_ACCOUNT Event

Token account closure event.

| Property      | Type     | JSON Type | Description                       |
| ------------- | -------- | --------- | --------------------------------- |
| `mint`        | `string` | `string`  | Token mint address                |
| `account`     | `string` | `string`  | Account being closed              |
| `destination` | `string` | `string`  | Account receiving remaining SOL   |
| `owner`       | `string` | `string`  | Owner of the account being closed |

### Data Types

* `bigint`: Large integer values for token amounts
* `string`: Text values for addresses and identifiers
* `number`: Numeric values for timestamps
* `PreciseDecimal`: High-precision decimal representation for UI display
* `DecoderType`: Enum indicating the decoder type (SPL\_TOKEN)

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


# Contextualized Data

Aggregations are how LYS transforms decoded blockchain data into intelligent insights.Once raw blockchain data is parsed by our decoders, we immediately begin tracking structured metrics - both in real-time and across historical timeframes. These aggregated views power trading strategies, research dashboards, alerts, and AI agents.

### Why aggregations matter

* Raw data tells you what happened.
* Decoders tell you what kind of event it was.
* Aggregations tell you what it means.

\
For example:

* A swap by a whale on Raydium becomes a price spike alert if it's the largest transaction in the last 5 minutes.

{% hint style="info" %}
Aggregations make the data *actionable*.
{% endhint %}

### Two types of aggregations

| **Type**   | **Description**                                                     |
| ---------- | ------------------------------------------------------------------- |
| Real-Time  | Computed live as new events stream in - for alerts, agents, bots    |
| Historical | Computed across stored data - for research, backtesting, dashboards |


# Real-time aggregations

Real-time aggregations are calculated on every new block, enabling decision-making within milliseconds. These are designed for HFT, alerts, and automated execution.

## **Common Strategies Built on Real-Time Aggregations**

**Strategy 1: ATH Breakout**

* Check if token is legit
* Check if price < last ATH
* If price breaks ATH → buy
* Add a trailing stop-loss for exit

\
**Strategy 2: Volume Spike Momentum**

* Token legitimacy check
* Look for large volume spike
* Check price above 15-min MA
* If 2 & 3 are met → buy
* Exit via dynamic stop-loss
* Technical indicators like MAs can be derived using live moving windows.

### **Real-Time metrics we provide**

| **Metric**             | Description                                                  |
| ---------------------- | ------------------------------------------------------------ |
| Price Spike            | Token's current price > recent average or local maximum      |
| ATH                    | Detect all-time high + price value match                     |
| Local ATH              | Rolling peak over user-defined block count (e.g., 10 blocks) |
| Volume (X/Y/Z)         | Volume (count & value) across 1m, 5m, 15m sliding windows    |
| Volume Spike           | Detect sudden jump from rolling average                      |
| Buy/Sell Ratio         | % buy/sell count or volume per token/window                  |
| Dev Pre-Sell Detection | Tracks buys & sells prior to known dev wallet exit           |


# WebSocket API Reference

Real-time streaming data for Solana transactions and aggregated statistics with low latency and high throughput.

### Connection Details

* **WebSocket URL:**  `wss://ws.aggregations.dev.lys.network/realtime-aggregations`
* **Protocol:** WebSocket (WSS for production)
* **Authentication:** API Key via query parameter

### Message Types

<details>

<summary><strong>Token Stats Message</strong></summary>

```json
{
  "mintId": "BjQxXBh6Pb8xDcSbgMuQdDDBNWoMVgvKrcVApmr9pump",
  "priceData": {
    "ath": 2.88073409323e-7,
    "localAtl": 2.85307023377e-7,
    "newAthCost": 0.31729594175378395
  },
  "volumeData": {
    "buyCount": 924,
    "sellCount": 24,
    "buyVolume": 67.38738413300003,
    "sellVolume": 1.407831243,
    "proTraderBuyCount": 20
  },
  "holderData": {
    "tokensInCirculation": 737616064.5657842,
    "totalHolders": 243,
    "activeHolders": 222,
    "maxActiveHolders": 223,
    "holdingPercentageForTopHoldersOneToTen": 99.40211845200551,
    "holdingPercentageForTopHoldersElevenToTwenty": 0.047230851053880425,
    "holdingPercentageForTopHoldersTwentyOneToThirty": 0.024508142834847046,
    "userHoldings": {
      "92s2ArkTSEDS8pz7fFdtbDCUQLrWMLqiUtnnVStgSUbv": {
        "balance": 373217391.3063863,
        "percentage": 50.59778511278626
      },
      "DwUx8j18bNzg7ERztamfoi6uTZEuNWwcJGYreYnuTecc": {
        "balance": 180589060.3105943,
        "percentage": 24.48279924826508
      },
      "HfVCGNKwGdcPu23P2kUaF6rJPJsfsWaMQEdquN1MY6SQ": {
        "balance": 106501240.69682828,
        "percentage": 14.438573915756953
      },
      "6hwT8rdKBcaJEGZvzArpSwaPRQjm5FLnqGoxkvb5K18p": {
        "balance": 70245499.18370828,
        "percentage": 9.523314710486956
      },
      "6xAUgHJSDBb9oDRTekdj3rPbHCHu8Z5i9jTzK8wi4unE": {
        "balance": 901304.57845128,
        "percentage": 0.12219156031828768
      },
      "7R9UKwY8XuSZ7nVDbnU6ZWbE5EZpw2ozWcA27JxS483h": {
        "balance": 687934.16952128,
        "percentage": 0.09326453185726769
      },
      "CKnkMFkFbuMq6h99oGWKjA1oigC272rrXgJRDqvGuyPg": {
        "balance": 417602.260193,
        "percentage": 0.056615125436405976
      },
      "Bb9ofDdkcaUZErNpcATcf1mDSQZC4uSeQq2GCNaGP8rR": {
        "balance": 348450.053133,
        "percentage": 0.04724003039957158
      },
      "9wrruPKnsjpQDwfxBkCBJ1Z2aviTK49avUaWThwt61Nt": {
        "balance": 187711.76769928,
        "percentage": 0.025448438112554005
      },
      "G8nEHkvYKe2fYaPaazhJBRGzs2w4CMTFLUwumwFdDqV8": {
        "balance": 109799.89418728,
        "percentage": 0.014885778586169542
      },
      "CMkaCp2HfEX9beaHcrnhSgD2zR5kijifiyE3mZxey6sg": {
        "balance": 92020.16685028,
        "percentage": 0.012475347443042734
      },
      "2gbM1QuSGdUoRCAD8Ede8cWp9hptXYNyXE9anCirtDdM": {
        "balance": 75245.382147,
        "percentage": 0.010201158266705463
      },
      "DecAu4W1bud8d1fmNwDshPnZfFApYgFEVfbNz5egWA54": {
        "balance": 37646.80343928,
        "percentage": 0.005103848092224199
      },
      "a2DnvESKyWintb12mP5aD3UfKxTTiLPUhJjSxsNq531": {
        "balance": 23597.914976,
        "percentage": 0.0031992138064253646
      },
      "2cPDGiioQL5HUhpSnP8qSxGH64jwCwFgdvnQ9LjWUJgM": {
        "balance": 22827.754564,
        "percentage": 0.003094801707909943
      },
      "FvfztYwxgw5oPuGybsqhJTBafS6hZvtbm5SSFna7YdkH": {
        "balance": 19646.785449,
        "percentage": 0.0026635517300678045
      },
      "ETC78Vtk8whvNAEmGbg5epBKhSPFbwYmLdK2koNDh4xi": {
        "balance": 19644.389831,
        "percentage": 0.0026632269516207122
      },
      "4RXfSVobJ914hV2yNvQPNLDqL75Z6V6SBav2zAbCGtjv": {
        "balance": 19557.577888,
        "percentage": 0.0026514576929005805
      },
      "UZ7Dg6zCdoXJzG3i7scT38GkJbuihD4K9m1M1bFuDfv": {
        "balance": 19225.195911,
        "percentage": 0.0026063960418645955
      },
      "6RToFbaooLWGeJuLFzEyq6XXMMzUiqovZJsSjb5T84PM": {
        "balance": 18970.373749,
        "percentage": 0.002571849321119026
      },
      "H7tdTftstPoNnU6tujskqw1vvsE6wZkcXZcVKGJ3N1Q9": {
        "balance": 18809.643922,
        "percentage": 0.002550058875557809
      },
      "3Y79TNo4ZAQAcGTZFMrkvaA82KcrQQdqM7Xz4mmVmoqi": {
        "balance": 18676.678551,
        "percentage": 0.002532032509621992
      },
      "DjRdzDrMTH88vUYJRwZaLeMG8c7xvAuktyBWxtftPi9g": {
        "balance": 18653.428153,
        "percentage": 0.002528880409346941
      },
      "8LZrPE3bkZGyQcKcJ7vPCUC6jSnsZ3GdAz9RsSGD5Yv2": {
        "balance": 18616.256146,
        "percentage": 0.0025238409303028012
      },
      "neZ2C8479THxjcvJZ1SkXD2u9oumRCAj9HK6nJaWDoU": {
        "balance": 18583.855594,
        "percentage": 0.0025194483264053967
      },
      "Cp5eV9mMkwPkoFtS7uLpa6gybrPBaFFkVPDKZqEwpWx6": {
        "balance": 18390.768186,
        "percentage": 0.0024932711026062287
      },
      "EK9rXpTtLKmQMA6qkptpGMLkVW5fB9yqTQNoCDKDn1Jb": {
        "balance": 18372.397394,
        "percentage": 0.002490780539712806
      },
      "4fVQDXM5F1okvt7nk51WefH8319j8XQo5H7PW3jr3XRE": {
        "balance": 18002.34699528,
        "percentage": 0.0024406121097535374
      },
      "431xet9CSscJ4fuDDPchTotNpMxu6xTUC4zku8YzkEjW": {
        "balance": 17587.10870728,
        "percentage": 0.0023843174724825283
      },
      "Cg4yZqxubkJRHV4SqLZ2qTLqvfaEaoqxHsGT55RQPa1m": {
        "balance": 15083.515028,
        "percentage": 0.0020449005590570052
      }
    }
  },
  "lastEventData": {
    "tokenPrice": {
      "mintId": "BjQxXBh6Pb8xDcSbgMuQdDDBNWoMVgvKrcVApmr9pump",
      "userId": "a2DnvESKyWintb12mP5aD3UfKxTTiLPUhJjSxsNq531",
      "price": 2.86178146146e-7,
      "solAmount": 0.001370279,
      "tokenAmount": 478.271054,
      "userTokenPostAmount": 23597.914976,
      "virtualBaseReserves": 335383935.434216,
      "virtualQuoteReserves": 95.97955289,
      "txSignature": "5i1jApVZs1Ei7t2sw1rh5nWcUSaFehGeRzrbsuBQnLpDGeEUGrkLXn9Vv4E6CvgwRhWbgH9Zg4k8c5XreWphVj1a",
      "timestamp": 1751978287209,
      "localTime": 1751978287137,
      "uuid": 330134795016450000,
      "programId": null,
      "flinkTime": 1751978287212,
      "buy": true
    }
  }
}
```

</details>

<details>

<summary><strong>Wallet Stats Message</strong></summary>

```json
{
  "userId": "56S29mZ3wqvw8hATuUUFqKhGcSGYFASRRFNT38W8q7G3",
  "walletPnlData": {
    "userId": "56S29mZ3wqvw8hATuUUFqKhGcSGYFASRRFNT38W8q7G3",
    "totalRealizedPnl": 0.6895861411517962,
    "totalUnrealizedPnl": 0,
    "totalPnl": 0.6895861411517962,
    "totalTrades": 7,
    "profitableTrades": 2,
    "winRate": 28.57142857142857,
    "lastTransactionTimestamp": 1751349977644,
    "positions": {
      "EjAJNaF3dqCapLRNoLErihxYX4mJQmWBUvHgBB3vpump": {
        "mintId": "EjAJNaF3dqCapLRNoLErihxYX4mJQmWBUvHgBB3vpump",
        "totalTokens": 5318392.835824,
        "averageEntryPrice": 6.0097031482e-8,
        "realizedPnl": 0,
        "unrealizedPnl": 0,
        "firstEntryTimestamp": 1751349946277,
        "lastTransactionTimestamp": 1751349946277,
        "lastTxSignature": "4dNziCaRcgmm5FBCxYJwSArMUdVw1zdTvn1AQZKjfA4hVRy25DcxUjo1TEVAfhSHEt36HG8bJMHa1fQXqs37J7nq",
        "currentPrice": 6.0097031482e-8,
        "operationCount": 1,
        "totalTradingVolume": 0.31961962168815816,
        "tradingVolumePercentage": 15.417540720956602
      },
      "9Xr61vGw9PGwjyqLyR6Tc57GzVeYLEfDRkFvm4Kxpump": {
        "mintId": "9Xr61vGw9PGwjyqLyR6Tc57GzVeYLEfDRkFvm4Kxpump",
        "totalTokens": 5323114.194414,
        "averageEntryPrice": 5.9000663217e-8,
        "realizedPnl": 0,
        "unrealizedPnl": 0,
        "firstEntryTimestamp": 1751349947022,
        "lastTransactionTimestamp": 1751349947022,
        "lastTxSignature": "5aofnrrjZC4fF7ukMzrHGXYTKLpDUDtS4cVWtqyh2vyncs5ZfE38xqBUTwaFA78Tm8YTKzLjqu4WsCaimnjDA54T",
        "currentPrice": 5.9000663217e-8,
        "operationCount": 1,
        "totalTradingVolume": 0.3140672678502527,
        "tradingVolumePercentage": 15.149710977147606
      },
      "9ZxXUT7dgrMsKg5ZQBaABMr3cJfgQ5evduV9CC3Dpump": {
        "mintId": "9ZxXUT7dgrMsKg5ZQBaABMr3cJfgQ5evduV9CC3Dpump",
        "totalTokens": 5322882.805041,
        "averageEntryPrice": 5.9063671599e-8,
        "realizedPnl": 0,
        "unrealizedPnl": 0,
        "firstEntryTimestamp": 1751349945598,
        "lastTransactionTimestamp": 1751349945598,
        "lastTxSignature": "29qnPYTmPTCLYroc1t3gpj2AChhRGyJk3BgypKxCa4r3oRaeoDfzvdWdc96VfFSXZpUJYtWn1P3zjyY6DSvZENxu",
        "currentPrice": 5.9063671599e-8,
        "operationCount": 1,
        "totalTradingVolume": 0.31438900195690556,
        "tradingVolumePercentage": 15.16523051460417
      },
      "14cKJUKv9FxxymYrC2o3xAp5LGUWx29C5p6abFZtpump": {
        "mintId": "14cKJUKv9FxxymYrC2o3xAp5LGUWx29C5p6abFZtpump",
        "totalTokens": 2701917.17893,
        "averageEntryPrice": 5.4199509483e-8,
        "realizedPnl": 0,
        "unrealizedPnl": 0,
        "firstEntryTimestamp": 1751349947022,
        "lastTransactionTimestamp": 1751349947022,
        "lastTxSignature": "2X1cXbXENWWfCJpg8edYjroo8hcyPtqZxLn9Q7jBBMzEVbUHcnwLxCDDrDS3e2ENLBSitpzB64asbAWTrAmKHb2h",
        "currentPrice": 5.4199509483e-8,
        "operationCount": 1,
        "totalTradingVolume": 0.14644258576169714,
        "tradingVolumePercentage": 7.063973473649836
      },
      "3HD7D5jGxhMbAUA5Tb8xSP32yeyMbsxATwbSVAPLpump": {
        "mintId": "3HD7D5jGxhMbAUA5Tb8xSP32yeyMbsxATwbSVAPLpump",
        "totalTokens": 5323439.645358,
        "averageEntryPrice": 5.4285616631e-8,
        "realizedPnl": 0,
        "unrealizedPnl": 0,
        "firstEntryTimestamp": 1751349945432,
        "lastTransactionTimestamp": 1751349945432,
        "lastTxSignature": "2AjLTpRGbqnis5RnH754hrvZ8BFQbNd3myCjPZSM3rrWPHwnerDzzWUKHpRak9Y76rEonyjH1oQMjrDMcTeWC8iW",
        "currentPrice": 5.4285616631e-8,
        "operationCount": 1,
        "totalTradingVolume": 0.28898620374617096,
        "tradingVolumePercentage": 13.93987184052889
      },
      "eWiWDJ6WES16tD51nmtBHd69Q2rjSgQmCgJAdh7pump": {
        "mintId": "eWiWDJ6WES16tD51nmtBHd69Q2rjSgQmCgJAdh7pump",
        "totalTokens": 0,
        "averageEntryPrice": 0,
        "realizedPnl": 0.23208689085124037,
        "unrealizedPnl": 0,
        "firstEntryTimestamp": 0,
        "lastTransactionTimestamp": 1751349977644,
        "lastTxSignature": "5bMi1jtpKDeVvUCB6p6zTGGpqjBvMpmghxdobXqheZKXhSiue8mVN35fxYoEFFvowQMgS5NCQX7va6G6Lory8bY4",
        "currentPrice": 5.0036170262e-8,
        "operationCount": 1,
        "totalTradingVolume": 0.23208689085124037,
        "tradingVolumePercentage": 11.195210956073105
      },
      "3nroLamcT6haFEQrVwTYXzLi6emBvRgzF8fy13VRpump": {
        "mintId": "3nroLamcT6haFEQrVwTYXzLi6emBvRgzF8fy13VRpump",
        "totalTokens": 0,
        "averageEntryPrice": 0,
        "realizedPnl": 0.4574992503005558,
        "unrealizedPnl": 0,
        "firstEntryTimestamp": 0,
        "lastTransactionTimestamp": 1751349947079,
        "lastTxSignature": "3Jc2ya2Gq8ot5whYf4MCAGqpGUyp7C396kRcwCfQHrGGWpYLG6JDLteFV6EChNnbS8j2fbMLexR9htdRd6PXnnkB",
        "currentPrice": 4.5444036358e-7,
        "operationCount": 1,
        "totalTradingVolume": 0.4574992503005558,
        "tradingVolumePercentage": 22.068461517039797
      }
    }
  }
}
```

</details>

<details>

<summary><strong>Token Snapshot Message</strong></summary>

```json
{
  "mintId": "EncrbDuNV9AK8PPek9JApDWiG4R6LdyJ8xrVxA5Npump",
  "windowStart": 1752490320000,
  "windowEnd": 1752490380000,
  "openPrice": 2.78566362451e-7,
  "highPrice": 2.83444475054e-7,
  "lowPrice": 2.5590998494e-7,
  "closePrice": 2.72434596151e-7,
  "totalVolume": 10.751337617,
  "buyVolume": 4.1581366530000015,
  "sellVolume": 6.593200963999998,
  "totalTxCount": 33,
  "buyTxCount": 18,
  "sellTxCount": 15,
  "buySellCountRatio": 1.2,
  "buyCountPercentage": 54.54545454545455,
  "sellCountPercentage": 45.45454545454545,
  "uniqueBuyers": [
    "4uiFWb1p65YCn8rhnaj9kmbnDxF4PBesgk5RVomB4Qgp",
    "13iai3A65vKVaYHXXmWscVfwH9mcbUu41ag2EqhieYXo",
    "jT8sgqcTAiB2VFNE5nmx3dFhijemb26PCNs6AaZzXoo",
    "EYALjTrFsLoziaLzyt7DbXVumU5kdeDADYLD9CoG5Ytu",
    "EqJsE1FzKmwEXskGbpgm3jmRWaMXaJwiUmVCXtmFPraJ",
    "5sFjyuhuCDrEtguZ4FjTEDM5kb1FRdEuecC582uXkiSz",
    "2rrESvZVT6wr2i9cYrdKNxsugg2hNQKcpVazSXCNQdDd",
    "CYR45pV5K3T5aZM4ENidKXeQEJghAV2ar7CoXm2xbrj2",
    "6kYZJ1Q1hro7hRqVM13Tgiay9XNgZ46CLeJb7oY26Bir",
    "CxZogxR34AW8wKTpDpowchH8VqrN3cFcXMPkXdu7B2pf",
    "AP88cKH1p4rQLwWQYor8b7fyJpwde5VDEoxTiKQ4vkWi",
    "8Qzs8NYERcEUdLo6TiiHizo32W2V3TG2V3EJFYXqZKEe",
    "5vqSaurVoUqLvnMV5bHcwvQqiradHDQnKkmhjAKhHsru",
    "49wqHFkLibERmoh3mzKcSFpQXjP95VxQPTx9EGcbU1Su",
    "3kZJTCLWYsrt7NTWRgy2xTXVDmgGMUkF3Ve1dYuRjUwX",
    "BV3kNdTo5eX8ZM1P1H6h3LbC4Av4uzE3ciZ6fBYwkkZE"
  ],
  "uniqueSellers": [
    "8WnAwSSYgm1k3dd6EzyYpWbiVZ5wRk593yDNbEZgeRF9",
    "CnmgL6FS7kG1i7HvkZhYKviE7mM4YX3vnmnpdJRW3aUT",
    "3g4VRWUSR6yeaEeMddofh4ZWX68hfxezFZfStmiQhqjv",
    "3c2KsT3A5cxfd3p6akBnm8FNhK22mPm53u83sXWEchqD",
    "HP4LrjWb8kzKm8P14U4xQPJMKAGjL6RdQAEPtjS42HGK",
    "Hu2EJQypQKT9nHKeB5SWKx3rGbtb7M3CWSAvfowUFyqW",
    "4HhSEYbStpDh8gFDvEZ2uCvGzvRGJvJY8WUWZQ6H5gW9",
    "GHujjejBVk5HzxN6baN9tquSnyD4pvBWnopyhQNfvCNA",
    "9A4WgdRpGL6B9T8rrDyhyCKzAWkWtQHW2rtdQRdjkcHm",
    "HsceoaYzukrSKyhgLvvPKofxJAjWDDhvPWvrj6wQnCU5",
    "BXmRkVKx8eXhLTYU493c4bWAcQAted9ZpcfmWXjhTjav",
    "6YgqoPjAGANxa1HRmARWcx3r6pbzm6P39QqNqqgPLZQp",
    "5veqSEw2FeP751qbPdsbYoNV4G1NxehzLygJwrMPPwLn",
    "BW5Ja7hnEzNV34p8hNQZdgFGNiMJj9TMKF2wZsMFnrEq"
  ],
  "uniqueBuyerCount": 16,
  "uniqueSellerCount": 14,
  "windowLabel": "1m",
  "totalVolumeQuote": 10.751337617,
  "buyVolumeQuote": 4.1581366530000015,
  "sellVolumeQuote": 6.593200963999998,
  "buyVolumePercentage": 38.67552858190558,
  "sellVolumePercentage": 61.32447141809442,
  "openTxSignature": "5vHxbvMzhVdw4R3Aoia2NrauJf4E1pxupjgngrpqPbBjJnrrSug2ChG3nccgVqU59V9YJ6CFnXuGkDjpSUnqMQUn",
  "closeTxSignature": "5PHf73chcXHTQZJU51HdhKvkjdPyFtVcAYMiVGCNGmbGETWJc8CpQPCGsaZh2gLDbEFFuDL5FtcTSUjrL5XJLW3s",
  "windowDurationMillis": 60000
}
```

</details>

<details>

<summary>subscription</summary>

Confirmation of successful subscription to transaction stream.

```json
{
   "type":"subscription",
   "status":"success"
}
```

</details>

<details>

<summary>info</summary>

Server information and status messages.

```json
{
   "type":"info",
   "message":"Connected to Solana mainnet"
}
```

</details>

<details>

<summary>error</summary>

Error messages and troubleshooting information.

```json
{
   "type":"error",
   "message":"Rate limit exceeded",
   "code":"RATE_LIMIT"
}
```

</details>


# Token Snapshot

Field Reference

### Overview

The `TradeActivityStats` class represents comprehensive trade and volume statistics for cryptocurrency tokens over configurable time windows.&#x20;

This immutable data model captures OHLCV candle data, transaction metrics, volume analytics, and unique participant tracking.

### Field Reference

#### **Time Window Fields**

| Field                | Type   | Description                                                 |
| -------------------- | ------ | ----------------------------------------------------------- |
| mintId               | String | Token mint identifier                                       |
| windowStart          | long   | Window start timestamp (epoch milliseconds)                 |
| windowEnd            | long   | Window end timestamp (epoch milliseconds)                   |
| windowDurationMillis | long   | Explicit window duration in milliseconds                    |
| windowLabel          | String | Human-readable window label (e.g., "1m", "5m", "1h", "24h") |

#### **OHLCV Price Data**

| Field      | Type   | Description                           |
| ---------- | ------ | ------------------------------------- |
| openPrice  | double | Opening price (first trade in window) |
| highPrice  | double | Highest price traded in the window    |
| lowPrice   | double | Lowest price traded in the window     |
| closePrice | double | Closing price (last trade in window)  |

#### **Volume Metrics - Token Units**

| Field       | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| totalVolume | double | Total trade volume in token units |
| buyVolume   | double | Buy-side volume in token units    |
| sellVolume  | double | Sell-side volume in token units   |

#### **Volume Metrics - Quote Currency**

| Field            | Type   | Description                               |
| ---------------- | ------ | ----------------------------------------- |
| totalVolumeQuote | double | Total volume in quote currency (USDT/SOL) |
| buyVolumeQuote   | double | Buy-side volume in quote currency         |
| sellVolumeQuote  | double | Sell-side volume in quote currency        |

#### **Volume Ratios**

| Field                | Type   | Description                                |
| -------------------- | ------ | ------------------------------------------ |
| buyVolumePercentage  | double | Buy volume as percentage of total (0-100)  |
| sellVolumePercentage | double | Sell volume as percentage of total (0-100) |

#### **Transaction Counts**

| Field        | Type | Description                                 |
| ------------ | ---- | ------------------------------------------- |
| totalTxCount | int  | Total number of transactions (buys + sells) |
| buyTxCount   | int  | Number of buy transactions                  |
| sellTxCount  | int  | Number of sell transactions                 |

#### **Transaction Ratios**

| Field               | Type   | Description                              |
| ------------------- | ------ | ---------------------------------------- |
| buySellCountRatio   | double | Ratio of buy to sell transaction counts  |
| buyCountPercentage  | double | Buy transactions as percentage of total  |
| sellCountPercentage | double | Sell transactions as percentage of total |

#### **Unique Participants**

| Field             | Type         | Description                           |
| ----------------- | ------------ | ------------------------------------- |
| uniqueBuyers      | Set\<String> | Set of unique buyer wallet IDs        |
| uniqueSellers     | Set\<String> | Set of unique seller wallet IDs       |
| uniqueBuyerCount  | int          | Count of unique buyers in the window  |
| uniqueSellerCount | int          | Count of unique sellers in the window |

#### Transaction References

| Field            | Type   | Description                           |
| ---------------- | ------ | ------------------------------------- |
| openTxSignature  | String | Transaction hash of the opening trade |
| closeTxSignature | String | Transaction hash of the closing trade |

### Field Categories Summary

* Time Window: 5 fields defining the temporal scope
* OHLCV Data: 4 fields for candlestick price information
* Volume Metrics: 9 fields covering token and quote currency volumes with ratios
* Transaction Metrics: 6 fields for transaction counts and ratios
* Participants: 4 fields tracking unique buyers and sellers
* References: 2 fields linking to boundary transactions

Total Fields: 30 fields providing comprehensive trading analytics data

### Usage Notes

* All price and volume fields use double precision for accurate financial calculations
* Transaction counts use int type, suitable for typical trading volumes
* Unique participant tracking uses Set\<String> for efficient deduplication
* Timestamps are stored as epoch milliseconds (long) for precise time tracking
* The class is immutable and uses the builder pattern for construction


# Historical aggregations

Historical aggregations are computed across days, weeks, and months - ideal for PnL analysis, smart wallet tracking, market research, and portfolio insights.

These are designed for:

* Dashboards
* Quantitative research
* Risk & compliance workflows
* Backtesting trading strategies

### Historical aggregation examples

<details>

<summary>Realized &#x26; Unrealized PnL per wallet</summary>

* Entry and exit price
* Time of trade
* Fee inclusion
* Final position value

</details>

<details>

<summary>Top wallets by PnL</summary>

* Daily / weekly / monthly ranking
* Wallet age / trade count / total profit
* Profit % and ROI distribution

</details>

<details>

<summary>Max possible unrealized PnL</summary>

* Avg entry price vs token ATH
* Held token volume
* Time-windowed unrealized gain max

</details>

<details>

<summary>Wallet token usage</summary>

* % volume per token
* Tokens traded
* Number of interactions per token

</details>

<details>

<summary>Wallet activity overview</summary>

* Tx count (24h, 7d, 30d)
* Avg trade frequency
* SOL/USD volume
* Unique tokens traded

</details>

<details>

<summary>Token price dynamics</summary>

* Live + historical prices
* Delta over 1m, 5m, 1h, 24h
* Moving averages

</details>

<details>

<summary> Wallet volume &#x26; activity</summary>

* Buy/sell count and ratio
* Volume windows
* Unique counterparties (optional)

</details>

<details>

<summary>Token creator analytics</summary>

* Creator wallet balance over time
* Authority transfers
* Sniper detection (bought in same block)
* Early exits

</details>

<details>

<summary>Holder-level token stats</summary>

* % of holders at profit/loss
* Volume in profit/loss
* Time-since-buy segmentation

</details>

<details>

<summary>Smart wallet signals</summary>

* Tagging: ROI, consistency, size
* Smart wallet trades per token
* Overlap with user activity

</details>


# Aggregation Infrastructure

### How

* Real-time aggregations are processed in-memory via event streamers.
* Historical aggregations are computed from MongoDB + time-series DB pipelines.
* All are available via:
  * REST API (pull on demand)
  * WebSocket (real-time subscriptions)
  * GraphQL (soon)

### Why

Built for decision-making

* Agents and bots subscribe to real-time triggers
* Analysts and researchers query aggregated trends
* Security teams monitor wallet behaviors
* AI models use structured, labeled features for prediction

### Next

You're ready to use the aggregations:

* Subscribe to real-time data
* Query token or wallet insights
* Build dashboards or alerts

\ <img src="https://paper.dropboxstatic.com/static/img/ace/emoji/1f449.png?version=8.0.0" alt="backhand index pointing right" data-size="line"> Continue to the API & Streams section to start integrating.


# On Demand Data

Tailored blockchain analytics, and metrics built for your exact business needs. Delivered in real time, fully structured, and ready for integration.

## Summary

Enterprise clients often require more than generic datasets or standard APIs. Whether you need advanced trading analytics, lifecycle tracking for tokens, or cross-protocol performance metrics, our team can design and deliver custom aggregations and structured data flows that fit your specific objectives. Every aggregation is engineered to run at scale with ultra-low latency, ensuring that the intelligence you receive is both timely and actionable.

## Pump.fun Example

### Deep Analytics Engineered for Fun and Profitable Trading

Analytics  designed explicitly to enhance Pump.fun’s core appeal:

* **Trade Channel Insights:**&#x20;
  * Rapidly pinpoint popular trading channels by analyzing frequently used ProgramIds (e.g., Axiom, Photon, OKX), and present real-time comparative metrics, including the number of trades versus trading volumes.
* **Developer Insights:**&#x20;
  * Track token creation rates per developer segmented by hour/day of the week, and detect token clones through pattern recognition (similar names, symbols, IPFS URIs, and content).
* **Bonding Curve Excitement:**&#x20;
  * Dynamically compute daily and weekly percentages of tokens reaching critical milestones (35%, 80%, 100%) on the bonding curve.
* **Graduation Statistics:**&#x20;
  * Calculate average time and number of swaps required for tokens to graduate, presented engagingly to foster user competition.
* **Trending Tokens Live Ticker:**&#x20;
  * Maintain a configurable real-time ticker updated every few seconds, driven by analytics on per-block trading volumes, sudden spikes, and pro-trade activities.
* **Developer Fund Transparency:**&#x20;
  * Perform blockchain analysis to trace the source of developer funds up to multiple levels deep.
* **Wallet Activity Alerts:**&#x20;
  * Track and integrate wallet-to-wallet transfers alongside swap lists, clearly signaling accumulation patterns along with DeX activity.&#x20;
* **Proactive Scam Alerts:**&#x20;
  * Emit rug pull alerts based on predictive analytics that leverage historical token creation and trading patterns.
* **Accurate P\&L Calculations:**&#x20;
  * Compute real profit-and-loss accurately by ensuring tokens bought equal tokens sold, excluding wallet-to-wallet transfers.
* **Spotlighting Successful Traders:**&#x20;
  * Identify users frequently associated with tokens that successfully graduate or consistently execute the last bonding buys.
* **Holder Evolution Visuals:**&#x20;
  * Generate timelines of token holder growth, highlighting current holders, total historical holders, and peak concurrency.
* **Simple ATH Narratives:**&#x20;
  * Clearly list All-Time Highs alongside their largest dips and required buy volumes in SOL for reaching new peaks.
* **Friendly Bot Detection:**&#x20;
  * Highlight volume bots or bundled transactions, using pattern analysis to present potential alpha clearly.
* A**TH Trader Identification:**&#x20;
  * Identify users consistently generating ATH events between critical price points or making purchases within 1-2 blocks after an ATH.
* **Deep Wallet Tracking:**&#x20;
  * Comprehensive statistics per mint for tokens traded by wallets, including technical metrics (time since token creation, number of buys/sells, volumes, holder distribution, market cap, active vs. all-time holders, percent of ATH) at entry and exit points, detailed views of the last X and following Y trades around entry and exit events, block distances, trade durations, and precise profit-and-loss calculations (amount and percentage).

### Real-Time Actionable Insights

We deliver simplified, real-time structured and actionable insights per block and per swap, helping Pump.fun users effortlessly navigate markets while remaining engaged and confident.

* **Real-Time Token Metrics:**&#x20;
  * Instantly accessible structured data per token, including All-Time High (ATH), current price levels, cost to reach new ATH, total trading volume, buy and sell counts, and pro-trader activities. Users also gain visibility into detailed holder statistics such as total tokens in circulation, active vs. total holders, and concentrated holding percentages among top wallets. Each transaction is enriched with granular details like token amounts traded, precise SOL values, post-transaction wallet balances, reserve dynamics, transaction timestamps, and blockchain transaction signatures, providing complete transparency and confidence in every trading decision.
* **Real-Time Wallet Metrics:**&#x20;
  * Provide instant visibility into individual wallet performance, including total realized and unrealized P\&L, trade counts, win rates, and detailed positions. Each position includes comprehensive metrics such as token counts, average entry prices, trade volumes, timestamps of first and last transactions, current market prices, operation counts, and individual transaction signatures. This data empowers users with clear insights into their trading history, effectiveness, and overall profitability in real-time.


# Case Study: Solexys

A Research Agent Powered by LYS Labs data

Solexys is a real-time, AI-powered trading agent built entirely on top of LYS Labs' infrastructure. It is a statement of what is possible using LYS Labs enriched data.

Where LYS Labs delivers structured, institutional-grade blockchain data via APIs, Solexys uses that same data layer to create a user-friendly product for on-chain retail users - degens, researchers, and power traders. Think of it as a frontend research agent designed to explore and interact with the blockchain at speed.

{% hint style="info" %}
If you're curious what can be built using LYS data, give Solexys a spin:

* 🌐 [**solexys.ai**](https://solexys.ai) - Main product site
* 📘 [**docs.solexys.ai**](https://docs.solexys.ai) - Technical documentation
  {% endhint %}

## What is Solexys?

* Solexys serves as a proof-of-concept for what can be built using LYS Labs data:
  * Built on top of LYS real-time pipelines (14ms Solana latency)
  * Powered by decoders and aggregation engines developed by LYS Labs
  * Enriched by knowledge graphs and RAG-ready contextual layers
  * Delivered to users through an intuitive, human-facing UI

{% hint style="info" %}
If you're an infra team, bot builder, or trading firm - Solexys is not your tool. But it shows what kind of product *you* could build using the same data primitives provided by LYS Labs.
{% endhint %}

## How it uses LYS Labs data

Solexys interacts directly with the following components of the LYS Labs stack:

```
✓ Scrapers            → Raw Solana block ingestion
✓ Decoders            → Real-time instruction parsing (swaps, transfers, LP adds)
✓ Aggregators         → Volume spikes, ATH tracking, rug detection
✓ Knowledge Graph     → OG-RAG powered context delivery
✓ Real-Time APIs      → Streams of enriched token activity
✓ Historical APIs     → Token price, volume, wallet PnL backtesting
```

{% hint style="info" %}
These same primitives are available through the LYS Sandbox, allowing you to build your own systems, bots, or products on top of the data layer.
{% endhint %}

### How to think about it

| Platform     | Audience                     | Purpose                                      |
| ------------ | ---------------------------- | -------------------------------------------- |
| **LYS Labs** | Quants, traders, infra teams | Deliver high-speed, AI-ready blockchain data |
| **Solexys**  | Retail, degens               | Interact with that data via a research agent |


# Contact

This page contains all relevant ways to get in touch with the LYS Labs team, access community channels, and view official policies or documentation.

<hello@lyslabs.ai> for all email inquiries

Discord: <https://discord.com/invite/lyslabs>

Twitter DM's open: [@lys\_labs](https://x.com/lys_labs)


# Builders Program

Signal your interest in participating in the LYS Labs Builders Program.

The purpose of the Builders Program is to empower LYS Labs community members who are interested in building within the world of machine finance and automated execution using LYS Labs infrastructure.

Fill out the form below to get exclusive access to our unreleased stack and remember to follow us on Twitter or join or Discord community for the latest.&#x20;

{% embed url="<https://docs.google.com/forms/d/e/1FAIpQLSe9DHZFMBtHu0bsO1Kxjfl9K9H3NS-yFpecZXAT8rqLsBdqRA/viewform>" %}


