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

# XRPL Token Transfers

> Unified token transfer activity for native XRP, issued currencies, and AMM-related token movement on XRP Ledger.

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_xrpl.transfers` table contains token movement data for XRP Ledger assets indexed on Dune. It brings native XRP transfers, issued currency payments, checks, escrows, payment channel claims, and AMM-related token movement into one curated table.

This dataset includes:

* Native XRP and issued currency transfer rows
* Payment, check, escrow, payment channel, AMM deposit, and AMM withdraw activity
* Asset identifiers using `xrpl_asset_id`, issuer, currency, and currency hex fields
* USD valuation when an hourly USD price is available for the asset

<Info>
  This table represents token movement on XRP Ledger, not just simple `Payment` transactions. It also includes AMM liquidity movements and other transaction types that move XRP or issued currencies, so filter by `transfer_type` or `transaction_type` when you need a narrower view.
</Info>

### Utility

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

* Track flows of XRP and issued currencies between XRPL accounts
* Analyze transfer activity by asset, issuer, transaction type, and day
* Separate regular payments from checks, escrows, payment channels, and AMM liquidity activity
* Monitor partial payments and transaction results alongside the normalized transfer amount

### Methodology

According to the official XRP Ledger docs, [fungible assets](https://xrpl.org/docs/concepts/tokens/fungible-tokens) include native XRP and issued currencies held through trust lines, while [`Payment`](https://xrpl.org/docs/references/protocol/transactions/types/payment) transactions can deliver XRP or issued currencies and may also use partial payment semantics. XRPL also has protocol-native checks, escrows, payment channels, and AMM deposit and withdraw transactions that can move assets.

The `tokens_xrpl.transfers` table is built around those XRPL transaction semantics:

* It keeps successful XRPL transactions that produce token movement, including `Payment`, `CheckCash`, `EscrowFinish`, `PaymentChannelClaim`, `AMMDeposit`, and `AMMWithdraw`.
* It normalizes native XRP and issued currencies into a shared transfer schema with `from`, `to`, `issuer`, `currency`, `symbol`, and `xrpl_asset_id`.
* It labels each row with both the underlying `transaction_type` and a normalized `transfer_type`, such as `payment`, `check_cash`, `escrow_finish`, `payment_channel_claim`, `amm_deposit`, `amm_withdraw`, `amm_lp_mint`, and `amm_lp_burn`.
* It carries `partial_payment_flag` for XRPL `Payment` rows where partial payment semantics apply.
* Native XRP uses 6 decimals; issued currencies may not have a decimal value populated because XRPL issued currencies use their own decimal representation.

### Pricing Methodology

The `price_usd` and `amount_usd` columns come from Dune's external hourly price feed for XRPL assets. If an asset has a price for that hour, the transfer row gets a USD price and value. If not, both columns stay `NULL`.

For more details on Dune's pricing methodology, see the [Prices documentation](/data-catalog/curated/prices/overview).

## Table Schema

| Column                 | Type                       | Description                                                                     |
| ---------------------- | -------------------------- | ------------------------------------------------------------------------------- |
| `unique_key`           | `VARCHAR`                  | Surrogate key to identify a unique transfer row                                 |
| `blockchain`           | `VARCHAR`                  | Blockchain name; always `xrpl`                                                  |
| `block_month`          | `DATE`                     | Month of the ledger close time                                                  |
| `block_date`           | `DATE`                     | Date of the ledger close time                                                   |
| `block_time`           | `TIMESTAMP WITH TIME ZONE` | Ledger close timestamp                                                          |
| `block_number`         | `BIGINT`                   | XRPL ledger index                                                               |
| `tx_hash`              | `VARCHAR`                  | Transaction hash                                                                |
| `token_standard`       | `VARCHAR`                  | Token standard label, such as `native` or `issued`                              |
| `tx_from`              | `VARCHAR`                  | Account that submitted the transaction                                          |
| `tx_to`                | `VARCHAR`                  | Destination account from the transaction when available                         |
| `tx_index`             | `BIGINT`                   | Transaction index within the ledger                                             |
| `from`                 | `VARCHAR`                  | Source account for the token movement                                           |
| `to`                   | `VARCHAR`                  | Destination account for the token movement                                      |
| `xrpl_asset_id`        | `VARCHAR`                  | Dune asset identifier for the XRPL asset                                        |
| `issuer`               | `VARCHAR`                  | Issuer account for issued currencies; native XRP uses the native XRP identifier |
| `currency`             | `VARCHAR`                  | XRPL currency code or native XRP symbol                                         |
| `currency_hex`         | `VARCHAR`                  | Hex-encoded currency code when applicable                                       |
| `symbol`               | `VARCHAR`                  | Display symbol for the asset                                                    |
| `decimals`             | `INTEGER`                  | Number of decimals used to scale `amount_raw` when available                    |
| `amount_raw`           | `DOUBLE`                   | Raw amount from the XRPL transfer representation                                |
| `amount`               | `DOUBLE`                   | Normalized transfer amount                                                      |
| `price_usd`            | `DOUBLE`                   | Hourly USD price used to calculate `amount_usd`                                 |
| `amount_usd`           | `DOUBLE`                   | USD value of the transfer                                                       |
| `transfer_type`        | `VARCHAR`                  | Normalized transfer category                                                    |
| `transaction_type`     | `VARCHAR`                  | Underlying XRPL transaction type                                                |
| `transaction_result`   | `VARCHAR`                  | XRPL transaction result code                                                    |
| `partial_payment_flag` | `BOOLEAN`                  | Whether the transaction used XRPL partial payment semantics                     |
| `_updated_at`          | `TIMESTAMP WITH TIME ZONE` | Timestamp when the curated row was last written                                 |

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

## Sample Queries

**Query token movement for a specific XRPL account**

This query returns recent incoming and outgoing token transfers for an XRPL account:

```sql theme={null}
SELECT
    block_time,
    tx_hash,
    symbol,
    transfer_type,
    transaction_type,
    CASE
        WHEN "from" = 'r3CUuqXukpx393PvgP6Cn2z3kx5vPmesWf' THEN 'Outgoing'
        WHEN "to" = 'r3CUuqXukpx393PvgP6Cn2z3kx5vPmesWf' THEN 'Incoming'
    END AS direction,
    amount,
    amount_usd
FROM tokens_xrpl.transfers
WHERE (
        "from" = 'r3CUuqXukpx393PvgP6Cn2z3kx5vPmesWf'
        OR "to" = 'r3CUuqXukpx393PvgP6Cn2z3kx5vPmesWf'
    )
    AND block_date >= current_date - interval '30' day
ORDER BY block_time DESC
LIMIT 100
```

**Calculate daily transfer volume for native XRP**

This query aggregates recent native XRP transfer activity:

```sql theme={null}
SELECT
    block_date,
    symbol,
    COUNT(*) AS num_rows,
    SUM(amount) AS total_amount,
    SUM(amount_usd) AS total_amount_usd
FROM tokens_xrpl.transfers
WHERE xrpl_asset_id = 'xrp'
    AND block_date >= current_date - interval '30' day
GROUP BY 1, 2
ORDER BY 1 DESC
```

**Split XRPL activity by transfer type**

This query separates regular payments from checks, escrows, payment channels, and AMM activity:

```sql theme={null}
SELECT
    block_date,
    transfer_type,
    transaction_type,
    COUNT(*) AS num_rows,
    SUM(amount) AS total_amount,
    SUM(amount_usd) AS total_amount_usd
FROM tokens_xrpl.transfers
WHERE block_date >= current_date - interval '30' day
GROUP BY 1, 2, 3
ORDER BY 1 DESC, 4 DESC
```
