pcwcfaEthereum_Core Table Walkthough: WBTC-WETH Pool on Sushiswap
    Updated 2022-06-26
    WITH pools AS (
    SELECT
    pool_name,
    pool_address,
    token0,
    token1
    FROM
    ETHEREUM_CORE.DIM_DEX_LIQUIDITY_POOLS
    WHERE
    pool_address = LOWER('0xceff51756c56ceffca006cd410b03ffc46dd3a58') -- WBTC-WETH Sushiswap Pool address
    ),ethereum.core.fact_event_logsethereum.core.fact_event_logsethereum.core.fact_event_logs

    -- get details for tokens in the relevant pool
    decimals AS (
    SELECT
    address,
    symbol,
    decimals
    FROM
    ETHEREUM_CORE.DIM_CONTRACTS
    WHERE
    address = (
    SELECT
    LOWER(token1)
    FROM
    pools
    )
    OR address = (
    SELECT
    LOWER(token0)
    FROM
    pools
    )
    ),
    -- aggregate pool and token details
    Run a query to Download Data