baymatUntitled Query
    Updated 2023-02-12
    with pools as(SELECT
    pool_name,
    pool_address,
    token0,
    token1
    FROM ETHEREUM.CORE.DIM_DEX_LIQUIDITY_POOLS
    WHERE pool_address = LOWER('0xceff51756c56ceffca006cd410b03ffc46dd3a58')
    limit 10
    ),
    get_token_details AS (SELECT
    name,
    symbol,
    decimals
    FROM ethereum.core.dim_contracts
    where address= (
    SELECT LOWER(token0)
    FROM pools
    )
    or address = (
    SELECT LOWER(token1)
    FROM pools
    )
    ),

    -- getting the token details and pool details
    token_details AS (SELECT
    pool_name,
    pool_address,
    token0.symbol AS token0_symbol,
    token1.symbol AS token1_symbol,
    token0.decimals AS token0_decimals,
    token1.decimals AS token1_decimals
    FROM pools
    LEFT JOIN get_token_details AS token0
    ON token0 = token0
    Run a query to Download Data