boomer77foundation vs opensea fees
    Updated 2022-04-23
    with foundation as (SELECT date_trunc('day', block_timestamp) as dt,
    'foundation' as platform,
    count(distinct tx_hash) as tx_count,
    sum(event_inputs:f8nFee/1e18) as platform_fee,
    sum(event_inputs:creatorFee/1e18) as creator_fee,
    sum(event_inputs:ownerRev/1e18) as owner_rev
    from ethereum_core.fact_event_logs
    where contract_address = '0xcda72070e455bb31c7690a170224ce43623d0b6f' and event_name = 'ReserveAuctionFinalized' and date(block_timestamp) >= CURRENT_DATE - 90
    group by 1),

    raw as (SELECT block_timestamp, tx_id, event_platform, tx_currency, case
    when event_platform = 'opensea' and tx_currency is null then 'WETH'
    else tx_currency end as tx,
    platform_fee, creator_fee
    from ethereum.nft_events
    where date(block_timestamp) >= CURRENT_DATE - 90 and event_platform in ('opensea') and event_type = 'sale'
    and tx_id not in ('0x305e820e9b103693e047e41997da5ecaa0720d64f36023d9c0c0df41b8834416', '0x7aa5458c4dd4f7753b309893902144711b7a22d374b7c0e2b93a1fa8d699cc70')),

    opensea as (select date_trunc('day', block_timestamp) as dt,
    event_platform,
    count(distinct tx_id) as tx_count,
    sum(platform_fee) as platform_fee,
    sum(creator_fee) as creator_fee,
    0 as owner_rev
    from raw
    where tx = 'WETH'
    group by 1,2)

    select * from foundation
    union all
    select * from opensea
    --creator fee paid to artist (sale vol), owner_rev is secondary sale ??
    Run a query to Download Data