KaskoazulCOSG stake
Updated 2022-04-30
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 as (
SELECT t.block_timestamp::date as fecha,
count (distinct t.tx_group_id) as stake_actions,
sum(stake_actions) over (order by fecha) as cum_actions,
sum (t.tx_message:txn:aamt/pow(10,6)) as stake_amounts,
sum(stake_amounts) over (order by fecha) as cum_amounts
FROM algorand.transactions t
INNER JOIN algorand.application_call_transaction act
ON t.tx_group_id = act.tx_group_id
WHERE act.app_id = 710543830
AND t.tx_type_name = 'asset transfer'
AND t.asset_id = '571576867'
AND TRY_BASE64_DECODE_STRING(act.tx_message:txn:apaa[0]::STRING) = 'S'
group by 1
),
unstake as (
SELECT t.block_timestamp::date as fecha,
count (distinct t.tx_group_id) as unstake_actions,
sum(unstake_actions) over (order by fecha) as cum_actions,
sum (t.tx_message:txn:aamt/pow(10,6)) as unstake_amounts,
sum(unstake_amounts) over (order by fecha) as cum_amounts
FROM algorand.transactions t
INNER JOIN algorand.application_call_transaction act
ON t.tx_group_id = act.tx_group_id
WHERE act.app_id = 710543830
AND t.tx_type_name = 'asset transfer'
AND t.asset_id = '571576867'
AND TRY_BASE64_DECODE_STRING(act.tx_message:txn:apaa[0]::STRING) = 'W'
group by 1
)
select s.fecha,
s.stake_actions,
s.cum_actions as total_stake_actions,
Run a query to Download Data