nitsSales
    Updated 2022-07-11
    with asset as(select * from flipside_prod_db.algorand.asset
    where CREATOR_ADDRESS='CCNFTNFTSXVYGCGP5EU7AMUTQLUZI6TXRS4XMW2LP4XARZH3LB6RZPUOQM'
    and ASSET_DELETED='FALSE'
    and ASSET_NAME not in ('SINGULARITY ERA COMMEMORATIVE','Cosmic Champs Whitelist TOKEN') ),
    txs as
    (SELECT * from algorand.asset_transfer_transaction
    where asset_id in (select asset_id from asset )),
    assets_not_needed as
    (SELECT DISTINCT asset_id from algorand.asset
    where asset_id in
    (SELECT DISTINCT asset_id from algorand.asset_transfer_transaction
    where tx_group_id in
    (SELECT tx_group_id
    from algorand.payment_transaction
    where tx_group_id in (SELECT tx_group_id from txs ) and date(block_timestamp) < '2022-07-06'))
    and asset_id in (SELECT asset_id from asset )),
    actual_txs as
    (SELECT * from algorand.asset_transfer_transaction
    where asset_id in (select asset_id from asset ) and asset_id not in (SELECT * from assets_not_needed))

    SELECT date(block_timestamp) as day, sum(amount) as total_amt
    from algorand.payment_transaction
    where tx_group_id in (SELECT tx_group_id from actual_txs)
    GROUP by 1
    -- GROUP by 1
    limit 100

    -- 403bTPKq2EdQ+MbIqsfa03ONl+YZv7Ocpye/Io8ClT0=
    -- 7OKW755L2VYHRW6ZVDSZTPZNRYTRCQDRCNKUWIABACXTKPYP3IJA
    Run a query to Download Data