iboo-jbj2MVgALGO3 swaps_to on( tinyman and pactfi)
    Updated 2022-05-02
    with a as(SELECT date_trunc('day',BLOCK_TIMESTAMP) as day,count(distinct TX_GROUP_ID) as tinyman_from_gALGO3_transactions
    from algorand.swaps
    where SWAP_FROM_ASSET_ID='694432641' and SWAP_FROM_AMOUNT>0 and SWAP_PROGRAM='tinyman' group by 1),
    b as(SELECT date_trunc('day',BLOCK_TIMESTAMP) as day,count(distinct TX_GROUP_ID) as tinyman_to_gALGO3_transactions
    from algorand.swaps
    where SWAP_TO_ASSET_ID='694432641' and SWAP_FROM_AMOUNT>0 and SWAP_PROGRAM='tinyman' group by 1),
    c as(SELECT date_trunc('day',BLOCK_TIMESTAMP) as day,count(distinct TX_GROUP_ID) as pactfi_from_gALGO3_transactions
    from algorand.swaps
    where SWAP_FROM_ASSET_ID='694432641' and SWAP_FROM_AMOUNT>0 and SWAP_PROGRAM='pactfi' group by 1),
    d as(SELECT date_trunc('day',BLOCK_TIMESTAMP) as day,count(distinct TX_GROUP_ID) as pactfi_to_gALGO3_transactions
    from algorand.swaps
    where SWAP_TO_ASSET_ID='694432641' and SWAP_FROM_AMOUNT>0 and SWAP_PROGRAM='pactfi' group by 1)
    SELECT a.day,tinyman_from_gALGO3_transactions,pactfi_from_gALGO3_transactions,tinyman_to_gALGO3_transactions,pactfi_to_gALGO3_transactions
    from a join b on a.day=b.day left join c on a.day=c.day left join d on a.day=d.day order by 1 desc
    Run a query to Download Data