barbodThe daily NFT sale volume in( # of sales - ALGOs and USD)
    Updated 2022-05-13
    with Auction as (select
    tx_group_id
    from algorand.transactions
    where block_timestamp::date >= '2022-01-01'
    and try_base64_decode_string(tx_message:txn:apaa[0]::string) = 'close_auction'
    group by 1
    ),
    Auction_amount as (
    select tx_group_id , sum(amount) as amount
    from algorand.payment_transaction
    where tx_group_id in (select * from Auction )
    group by 1
    ),
    buy_now_shuffle_tx_group_ids as (
    select tx_group_id
    from algorand.payment_transaction
    where RECEIVER = 'XNFT36FUCFRR6CK675FW4BEBCCCOJ4HOSMGCN6J2W6ZMB34KM2ENTNQCP4'
    and block_timestamp::date >= '2022-01-01'
    group by 1
    ),
    buy_now_shuffle_tx_group_ids_amount as (
    select tx_group_id , sum(amount) as amount
    from algorand.payment_transaction
    where tx_group_id in (select * from buy_now_shuffle_tx_group_ids )
    group by 1
    ),
    all_ as (
    select * from Auction_amount
    UNION
    select * from buy_now_shuffle_tx_group_ids_amount
    ),
    amounts as ( select
    date_trunc('hour',block_timestamp ) as date ,
    count (DISTINCT t.tx_group_id) as num_transactions ,
    sum (amount) as ALGO_volume,
    sum(amount*price_usd) as USD_volume