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

# Stellar Token Transfers

> Unified token transfer activity for native, issued, and contract-based assets on Stellar.

export const TableSample = ({tableName, tableSchema}) => <>
    <div className="hidden dark:block">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}&darkMode=true`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
    <div className="dark:hidden">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
  </>;

The `tokens_stellar.transfers` table contains token movement data for Stellar assets indexed on Dune. It brings native XLM, issued assets, and contract token activity into one table using a unified event model.

This dataset includes:

* Standard transfers between accounts, contracts, and other Stellar entities
* Mint, burn, clawback, and fee events in the same token-movement stream
* Coverage across classic Stellar operations and contract token activity
* Asset identifiers for native, issued, and contract-linked assets

<Info>
  This table represents unified token movement on Stellar, not just payment operations. It also includes system-level activity such as fees, mints, burns, and clawbacks, so exclude those if you want to focus only on regular user-to-user transfers.
</Info>

### Utility

The Stellar transfers table provides a consistent view of token movement on Stellar, enabling you to:

* Track token flows between wallets, issuers, and contracts
* Analyze transfer activity by asset, operation type, and day
* Separate regular transfers from mint, burn, clawback, and fee activity
* Compare classic Stellar operations with contract token events

### Methodology

According to the official Stellar docs, token transfers are standardized through [CAP-67](https://stellar.org/protocol/cap-67) unified events and the [Token Transfer Processor (TTP)](https://developers.stellar.org/docs/data/indexers/build-your-own/processors/token-transfer-processor), which derives token movement from ledger data across both classic operations and contract-based activity.

The `tokens_stellar.transfers` table is built around that event model:

* It standardizes token movement into a shared set of event topics: `transfer`, `mint`, `burn`, `clawback`, and `fee`.
* It captures activity from classic Stellar operations such as payments, path payments, DEX offer execution, claimable balances, liquidity pool actions, account merges, and clawbacks.
* It also includes contract token events, where `is_soroban = true` and `event_type` is commonly `invoke_host_function`.
* `event_type` shows the originating operation or execution path, while `event_topic` shows the normalized token-movement category.
* `contract_id` is populated on every event as the standardized asset identifier used across native, issued, and contract tokens.

Because fee events are part of the same stream, not every row has both a sender and receiver. For example, fee rows usually have a `from` account but no `to` account.

The `from` and `to` columns can contain multiple Stellar address types. The prefix identifies the entity type, so you may see `G...` accounts, `C...` contracts, `B...` claimable balances, and `L...` liquidity pools.

## Table Schema

| Column             | Type                       | Description                                                                                                   |
| ------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `unique_key`       | `VARCHAR`                  | Surrogate key to identify a unique transfer row                                                               |
| `blockchain`       | `VARCHAR`                  | Blockchain name; always `stellar`                                                                             |
| `block_month`      | `DATE`                     | Month of the ledger close time                                                                                |
| `block_date`       | `DATE`                     | Date of the ledger close time                                                                                 |
| `block_time`       | `TIMESTAMP`                | Ledger close timestamp                                                                                        |
| `ledger_sequence`  | `BIGINT`                   | Ledger sequence number                                                                                        |
| `transaction_hash` | `VARBINARY`                | Hex-encoded transaction hash                                                                                  |
| `transaction_id`   | `BIGINT`                   | Unique transaction identifier                                                                                 |
| `operation_id`     | `BIGINT`                   | Operation identifier; `NULL` for Soroban events                                                               |
| `token_standard`   | `VARCHAR`                  | Token standard label: `native`, `classic`, or `soroban`                                                       |
| `from`             | `VARCHAR`                  | Source address for the token movement; may be an account, contract, claimable balance, or liquidity pool      |
| `to`               | `VARCHAR`                  | Destination address for the token movement; may be an account, contract, claimable balance, or liquidity pool |
| `to_muxed`         | `VARCHAR`                  | Multiplexed destination account when present                                                                  |
| `to_muxed_id`      | `VARCHAR`                  | Multiplexed destination account ID when present                                                               |
| `contract_id`      | `VARCHAR`                  | Standardized contract identifier for the asset on every event                                                 |
| `asset`            | `VARCHAR`                  | Asset identifier; for issued assets this is typically `asset_code:asset_issuer`                               |
| `asset_type`       | `VARCHAR`                  | Stellar asset type such as `native`, `credit_alphanum4`, `credit_alphanum12`, or `soroban`                    |
| `asset_code`       | `VARCHAR`                  | Asset code for protocol-issued, non-contract assets when applicable                                           |
| `asset_issuer`     | `VARCHAR`                  | Issuer address for protocol-issued, non-contract assets when applicable                                       |
| `symbol`           | `VARCHAR`                  | Token symbol                                                                                                  |
| `decimals`         | `INTEGER`                  | Number of decimals used to scale `amount_raw`                                                                 |
| `amount_raw`       | `DOUBLE`                   | Raw token amount in base units                                                                                |
| `amount`           | `DOUBLE`                   | Normalized token amount                                                                                       |
| `price_usd`        | `DOUBLE`                   | USD price used to calculate `amount_usd`; populated for native XLM pricing                                    |
| `amount_usd`       | `DOUBLE`                   | USD value of the transfer; populated for native XLM pricing                                                   |
| `event_topic`      | `VARCHAR`                  | Normalized token event category: `transfer`, `mint`, `burn`, `clawback`, or `fee`                             |
| `event_type`       | `VARCHAR`                  | Underlying Stellar operation or execution type that produced the event                                        |
| `is_soroban`       | `BOOLEAN`                  | Whether the event came from contract token activity                                                           |
| `_updated_at`      | `TIMESTAMP WITH TIME ZONE` | Timestamp when the curated row was last written                                                               |

<TableSample tableSchema="tokens_stellar" tableName="transfers" />

## Sample Queries

**Query token movement for a specific Stellar address**

This query returns incoming and outgoing token events with populated normalized amounts for a wallet during a historical window:

```sql theme={null}
SELECT
    block_time,
    transaction_hash,
    asset,
    event_topic,
    event_type,
    CASE
        WHEN "from" = 'GAUA7XL5K54CC2DDGP77FJ2YBHRJLT36CPZDXWPM6MP7MANOGG77PNJU' THEN 'Outgoing'
        WHEN "to" = 'GAUA7XL5K54CC2DDGP77FJ2YBHRJLT36CPZDXWPM6MP7MANOGG77PNJU' THEN 'Incoming'
    END AS direction,
    amount
FROM tokens_stellar.transfers
WHERE (
        "from" = 'GAUA7XL5K54CC2DDGP77FJ2YBHRJLT36CPZDXWPM6MP7MANOGG77PNJU'
        OR "to" = 'GAUA7XL5K54CC2DDGP77FJ2YBHRJLT36CPZDXWPM6MP7MANOGG77PNJU'
    )
    AND event_topic <> 'fee'
    AND block_time >= TIMESTAMP '2025-11-24 00:00:00 UTC'
    AND block_time < TIMESTAMP '2025-12-01 00:00:00 UTC'
ORDER BY block_time DESC
LIMIT 100
```

**Calculate daily transfer volume for a specific Stellar asset**

This query aggregates daily transfer activity for issued USDC during a historical window:

```sql theme={null}
SELECT
    date_trunc('day', block_time) AS day,
    asset,
    COUNT(*) AS num_rows,
    SUM(amount) AS total_amount
FROM tokens_stellar.transfers
WHERE asset = 'USDC:GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN'
    AND event_topic = 'transfer'
    AND block_time >= TIMESTAMP '2025-11-01 00:00:00 UTC'
    AND block_time < TIMESTAMP '2025-12-01 00:00:00 UTC'
GROUP BY 1, 2
ORDER BY 1 DESC
```

**Split Stellar token activity by event category and source**

This query helps distinguish transfers from mints, burns, clawbacks, and fees, while also separating classic and contract-based activity during a historical window with populated normalized amounts:

```sql theme={null}
SELECT
    date_trunc('day', block_time) AS day,
    event_topic,
    COALESCE(CAST(is_soroban AS VARCHAR), 'false') AS soroban_flag,
    COUNT(*) AS num_rows,
    SUM(amount) AS total_amount
FROM tokens_stellar.transfers
WHERE block_time >= TIMESTAMP '2025-11-01 00:00:00 UTC'
    AND block_time < TIMESTAMP '2025-12-01 00:00:00 UTC'
    AND asset = 'native'
GROUP BY 1, 2, 3
ORDER BY 1 DESC, 2, 3
```
