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

# Matched Transfers

> End-to-end cross-chain bridge transfers, pairing each outbound transaction with its corresponding inbound delivery.

`crosschain.bridges.matched_transfers` pairs outbound bridge transactions on the source chain with their corresponding inbound delivery transactions on the destination chain. Each row represents a single confirmed end-to-end bridge transfer with both legs reconciled, along with hydrated token amounts, USD values, spread, and latency metrics.

<Info>
  Only matched pairs are included — outbound transactions that could not be
  matched to an inbound delivery (e.g. in-flight, refunded, or missing data) are
  excluded from this view. Query the per-direction tables
  (`crosschain.bridges.bridges_outbound_transfers`,
  `crosschain.bridges.messaging_protocols_outbound_messages`,
  `crosschain.bridges.bridge_aggregators_outbound_transfers`) if you need to see
  unmatched outbound activity.
</Info>

## Protocol Coverage

Matched transfers are produced for 17 bridge and messaging protocols, grouped by `bridge_type`:

| **Bridge Type**      | **Protocols**                                                                                                   |
| -------------------- | --------------------------------------------------------------------------------------------------------------- |
| `bridge`             | across\_v3, debridge\_dln, debridge\_gate, gas\_zip\_lz\_v2, mayan\_mctp, mayan\_swift, stargate\_v2, usdt0     |
| `messaging_protocol` | axelar, chainlink\_ccip, circle\_cctp\_v1, circle\_cctp\_v2, hyperlane, layerzero\_v2, socket\_dl\_v1, wormhole |
| `bridge_aggregator`  | bungee\_v3                                                                                                      |

## Match Types

The `match_type` column describes how the outbound and inbound legs were paired:

* **`exact`**: deterministic join on a protocol-native identifier (e.g. `deposit_id`, LayerZero `guid`, CCTP nonce, Wormhole sequence, Axelar `command_id`, order hash).
* **`composite`**: joined on a combination of recipient address, token, amount, and a source→destination chain pair within a time window, for protocols where no single global identifier is emitted on both sides.

## Spread & Latency

* **`spread_percentage`** = `(outbound_usd_amount - inbound_usd_amount) / outbound_usd_amount * 100`. Nulled out when either USD amount is missing, the outbound amount is zero, or the absolute spread exceeds 25% (usually a sign of a mispriced token or mismatched pair).
* **`latency_seconds`** = seconds elapsed from outbound to inbound block timestamp. Can be **negative** for intent-based protocols (Across, DeBridge DLN, Mayan Swift) where fillers front funds on the destination chain before the source-side transaction is finalized. Nulled out when outside the `-3600s` to `86400s` range.

## Sample Queries

Average bridge latency and spread by protocol over the last 7 days.

```sql theme={null}
SELECT
    project,
    protocol,
    bridge_type,
    COUNT(*) AS matched_transfers,
    AVG(latency_seconds) AS avg_latency_seconds,
    MEDIAN(latency_seconds) AS median_latency_seconds,
    AVG(spread_percentage) AS avg_spread_pct,
    SUM(outbound_usd_amount) AS outbound_usd_volume
FROM crosschain.bridges.matched_transfers
WHERE outbound_block_timestamp >= CURRENT_TIMESTAMP - INTERVAL '7 days'
GROUP BY ALL
ORDER BY outbound_usd_volume DESC
```

Top cross-chain user flows (source → destination) by matched volume.

```sql theme={null}
SELECT
    CONCAT(source_chain, ' > ', destination_chain) AS flow,
    project,
    COUNT(*) AS transfers,
    COUNT(DISTINCT outbound_sender_address) AS unique_users,
    SUM(outbound_usd_amount) AS usd_volume
FROM crosschain.bridges.matched_transfers
WHERE outbound_block_timestamp >= CURRENT_TIMESTAMP - INTERVAL '30 days'
  AND outbound_usd_amount IS NOT NULL
GROUP BY ALL
ORDER BY usd_volume DESC
LIMIT 50
```

## Table Columns

Unique key: `unique_id`

| Column Name                  | Data Type         | Description                                                                                                                                                                                                                                  |
| ---------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| project                      | VARCHAR           | The project or product name (e.g., `across`, `stargate`, `layerzero`).                                                                                                                                                                       |
| protocol                     | VARCHAR           | The specific protocol version identifier (e.g., `across_v3`, `stargate_v2`, `layerzero_v2`).                                                                                                                                                 |
| match\_type                  | VARCHAR           | How the outbound and inbound legs were matched: `exact` (deterministic ID match) or `composite` (matched on recipient + amount within a time window).                                                                                        |
| bridge\_type                 | VARCHAR           | Classification of the protocol: `bridge`, `messaging_protocol`, or `bridge_aggregator`.                                                                                                                                                      |
| source\_chain                | VARCHAR           | The chain where the bridge transfer originates (outbound side).                                                                                                                                                                              |
| destination\_chain           | VARCHAR           | The chain where the bridge transfer is delivered (inbound side).                                                                                                                                                                             |
| outbound\_token\_address     | VARCHAR           | The contract address of the token sent on the source chain.                                                                                                                                                                                  |
| outbound\_token\_symbol      | VARCHAR           | Token ticker symbol on the source chain (e.g., `USDC`, `ETH`).                                                                                                                                                                               |
| outbound\_amount\_raw        | VARCHAR           | Raw outbound token amount, not adjusted for decimals.                                                                                                                                                                                        |
| outbound\_amount             | FLOAT             | Decimal-adjusted outbound token amount.                                                                                                                                                                                                      |
| outbound\_usd\_amount        | FLOAT             | USD value of the outbound transfer at the time of the transaction. NULL if price unavailable or exceeds the \$2B cap.                                                                                                                        |
| inbound\_token\_address      | VARCHAR           | The contract address of the token received on the destination chain.                                                                                                                                                                         |
| inbound\_token\_symbol       | VARCHAR           | Token ticker symbol on the destination chain.                                                                                                                                                                                                |
| inbound\_amount\_raw         | VARCHAR           | Raw inbound token amount, not adjusted for decimals.                                                                                                                                                                                         |
| inbound\_amount              | FLOAT             | Decimal-adjusted inbound token amount.                                                                                                                                                                                                       |
| inbound\_usd\_amount         | FLOAT             | USD value of the inbound transfer at the time of the transaction. NULL if price unavailable or exceeds the \$2B cap.                                                                                                                         |
| spread\_percentage           | FLOAT             | Percentage difference between outbound and inbound USD amounts: `(outbound - inbound) / outbound * 100`. NULL when either USD amount is missing, outbound is zero, or spread exceeds 25%.                                                    |
| outbound\_block\_timestamp   | TIMESTAMP\_NTZ(9) | Timestamp of the outbound (source chain) transaction.                                                                                                                                                                                        |
| inbound\_block\_timestamp    | TIMESTAMP\_NTZ(9) | Timestamp of the inbound (destination chain) transaction.                                                                                                                                                                                    |
| latency\_seconds             | BIGINT            | Time in seconds from outbound to inbound delivery. Can be negative for intent-based protocols where fillers front funds. NULL when outside the `-3600` to `86400` second range.                                                              |
| outbound\_sender\_address    | VARCHAR           | The address that initiated the bridge transfer on the source chain (the user).                                                                                                                                                               |
| inbound\_recipient\_address  | VARCHAR           | The address that received funds on the destination chain (the user).                                                                                                                                                                         |
| outbound\_transaction\_hash  | VARCHAR           | Transaction hash of the outbound bridge event on the source chain.                                                                                                                                                                           |
| inbound\_transaction\_hash   | VARCHAR           | Transaction hash of the inbound delivery event on the destination chain.                                                                                                                                                                     |
| outbound\_recipient\_address | VARCHAR           | The bridge contract or relayer address that received the outbound transfer on the source chain.                                                                                                                                              |
| inbound\_sender\_address     | VARCHAR           | The bridge contract or relayer address that sent the inbound transfer on the destination chain.                                                                                                                                              |
| outbound\_block\_number      | BIGINT            | Block height of the outbound transaction on the source chain.                                                                                                                                                                                |
| inbound\_block\_number       | BIGINT            | Block height of the inbound transaction on the destination chain.                                                                                                                                                                            |
| outbound\_unique\_id         | VARCHAR           | Unique identifier for the outbound leg. Joins back to the `unique_id` column of the corresponding outbound source table (`bridges_outbound_transfers`, `messaging_protocols_outbound_messages`, or `bridge_aggregators_outbound_transfers`). |
| inbound\_unique\_id          | VARCHAR           | Unique identifier for the inbound leg. Joins back to the `unique_id` column of the corresponding inbound source table (`bridges_inbound_transfers`, `messaging_protocols_inbound_messages`, or `bridge_aggregators_inbound_transfers`).      |
| join\_key                    | VARCHAR           | The protocol-specific key used to match outbound and inbound legs (e.g., `deposit_id`, `guid`, `nonce`, `order_id`).                                                                                                                         |
| unique\_id                   | VARCHAR           | A unique identifier for this matched transfer record.                                                                                                                                                                                        |
| \_created\_at                | TIMESTAMP\_NTZ(9) | Timestamp when this record was created in Allium.                                                                                                                                                                                            |
| \_updated\_at                | TIMESTAMP\_NTZ(9) | Timestamp when this record was last updated in Allium.                                                                                                                                                                                       |
