Afonso_Diaztop collections
    Updated 2024-09-01
    with

    pricet as (
    select
    hour::date as date,
    avg(price) as price_usd
    from
    flow.price.ez_prices_hourly
    where symbol = 'FLOW'
    group by 1
    ),

    sales as (
    select
    tx_id,
    seller,
    buyer,
    price,
    block_timestamp,
    nft_collection,
    marketplace,
    case currency
    when 'A.ead892083b3e2c6c.DapperUtilityCoin' then 'USDC'
    when 'A.1654653399040a61.FlowToken' then 'FLOW'
    when 'A.3c5959b568896393.FUSD' then 'FUSD'
    when 'A.ead892083b3e2c6c.FlowUtilityToken' then 'FLOW'
    end as symbol,
    price * iff(symbol = 'FLOW', price_usd, 1) as price_usd
    from
    flow.nft.ez_nft_sales
    left join
    pricet on block_timestamp::date = date
    where
    tx_succeeded = 1
    and symbol is not null
    )
    QueryRunArchived: QueryRun has been archived