somnia.defi Table: dim_dex_liquidity_pools Type: View
What
This dimensional table contains comprehensive metadata for all DEX liquidity pools across supported protocols. It provides essential information about pool composition, token pairs, and configuration needed for analyzing liquidity provision and pool performance.Key Use Cases
- Finding all pools containing specific tokens
- Tracking new pool deployments
- Analyzing pool configurations and fee structures
- Identifying trading pairs across different protocols
- Monitoring factory contract deployments
Important Relationships
- Join with ez_dex_swaps: Use
pool_addressto get swap activity - Join with dim_contracts: Use token addresses for additional metadata
- Self-join: Find all pools with common tokens
Commonly-used Fields
pool_address: Unique identifier for the liquidity poolplatform: DEX protocol (uniswap_v3, curve, etc.)pool_name: Human-readable pool identifiertokens: JSON with token0 and token1 addressessymbols: JSON with token0 and token1 symbolscreation_time: When pool was deployed
Sample queries
Columns
| Column Name | Data Type | Description |
|---|---|---|
| CREATION_BLOCK | NUMBER | The block number when the liquidity pool was first created. Example: 12369739 |
| CREATION_TIME | TIMESTAMP_NTZ | The timestamp when the liquidity pool was deployed. Example: ‘2021-05-05 12:34:56.000’ |
| CREATION_TX | TEXT | The transaction hash that deployed this liquidity pool. Example: ‘0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef’ |
| PLATFORM | TEXT | The DEX protocol where the swap occurred. Example: ‘uniswap_v3’ |
| PROTOCOL | TEXT | PROTOCOL column |
| PROTOCOL_VERSION | TEXT | PROTOCOL_VERSION column |
| FACTORY_ADDRESS | TEXT | The factory contract that deployed this liquidity pool. Example: ‘0x1f98431c8ad98523631ae4a59f267346ea31f984’ |
| POOL_ADDRESS | TEXT | The liquidity pool contract address where the swap executed. Example: ‘0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8’ |
| POOL_NAME | TEXT | Human-readable name for the liquidity pool. Example: ‘WETH/USDC 0.05%‘ |
| TOKENS | OBJECT | JSON object containing token contract addresses in the pool. Example: {"token0": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "token1": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"} |
| SYMBOLS | OBJECT | JSON object containing token symbols for the pool pair. Example: {"token0": "WETH", "token1": "USDC"} |
| DECIMALS | OBJECT | JSON object containing decimal places for each token in the pool. Example: {"token0": 18, "token1": 6} |
| DIM_DEX_LIQUIDITY_POOLS_ID | TEXT | Primary key - unique identifier for each row ensuring data integrity. Format: Usually VARCHAR containing composite key generated using MD5 hash of the relevant columns. Example: MD5(blocknumber, txhash, trace_index) Usage: Deduplication in incremental loads Join operations for data quality checks Troubleshooting specific records Important: Implementation varies by table - check table-specific documentation. |
| INSERTED_TIMESTAMP | TIMESTAMP_NTZ | UTC timestamp when the record was first added to the Flipside database. Format: TIMESTAMP_NTZ Use Cases: Data freshness monitoring Incremental processing markers Debugging data pipeline issues SLA tracking Query Example: |
| MODIFIED_TIMESTAMP | TIMESTAMP_NTZ | UTC timestamp of the most recent update to this record. Format: TIMESTAMP_NTZ Triggers for Updates: Data corrections Enrichment additions Reprocessing for accuracy Schema migrations Monitoring Usage: |