flow.defi Table: dim_swap_pool_labels Type: View
Description
Models all DEX swap pool and pair creation events on the Flow blockchain. Captures metadata for each pool, including token contracts, deployment timestamp, pool ID, vault address, and swap contract. Supports pool-level analytics, liquidity tracking, and protocol attribution. Data is sourced from on-chain pool creation events and normalized for analytics.Key Use Cases
- Analyze DEX pool creation and liquidity provisioning
- Attribute swaps to specific pools and protocols
- Track pool deployment and vault addresses
- Support liquidity, TVL, and protocol market share analysis
- Power DeFi dashboards and pool explorer tools
Important Relationships
- Can be joined with
defi__fact_dex_swapsanddefi__ez_dex_swapsfor swap-level analytics - Protocol attribution via
swap_contractandplatformfields - Token-level analytics via
token0_contractandtoken1_contract
Commonly-used Fields
swap_contract: DEX pool contract addressdeployment_timestamp: When the pool was deployedtoken0_contract/token1_contract: Token contracts in the poolpool_id: Unique identifier for the poolvault_address: Address holding pool assets
Columns
| Column Name | Data Type | Description |
|---|---|---|
| SWAP_CONTRACT | TEXT | The smart contract address of the DEX swap pool or liquidity pool involved in the transaction. Data type: STRING. This field identifies the specific contract facilitating the swap, which is essential for protocol attribution, pool-level analytics, and tracing liquidity movements. For Metapier swaps, all pools may use the same master contract (e.g., ‘A.609e10301860b683.PierPair’), so the ‘pool_id’ is required to differentiate between pools. Example: ‘A.609e10301860b683.PierPair’ for Metapier, or a unique contract address for other DEXs. Important for understanding liquidity routing, protocol usage, and swap path analysis. |
| DEPLOYMENT_TIMESTAMP | TIMESTAMP_NTZ | The block timestamp from the deployment transaction. |
| TOKEN0_CONTRACT | TEXT | The contract for token0 in the swap pair. Positioning is determined by the order this token occurs in the Swap Contract creation transaction. |
| TOKEN1_CONTRACT | TEXT | The contract for token1 in the swap pair. Positioning is determined by the order this token occurs in the Swap Contract creation transaction. |
| POOL_ID | NUMBER | The ID of the swap pool, as designated by the DEX on contract creation. |
| VAULT_ADDRESS | TEXT | The account address that holds tokens on behalf of the swap contract. |
| DIM_SWAP_POOL_LABELS_ID | TEXT | pk_id is a surrogate primary key, uniquely generated for each row in the table. Data type: STRING or INTEGER (implementation-specific). This field ensures every record is uniquely identifiable, even if the source data lacks a natural primary key. Used for efficient joins, deduplication, and as a reference in downstream models. Example: an auto-incremented integer or a UUID string. Essential for maintaining data integrity and supporting dbt tests for uniqueness. |
| INSERTED_TIMESTAMP | TIMESTAMP_NTZ | The UTC timestamp when the record was first created and inserted into this table. Data type: TIMESTAMP_NTZ. Used for ETL auditing, tracking data freshness, and identifying when data was loaded or updated in the analytics pipeline. Example: ‘2023-01-01 12:00:00’. This field is critical for monitoring data latency, troubleshooting ETL issues, and supporting recency tests in dbt. |
| MODIFIED_TIMESTAMP | TIMESTAMP_NTZ | The UTC timestamp when this record was last updated or modified by an internal ETL or dbt process. Data type: TIMESTAMP_NTZ. Used for change tracking, ETL auditing, and identifying the most recent update to a record. Example: ‘2023-01-02 15:30:00’. This field is important for troubleshooting data issues, monitoring pipeline health, and supporting recency or freshness tests in dbt. |