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

# Commerce Payment Protocol

### Table Details

| Property     | Value                                     |
| ------------ | ----------------------------------------- |
| Table Name   | `base.payments.commerce_payment_protocol` |
| Table Status | Production-Ready                          |
| Unique Key   | `transaction_hash`, `unique_id`           |

### Table Columns

| Column Name               | Data Type         | Description                                                                                                                                                                                             |
| ------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| block\_timestamp          | TIMESTAMP\_NTZ(9) | Timestamp (UTC) of the block that contains this record.                                                                                                                                                 |
| action                    | VARCHAR(9)        | High-level action or operation type for this record. Values are model-specific (e.g. `deposit`, `withdraw`, `stake`, `unstake` in staking models).                                                      |
| buyer\_address            | VARCHAR(16777216) | Address of the buyer in this NFT trade.                                                                                                                                                                 |
| merchant\_address         | VARCHAR(16777216) | Wallet address of the merchant receiving payment, decoded from the Commerce Protocol event data.                                                                                                        |
| amount                    | FLOAT             | Token amount normalized by the token's decimal precision (amount\_raw / 10^decimals). This is the human-readable value (e.g. 1.5 USDC rather than 1500000).                                             |
| amount\_str               | VARCHAR(16777216) | Normalized token amount stored as a string to preserve full precision. Equivalent to `amount` but avoids floating-point truncation for very large or very small values.                                 |
| usd\_amount               | FLOAT             | USD value of the token amount at the time of the event, computed using the hourly USD exchange rate.                                                                                                    |
| token\_address            | VARCHAR(42)       | Contract address of the token. For EVM chains, native currency (e.g. ETH, MATIC) is represented as the zero address (0x0000000000000000000000000000000000000000). For Solana, this is the mint address. |
| token\_name               | VARCHAR(16777216) | Full name of the token (e.g. "USD Coin", "Wrapped Ether").                                                                                                                                              |
| token\_symbol             | VARCHAR(16777216) | Ticker symbol of the token (e.g. "USDC", "WETH").                                                                                                                                                       |
| raw\_amount               | FLOAT             | Token amount in the smallest indivisible unit (not decimal-adjusted). Same concept as `amount_raw` — the column is named `raw_amount` in models that follow the `raw_` prefix convention.               |
| raw\_amount\_str          | VARCHAR(16777216) | Raw collateral amount in USDC base units (6 decimals), as a string.                                                                                                                                     |
| transaction\_hash         | VARCHAR(66)       | Hash of the transaction that produced this record. Uniquely identifies a transaction within the blockchain.                                                                                             |
| block\_number             | NUMBER(38,0)      | Sequential number of the block that contains this record. Starts at 0 (genesis block) and increments by 1 for each new block.                                                                           |
| payment\_id               | VARCHAR(66)       | Unique bytes32 identifier for this Commerce Protocol payment, emitted in the contract event and used to correlate deposits, releases, and refunds.                                                      |
| escrow\_contract\_address | VARCHAR(42)       | Address of the Commerce Protocol escrow contract holding funds for this payment until release or refund.                                                                                                |
| usd\_exchange\_rate       | FLOAT             | USD price per unit of the token at the time of the event, used to compute `usd_amount`. Sourced from Allium's hourly price feed.                                                                        |
| unique\_id                | VARCHAR(16777216) | Allium's deterministic unique identifier for this row. Generated from the fields that uniquely identify the record (e.g. transaction hash + log index). Stable across full refreshes.                   |
| \_created\_at             | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was created in the database.                                                                                                                                                |
| \_updated\_at             | TIMESTAMP\_NTZ(9) | Timestamp of when the entry was last updated in the database.                                                                                                                                           |
