zakkisyed2. Curve: weekly fee total
    Updated 2022-01-09
    select
    --distinct e2.pool_name, sum(e1.fee_usd), date_trunc('week', e2.block_timestamp) as week
    date_trunc('week', block_timestamp) as week, sum(fee_usd) as total_fee
    from ethereum.transactions
    /*as e1

    INNER JOIN ethereum.dex_swaps as e2
    ON e1.tx_id = e2.tx_id
    */
    where to_label = 'curve fi'
    or from_label = 'curve fi'



    and block_timestamp >= CURRENT_DATE - 365


    group by 1
    order by 1 desc

    /* select e1.tx_id, e2.tx_fee
    --sum(e2.fee_usd), e1.pool_name, date_trunc('week', e1.block_timestamp) as week

    from ethereum.dex_swaps as e1
    INNER JOIN ethereum.transactions as e2
    ON e1.tx_id = e2.tx_id
    where e1.platform = 'curve'
    and e1.block_timestamp = current_date - 60


    Run a query to Download Data