Skip to main content
Schema: 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_swaps and defi__ez_dex_swaps for swap-level analytics
  • Protocol attribution via swap_contract and platform fields
  • Token-level analytics via token0_contract and token1_contract

Commonly-used Fields

  • swap_contract: DEX pool contract address
  • deployment_timestamp: When the pool was deployed
  • token0_contract / token1_contract: Token contracts in the pool
  • pool_id: Unique identifier for the pool
  • vault_address: Address holding pool assets

Columns

Column NameData TypeDescription
SWAP_CONTRACTTEXTThe 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_TIMESTAMPTIMESTAMP_NTZThe block timestamp from the deployment transaction.
TOKEN0_CONTRACTTEXTThe contract for token0 in the swap pair. Positioning is determined by the order this token occurs in the Swap Contract creation transaction.
TOKEN1_CONTRACTTEXTThe contract for token1 in the swap pair. Positioning is determined by the order this token occurs in the Swap Contract creation transaction.
POOL_IDNUMBERThe ID of the swap pool, as designated by the DEX on contract creation.
VAULT_ADDRESSTEXTThe account address that holds tokens on behalf of the swap contract.
DIM_SWAP_POOL_LABELS_IDTEXTpk_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_TIMESTAMPTIMESTAMP_NTZThe 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_TIMESTAMPTIMESTAMP_NTZThe 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.