alleriaRand Gallery - New Wallets
    Updated 2022-05-25
    with rand as (
    select distinct
    tx_group_id
    from algorand.payment_transaction
    where receiver = 'RANDGVRRYGVKI3WSDG6OGTZQ7MHDLIN5RYKJBABL46K5RQVHUFV3NY5DUE'
    and tx_group_id is not null
    -- and date(block_timestamp) > CURRENT_DATE - 31
    order by 1
    ),

    nftsales as (
    select distinct
    b.tx_group_id,
    max(amount) as algo_amount
    from rand a
    join algorand.payment_transaction b
    on a.tx_group_id = b.tx_group_id
    --where block_timestamp::date >= current_date -30
    group by 1
    ),

    nftsales2 as (
    select
    date_trunc('day',block_timestamp) as day,
    a.tx_group_id,
    b.tx_id,
    b.sender,
    algo_amount
    from nftsales a
    join algorand.payment_transaction b
    on a.tx_group_id = b.tx_group_id
    and a.algo_amount = b.amount
    ),
    nftsales3 as (
    select
    Run a query to Download Data