boomer77Opensea Polygon Collected Fees WETH only
    Updated 2022-11-28
    with opensea_fees as (select date_trunc('week', block_timestamp) as block_week, sum(event_inputs:value/1e18) as fees, contract_name
    from polygon.events_emitted
    where event_inputs:to::string = '0x5b3256965e7c3cf26e11fcaf296dfc8807c01073' --opensea wallet address
    and contract_name = 'weth'
    group by 1,3),

    eth as (select date_trunc('week', hour) as block_week, avg(price) as price
    from ethereum.token_prices_hourly
    where symbol = 'ETH'
    group by 1)

    select a.block_week, a.fees as Fees_ETH, b.price as ETH_Price, (a.fees*b.price) as Fees_USD
    from opensea_fees a
    join eth b on a.block_week = b.block_week
    Run a query to Download Data