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

# Query Solana tokens

> Query SPL Token and Token-2022 transfers and instructions on Solana Mainnet with the SQL API—no custom indexer required.

Use SQL API to track mint-level volume, wallet transfer history, and decoded SPL Token / Token-2022 instructions on Solana Mainnet—without running your own indexer.

<Note>
  Solana support is in public beta. Coverage focuses on SPL Token and Token-2022 at launch (plus native SOL transfers in `solana.transfers`). About **3 months** of history is retained, and the schema may evolve during beta.
</Note>

## What's covered

| Table                                                             | What it covers                                                                                           |
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| [`solana.transfers`](/data/sql-api/schema#solana-transfers)       | Token transfers from `transfer` / `transferChecked` instructions (SPL Token, Token-2022, and native SOL) |
| [`solana.instructions`](/data/sql-api/schema#solana-instructions) | Decoded instruction calls for SPL Token and Token-2022 programs                                          |

Well-known program IDs:

| Program                       | Program ID                                    |
| ----------------------------- | --------------------------------------------- |
| SPL Token                     | `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` |
| Token-2022                    | `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb` |
| System (native SOL transfers) | `11111111111111111111111111111111`            |

## Access

<CardGroup cols={2}>
  <Card title="SQL Playground" icon="browser" href="https://portal.cdp.coinbase.com/onchain-tools/sql-api">
    Try queries in your browser (no API keys needed)
  </Card>

  <Card title="REST API" icon="code" href="/data/sql-api/rest-apis">
    Programmatic access
  </Card>
</CardGroup>

## Example queries

<Tip>
  Try these in the [SQL Playground](https://portal.cdp.coinbase.com/onchain-tools/sql-api) before integrating programmatically.
</Tip>

### Recent transfers for a mint

Replace `{mint}` with the token mint you are tracking (for example, USDC: `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`):

```sql theme={null} theme={null}
SELECT
  block_time,
  tx_id,
  source_owner,
  destination_owner,
  amount
FROM solana.transfers
WHERE mint = '{mint}'
  AND action = 1
ORDER BY block_time DESC
LIMIT 100;
```

### Transfer volume for a mint

Daily transfer volume in base units for a mint over the last 7 days:

```sql theme={null} theme={null}
SELECT
  toDate(block_time) AS day,
  count() AS transfer_count,
  sum(amount) AS volume_base_units
FROM solana.transfers
WHERE mint = '{mint}'
  AND block_time >= now() - INTERVAL 7 DAY
  AND action = 1
GROUP BY day
ORDER BY day DESC;
```

### Recent wallet transfer history

Query by owner wallet—not token account—using `source_owner` / `destination_owner`. Always bound `block_time` (owners are not the leading index):

```sql theme={null} theme={null}
SELECT
  block_time,
  tx_id,
  mint,
  source_owner,
  destination_owner,
  amount
FROM solana.transfers
WHERE (source_owner = '{wallet}' OR destination_owner = '{wallet}')
  AND block_time >= now() - INTERVAL 7 DAY
  AND action = 1
ORDER BY block_time DESC
LIMIT 100;
```

### Instruction activity for a program

Recent decoded instructions for SPL Token or Token-2022:

```sql theme={null} theme={null}
SELECT
  block_time,
  tx_id,
  instruction_name,
  accounts,
  args
FROM solana.instructions
WHERE executing_account = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
  AND instruction_name = 'transferChecked'
  AND action = 1
ORDER BY block_time DESC
LIMIT 50;
```

### Reconstruct transfers with instruction context

Join transfers back to the source instruction via `instruction_id`:

```sql theme={null} theme={null}
SELECT
  t.block_time,
  t.tx_id,
  t.mint,
  t.source_owner,
  t.destination_owner,
  t.amount,
  i.instruction_name,
  i.executing_account
FROM solana.transfers AS t
JOIN solana.instructions AS i
  ON t.instruction_id = i.instruction_id
WHERE t.mint = '{mint}'
  AND t.action = 1
  AND i.action = 1
ORDER BY t.block_time DESC
LIMIT 50;
```

## Query tips

1. **Filter on indexed columns** — for transfers, lead with `mint` and `block_time`; for instructions, lead with `executing_account`, `instruction_name`, and `block_time`.
2. **Query wallets via owners** — SPL transfers expose token accounts in `source` / `destination`. Use `source_owner` / `destination_owner` (or `account_owners` on instructions) to filter by holder wallet.
3. **Use the `solana.*` prefix** — Solana tables use this prefix
4. **Scope to active rows** — filter `action = 1` (or `'added'`) the same way you would on Base; small re-orgs are possible at the tip. Prefer `instruction_id` as the stable id across reprocessing.
5. **Scope time ranges** — about 3 months of history is retained; always bound `block_time` for faster queries.

## Scope and limitations

* **Programs**: Instruction decoding focuses on SPL Token and Token-2022. `solana.transfers` also includes native SOL transfers from the System program.
* **Not a full instruction set**: Arbitrary program coverage is not available yet.
* **History**: Approximately 3 months of historical data available as of 12-Aug-2026 launch.
* **Beta**: Schema and coverage may change during public beta.

## Learn more

* [Schema reference](/data/sql-api/schema) — full `solana.instructions` and `solana.transfers` column definitions
* [Quickstart](/data/sql-api/quickstart) — run your first SQL API query
* [Best practices](/data/sql-api/best-practices) — indexing and query patterns
* [FAQ](/data/sql-api/faq) — networks, limits, and re-org handling
