# Solana - Market SQL

> Blocks and trading activity on Solana across Pump.fun, PumpSwap, Meteora, Raydium, and Jito.

The **Solana** dataset provides swaps and launches across Pump.fun, PumpSwap, Raydium, and Meteora, alongside token transfers, SOL funding activity, blocks, timestamps, Jito tips, and other market infrastructure data.

| Property | Value |
| --- | --- |
| Database name | `solana` |
| Tables | 21 |
| Access | Subscribed to separately |

### Tables

| Table | Description |
| --- | --- |
| `jito_tips` | Jito tip transfers with sender, recipient account, amount and Solana transaction context. |
| `max_caps` | Precomputed maximum token market-cap observations in SOL and USDC. |
| `meteora_dynamic_bonding_swaps` | Meteora dynamic bonding-curve swaps with amounts, reserves, fees and routing context. |
| `meteora_swaps` | Meteora DLMM swaps with token amounts, bin movement, fees and transaction details. |
| `pfamm_migrations` | Pump.fun AMM migrations with migrated token and SOL amounts, pools and wallets. |
| `pumpfun_all_swaps` | Decoded Pump.fun bonding-curve swaps with direction, amounts, virtual reserves and fees. |
| `pumpfun_amm_admin_set_coin_creator` | Pump.fun AMM administrative events that change a pool's coin creator. |
| `pumpfun_creator_fee_distributions` | Pump.fun creator-fee distribution events with recipient, mint, amount and transaction context. |
| `pumpfun_token_creation` | Pump.fun token creation events with mint, creator and initial bonding-curve metadata. |
| `pumpfun_v2_swaps` | Pump.fun v2 swap activity with token amounts, fee components and transaction context. |
| `pumpswap_all_swaps` | PumpSwap AMM swaps with reserves, fee components, creator, cashback and buyback fields. |
| `raydium_all_swaps` | Unified decoded swap activity across supported Raydium programs. |
| `raydium_cpmm_swaps` | Raydium constant-product pool swaps with token amounts, pools, fees and transaction context. |
| `raydium_launchpad_cpmm_migrations` | Raydium Launchpad migrations into constant-product pools. |
| `raydium_launchpad_migrations` | Raydium Launchpad token and liquidity migration events. |
| `raydium_launchpad_swaps` | Raydium Launchpad swaps with trade direction, amounts, curve state and fees. |
| `raydium_launchpad_token_creation` | Raydium Launchpad token creation events and initial launch configuration. |
| `sol_top_ups` | SOL funding transfers used to trace wallet top-up paths. |
| `solana_blocks` | Solana block and slot coverage with production timestamps. |
| `token_transfers` | Decoded token transfer activity with assets, amounts, wallets and transaction context. |
| `tx_timestamps` | Reusable transaction-to-block timestamp lookup data. |

> **Info:**
> 
> ### Coverage differs by table.
> 
> For example, `pumpfun_token_creation` starts in January 2024, while `pfamm_migrations` and `pumpswap_all_swaps` start on 25 November 2025. Check a table's range before choosing a study window:
> 
> ```sql
> SELECT min(block_time), max(block_time) FROM pfamm_migrations
> ```

#### Columns

To list a table's columns and types, run `DESCRIBE TABLE`:

```bash
curl --fail-with-body \
  --user "<USER-ID>:<API-KEY>" \
  "https://market-sql.eu-central-1.getblock.io?database=solana&default_format=PrettyCompact" \
  --data-binary "DESCRIBE TABLE pumpswap_all_swaps"
```

> **Warning:** `pumpfun_token_creation` stores `mint` and `creator` as `FixedString(48)`, while other tables such as `pfamm_migrations` and `pumpswap_all_swap`` use `String`. Convert with `toString(mint)` before joining or filtering with `IN`.

### Example request

#### cURL

```bash
curl --fail-with-body \
  --user "<USER-ID>:<API-KEY>" \
  "https://market-sql.eu-central-1.getblock.io?database=solana&default_format=JSONEachRow" \
  --data-binary "SELECT block_time, direction, base_token, quote_token FROM pumpswap_all_swaps LIMIT 5"
```

#### Javascript

```js
import { createClient } from '@clickhouse/client'

const client = createClient({
  host: 'https://market-sql.eu-central-1.getblock.io',
  username: process.env.GETBLOCK_USER_ID,
  password: process.env.GETBLOCK_API_KEY,
  database: 'solana'
})

const rows = await client.query({
  query: 'SELECT * FROM pumpswap_all_swaps LIMIT 10',
  format: 'JSONEachRow'
})

console.log(await rows.json())
```

#### Python

```python
import os
import requests

response = requests.post(
    "https://market-sql.eu-central-1.getblock.io",
    params={"database": "solana", "default_format": "JSONEachRow"},
    auth=(os.environ["GETBLOCK_USER_ID"], os.environ["GETBLOCK_API_KEY"]),
    data="SELECT block_time, direction, base_token, quote_token FROM pumpswap_all_swaps LIMIT 5",
    timeout=60,
)
response.raise_for_status()
print(response.text)
```

#### GO

```go
package main

import (
	"crypto/tls"
	"fmt"
	"log"
	"os"

	"github.com/ClickHouse/clickhouse-go/v2"
)

func main() {
	db := clickhouse.OpenDB(&clickhouse.Options{
		Addr:     []string{"market-sql.eu-central-1.getblock.io:443"},
		Protocol: clickhouse.HTTP,
		TLS:      &tls.Config{},
		Auth: clickhouse.Auth{
			Database: "solana",
			Username: os.Getenv("GETBLOCK_USER_ID"),
			Password: os.Getenv("GETBLOCK_API_KEY"),
		},
	})
	defer db.Close()

	rows, err := db.Query("SELECT block_time, direction, base_token, quote_token FROM pumpswap_all_swaps LIMIT 5")
	if err != nil {
		log.Fatal(err)
	}
	defer rows.Close()

	for rows.Next() {
		var blockTime, direction, baseToken, quoteToken any
		if err := rows.Scan(&blockTime, &direction, &baseToken, &quoteToken); err != nil {
			log.Fatal(err)
		}
		fmt.Println(blockTime, direction, baseToken, quoteToken)
	}
	if err := rows.Err(); err != nil {
		log.Fatal(err)
	}
}
```

#### Rust

```rs
use clickhouse::Client;
use std::env;
use tokio::io::AsyncBufReadExt;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::default()
        .with_url("https://market-sql.eu-central-1.getblock.io:443")
        .with_user(env::var("GETBLOCK_USER_ID")?)
        .with_password(env::var("GETBLOCK_API_KEY")?)
        .with_database("solana");

    let mut lines = client
        .query("SELECT block_time, direction, base_token, quote_token FROM pumpswap_all_swaps LIMIT 5")
        .fetch_bytes("JSONEachRow")?
        .lines();

    while let Some(line) = lines.next_line().await? {
        println!("{line}");
    }

    Ok(())
}
```

### Response Sample

```json
{"block_time":"2025-11-25 16:00:00","direction":"S","base_token":"J7Dx5yPbPD5e5BmrSvJyi4n4XRUR2kWqWYaxaSWdpump","quote_token":"So11111111111111111111111111111111111111112"}
{"block_time":"2025-11-25 16:00:00","direction":"B","base_token":"So11111111111111111111111111111111111111112","quote_token":"4qwCcewR4ewD6GDrJTiNJqezLDQYtGdxcLCT1AQNC11p"}
{"block_time":"2025-11-25 16:00:00","direction":"B","base_token":"So11111111111111111111111111111111111111112","quote_token":"D9Bm7bGSzPkqeKibu1adssv753Uy7j1NVbpYC3V9wfzp"}
{"block_time":"2025-11-25 16:00:00","direction":"B","base_token":"So11111111111111111111111111111111111111112","quote_token":"H7dbqcgExJY34kDrRqQrrXVYqodBreQz3mfDtHbV9NCf"}
{"block_time":"2025-11-25 16:00:00","direction":"B","base_token":"So11111111111111111111111111111111111111112","quote_token":"C1uSTAyKRb9Zt2ESsGYqQvB2y2armUwo2ctjr9AKWDS1"}

```

## Next steps

* [**API Reference**](/market-sql/api-reference/) — endpoint, authentication, and limits
* [**Querying Market SQL**](/market-sql/querying-market-sql/) — datasets, queries, and result formats
