mucrypto2023-06-03 01:35 AM
    Updated 2023-06-02
    with raw_swaps as (
    select
    block_timestamp::date as day,
    tx_hash,
    pool_name,
    symbol_in,
    symbol_out,
    amount_in_usd,
    amount_out_usd,
    sender,
    tx_to
    from ethereum.core.ez_dex_swaps
    where block_timestamp::date >= '2021-07-13'
    and platform = 'curve'),

    swap_tx_count_in as (
    select
    symbol_in,
    count(symbol_in) as swap_count_in
    -- count(symbol_in) as symbol_count
    from raw_swaps
    group by 1),

    swap_tx_count_out as (
    select
    symbol_out,
    count(symbol_in) as swap_count_out
    -- count(symbol_in) as symbol_count
    from raw_swaps
    group by 1),

    swap_tx_count as (
    select
    tx_to,
    count(distinct tx_hash) as swap_count
    from raw_swaps
    Run a query to Download Data