winnie-fssparkling-silver
    Updated 2024-09-18
    with eth_pools AS (
    select
    'ethereum' as chain,
    pool_address, pool_name,
    case
    when pool_name LIKE '% 100 %' then 0.0001
    when pool_name LIKE '% 500 %' then 0.0005
    when pool_name LIKE '% 3000 %' then 0.003
    when pool_name LIKE '% 10000 %' then 0.01
    end as fee_tier,
    tokens:token0::VARCHAR as token0,
    symbols:token0::VARCHAR as symbol0,
    tokens:token1::VARCHAR as token1,
    symbols:token1::VARCHAR as symbol1
    from ethereum.defi.dim_dex_liquidity_pools
    where platform = 'uniswap-v3'
    and POOL_NAME ILIKE '%ETH%'
    and POOL_NAME ILIKE '%USDC%'
    and (
    tokens:token0 = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')
    OR tokens:token1 = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48')
    )
    and (
    tokens:token0 = lower('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')
    OR tokens:token1 = lower('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2')
    )
    ),
    eth_trades AS (
    select
    chain,
    block_number,
    block_timestamp,
    tx_hash,
    pool_address,
    fee_tier,
    QueryRunArchived: QueryRun has been archived