headitmanagerUnstaking
    Updated 2022-03-16
    with Staking as (
    select sum(algorand.asset_transfer_transaction.asset_amount/pow(10,6)) as samount
    ,algorand.transactions.block_timestamp::date as tdate
    from algorand.transactions
    inner join algorand.asset_transfer_transaction
    on algorand.transactions.tx_group_id=algorand.asset_transfer_transaction.tx_group_id
    where
    try_base64_decode_string(algorand.transactions.tx_message:txn:note::string) = 'Market: mt'
    and algorand.asset_transfer_transaction.asset_id=465865291
    and algorand.asset_transfer_transaction.asset_receiver='DYLJJES76YQCOUK6D4RALIPJ76U5QT7L6A2KP6QTOH63OBLFKLTER2J6IA'
    group by tdate
    )
    ,Unstaking as (
    select sum(tx_message:dt:itx[0]:txn:aamt ::number/pow(10,6)) as unsamount ,block_timestamp::date as tdate
    from algorand.transactions
    where
    try_base64_decode_string(tx_message:txn:note::string) = 'Market: rcu'
    and TX_TYPE_NAME='application call'
    and tx_message:txn:apid=482608867
    group by tdate
    )
    ,Wallets as (select count(distinct algorand.transactions.sender) as sender, algorand.transactions.block_timestamp::date as tdate
    from algorand.transactions
    inner join algorand.asset_transfer_transaction
    on algorand.transactions.tx_group_id=algorand.asset_transfer_transaction.tx_group_id
    where
    try_base64_decode_string(algorand.transactions.tx_message:txn:note::string) = 'Market: mt'
    and algorand.asset_transfer_transaction.asset_id=465865291
    and algorand.asset_transfer_transaction.asset_receiver='DYLJJES76YQCOUK6D4RALIPJ76U5QT7L6A2KP6QTOH63OBLFKLTER2J6IA'
    group by tdate)

    ,sum_Staking as (
    select sum(samount) as s from Staking
    )
    ,sum_Unstaking as (
    select sum(unsamount) as uns from Unstaking
    Run a query to Download Data