PapasotOctorand sales
    Updated 2023-01-02
    with Octorands as (

    select *
    from algorand.asset
    where asset_name like '%Octorand #%' or asset_name like '%Octo Prime Gen2%'
    and ASSET_DELETED= false
    order by asset_name)

    select
    date_trunc('day',block_timestamp) as block_day,
    count(tx_group_id) as Sales,
    CASE
    when asset_name like '%Octo Prime Gen2%' then 'Gen2'
    when asset_name like '%Octorand #%' then 'Gen1'
    end as generation

    from algorand.asset_transfer_transaction
    left join Octorands b using (asset_id)
    where asset_amount = '1'
    and generation is not null
    and tx_group_id is not null
    --and b.creator_address= 'D5J7H7PIYKLY2U6A5OFUAC7GQHTHSXXNX65DSD3CJYPBV2MVK6NTNW44CA'
    group by block_day,generation
    order by block_day
    Run a query to Download Data