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

# Agentic Payments

> Machine-to-machine onchain payment activity across open HTTP 402 payment standards — x402 and MPP (onchain Tempo rails only).

The `payments.agentic_payments` table captures machine-to-machine onchain payment activity settled through open payment standards built on HTTP 402. The dataset covers two protocols:

* **x402** — an onchain-native payment standard. Payment settlement is fully trackable onchain via facilitator infrastructure.
* **MPP (Machine Payments Protocol)** — supports both onchain and offchain payment methods; this dataset tracks only its onchain Tempo rails: Tempo Charge (one-time onchain payments) and Tempo Session (onchain escrow and settlement, with offchain usage metering between onchain events).

Each row represents one onchain payment settlement — order creation, authorization, and intermediate protocol events that do not themselves settle onchain are excluded.

Agentic payments feed into `payments.commerce_flows` as a Tier A (label-based) source, classified as `party_pair = b2b`, `purpose = commerce`, `confidence = high`.

## Why this dataset matters

Agentic payments let AI agents and automated services pay each other onchain without human involvement. Tracking them separately makes it possible to:

* Measure the scale and growth of machine-to-machine payment activity.
* Attribute stablecoin transfers to specific agentic protocols (x402, MPP).
* Compare protocol adoption across chains and over time.

## Coverage

**Protocols:** x402, MPP (onchain Tempo rails only).

**Chains:** Base, Polygon, and Solana (x402); Tempo (MPP).

**x402 facilitators** are tracked via `facilitator_name`. New facilitators are added as they appear onchain.

## How detection works

Detection is protocol-specific:

* **x402** is identified via known facilitator addresses and decoded settlement patterns: EIP-3009 `transferWithAuthorization` (for USDC, EURC, and similar tokens), Permit2 (for other ERC-20 tokens), and SPL / Token-2022 on Solana. `settlement_pattern` is `NULL` for x402.
* **MPP** is identified via known Tempo payment infrastructure and decoded charge and session settlement patterns, captured in `settlement_pattern`: `charge` (per-request onchain payments) or `session` (onchain escrow / channel open / settle / close, with offchain usage metering in between).

Each row is linked to the underlying token transfer via `transfer_unique_key`, enabling downstream reuse in broader payments or stablecoin datasets.

## Table schema

Address columns are cast to `varchar` at the top level so that EVM (`varbinary`) and Solana addresses share a common type across the unioned schema.

| Column                   | Type      | Description                                                                                 |
| ------------------------ | --------- | ------------------------------------------------------------------------------------------- |
| `blockchain`             | varchar   | Chain name                                                                                  |
| `transfer_unique_key`    | varchar   | Unique transfer identifier; join key back to upstream stablecoin transfer tables            |
| `block_month`            | date      | Block month (partition key)                                                                 |
| `block_date`             | date      | Block date                                                                                  |
| `block_time`             | timestamp | Block timestamp                                                                             |
| `tx_hash`                | varchar   | Transaction hash                                                                            |
| `transfer_evt_index`     | bigint    | Event index of the underlying token transfer                                                |
| `activity_evt_index`     | bigint    | Event index of the protocol activity event; `NULL` where not applicable                     |
| `token_address`          | varchar   | Token contract address                                                                      |
| `token_symbol`           | varchar   | Token symbol, e.g. `USDC`, `USDT`                                                           |
| `sender`                 | varchar   | Raw transfer sender address                                                                 |
| `sender_label`           | varchar   | Role label for the sender: `payer` or `escrow_contract`                                     |
| `receiver`               | varchar   | Raw transfer receiver address                                                               |
| `receiver_label`         | varchar   | Role label for the receiver: `recipient`                                                    |
| `amount`                 | double    | Normalized token amount                                                                     |
| `amount_usd`             | double    | USD value at block time                                                                     |
| `amount_raw`             | uint256   | Raw token amount                                                                            |
| `tx_type`                | varchar   | Transaction type: `agentic_payment` (direct payment) or `agentic_fee` (protocol fee leg)    |
| `payment_protocol`       | varchar   | Protocol name: `x402` or `mpp`                                                              |
| `payer`                  | varchar   | Semantic payer address (may differ from `sender` for facilitated flows)                     |
| `recipient`              | varchar   | Semantic recipient / service provider address                                               |
| `facilitator_address`    | varchar   | Facilitator contract or infrastructure address (where applicable)                           |
| `facilitator_name`       | varchar   | Name of the facilitator (e.g. Coinbase, payAI)                                              |
| `settlement_pattern`     | varchar   | MPP settlement subtype: `charge` (per-request) or `session` (escrow-based); `NULL` for x402 |
| `escrow_contract`        | varchar   | Escrow or channel contract address for MPP `session` payments; `NULL` otherwise             |
| `protocol_infra_address` | varchar   | Protocol infrastructure contract address                                                    |

## Sample query

### Daily x402 agentic payment volume by facilitator

Distinct payer / recipient counts highlight the machine-to-machine shape — agentic payments cluster on small tickets across many fresh counterparty pairs.

```sql theme={null}
SELECT
    block_date,
    facilitator_name,
    COUNT(*)                   AS payment_count,
    SUM(amount_usd)            AS volume_usd,
    APPROX_DISTINCT(payer)     AS distinct_payers,
    APPROX_DISTINCT(recipient) AS distinct_recipients
FROM payments.agentic_payments
WHERE
    block_date >= CURRENT_DATE - INTERVAL '14' day
    AND payment_protocol = 'x402'
    AND tx_type = 'agentic_payment'
GROUP BY 1, 2
ORDER BY block_date DESC, volume_usd DESC
```

## References

* [x402 protocol spec](https://x402.org)
* [MPP protocol spec](https://mpp.dev/protocol)
* [Tempo docs](https://docs.tempo.xyz)
