mlhEmissions (Rewards) of Each Pool Breakdown by Quarter
    Updated 2022-12-07
    -- #Credit: https://dune.com/queries/1261248/2161770
    WITH bayc AS (--credit to alik110
    select user_address as NFT_Holder,
    current_bal_unadj as Balance
    from ethereum.core.ez_current_balances
    where contract_address = '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
    and current_bal_unadj > 0),

    mayc AS (
    select user_address as NFT_Holder,
    current_bal_unadj as Balance
    from ethereum.core.ez_current_balances
    where contract_address = '0x60e4d786628fea6478f785a6d7e704777c86a7c6'
    and current_bal_unadj > 0),

    bakc AS (
    select user_address as NFT_Holder,
    current_bal_unadj as Balance
    from ethereum.core.ez_current_balances
    where contract_address = '0xba30e5f9bb24caa003e9f2f0497ad287fdf95623'
    and current_bal_unadj > 0
    ),

    owners AS (SELECT NFT_Holder FROM bayc UNION SELECT NFT_Holder FROM mayc UNION SELECT NFT_Holder FROM bakc),

    apecoin AS (
    select user_address as APE_Holder,
    sum (current_bal) as holding
    from ethereum.core.ez_current_balances
    where contract_address ='0x4d224452801aced8b2f0aebe155379bb5d594381'
    and user_address in (select nft_holder from owners)
    group by 1),

    totalValidHoldings as (
    SELECT c.APE_Holder,
    c.holding,
    Run a query to Download Data