0xCD5bCf7c05670E3dda2e8Dc576d1C4cfDd090150blur season 2 leaderboard copy
    Updated 2023-04-17
    -- forked from ahkek76 / blur season 2 leaderboard @ https://flipsidecrypto.xyz/ahkek76/q/2023-04-14-10-35-pm-bxooEV

    with bid as (
    select count(distinct tokenId) as nft_bid_won_count, sum(price) as total_eth_bid_accept,
    buyer_address
    from ethereum.core.ez_nft_sales
    where platform_name = 'blur'
    and block_timestamp::date > '2023-02-13'
    and event_type = 'bid_won'
    group by 3
    ),

    listing_approved_all as (
    select count(distinct tx_hash) as listing, --contract_address as nft_addres,
    decoded_log:owner::string as seller
    from ethereum.core.fact_decoded_event_logs
    where decoded_log:approved = 'true'
    and decoded_log:operator = '0x00000000000111abe46ff893f3b2fdf1f759a8a8'
    and block_timestamp::date > '2023-02-13'
    group by 2
    ),

    blur_pool as (
    select sum(eth_deposit) as current_eth_blur_pool, depositor
    from (
    select sum(raw_amount/1e18) as eth_deposit,
    to_address as depositor
    from ethereum.core.fact_token_transfers
    WHERE contract_address = '0x0000000000a39bb272e79075ade125fd351887ac'
    and from_address = '0x0000000000000000000000000000000000000000'
    and block_timestamp::date > '2023-02-13'
    group by 2
    union
    select sum(raw_amount/-1e18) as eth_deposit,
    from_address as depositor
    from ethereum.core.fact_token_transfers
    Run a query to Download Data