binhachonStaking STBL on AlgoFi
Updated 2022-05-18
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with stake_tx_group_id as (
select
distinct tx_group_id
from algorand.application_call_transaction
where app_id = 482608867
and try_base64_decode_string(tx_message:txn:note::string) = 'Market: mt'
),
stake_transaction as (
select
block_timestamp,
sender,
asset_amount/1e6 as amount
from algorand.asset_transfer_transaction
where tx_group_id in (select tx_group_id from stake_tx_group_id)
and asset_transferred = 465865291
),
stake_table as (
select
block_timestamp::date as stake_time,
count(*) as number_of_stake_actions,
sum(amount) as number_of_stake_STBL
from stake_transaction
group by stake_time
),
unstake_transaction as (
select
block_timestamp,
sender as asset_receiver,
tx_message:dt:itx[0]:txn:aamt::float/1e6 as amount
from algorand.application_call_transaction
where app_id = 482608867
and try_base64_decode_string(tx_message:txn:note::string) = 'Market: rcu'
and inner_tx = 'FALSE'
),
unstake_table as (
select
Run a query to Download Data