saeide-ahmadi-7Copy of Copy of Copy of Untitled Query
    Updated 2022-12-06
    with flow_prices as (
    select
    date(timestamp) as day,
    avg(price_usd) as priceusd
    from
    flow.core.fact_prices
    where
    token='Flow'
    group by
    1
    ), flow_mints as (
    select
    date(block_timestamp) as day,
    tx_id,
    split_part(event_contract, '.', 3) as collection_name
    from
    flow.core.fact_events
    where
    event_type='MomentNFTMinted' and
    tx_succeeded and
    event_contract in (
    'A.87ca73a41bb50ad5.Golazos',
    'A.0b2a3299cc857e29.TopShot',
    'A.e4cf4bdc1751c65d.AllDay'
    )
    ), flow_sales as (
    select
    date(block_timestamp) as day,
    tx_id,
    split_part(nft_collection, '.', 3) as collection_name,
    nft_id,
    buyer,
    case when currency = 'A.1654653399040a61.FlowToken' then price*priceusd else price end as volume
    from
    flow.core.ez_nft_sales s join flow_prices p on date(block_timestamp)=p.day
    where
    Run a query to Download Data