hbd1994Top Minters By Number of Mints - Barbie
    Updated 2023-10-11
    with base as (
    select
    BLOCK_TIMESTAMP as date,
    tx_id,
    EVENT_DATA:id as nft_id
    from flow.core.fact_events
    where event_contract = 'A.e5bf4d436ca23932.BBxBarbiePack'
    and EVENT_TYPE = 'Mint'
    and TX_SUCCEEDED = 'true'),

    base3 as
    (select
    tx_id,
    EVENT_DATA:to as minter
    from flow.core.fact_events
    where event_contract = 'A.e5bf4d436ca23932.BBxBarbiePack'
    and EVENT_TYPE = 'Deposit'
    and tx_id in (select distinct tx_id from base))

    select
    minter as "Minter",
    count(distinct nft_id) as "Minted NFTs",
    ("Minted NFTs" * 20) as "Generated USD Volume"
    from base
    join base3 using(tx_id)
    group by 1
    order by 2 desc
    limit 10

    Run a query to Download Data