PapasotUSDC stats algofi
Updated 2022-05-30
999
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
›
⌄
-- Original author nih2 @ https://app.flipsidecrypto.com/dashboard/algofi-decentralized-lending--vB0HV
with usdc_supply as (
select
date_trunc('day', block_timestamp) as daily, count(*) as supply_tx, count(distinct sender) as active_supplier, sum(amount) as usdc_supply
-- block_timestamp, sender, amount, ay.tx_group_id
from (
select tx_group_id
from algorand.application_call_transaction
where
block_timestamp >= '2022-01-01' and block_timestamp < '2022-05-30'
and app_id = 465814103 -- USDC Market App
and try_base64_decode_string(tx_message:txn:note::string) = 'Market: mt' -- Providing liquidity
group by 1
) as ay
left join (
select
block_timestamp, sender, asset_amount/1e6 as amount, tx_id, tx_group_id
from algorand.asset_transfer_transaction
where block_timestamp >= '2022-01-01' and block_timestamp < '2022-05-30') as aa
on ay.tx_group_id = aa.tx_group_id
group by 1
),
usdc_repay as (
select
date_trunc('day', block_timestamp) as daily, count(*) as repay_tx, count(distinct sender) as active_repayer, sum(amount) as usdc_repay
-- block_timestamp, sender, asset_amount/1e6 as amount, sr.tx_group_id
from (
select tx_group_id
from algorand.application_call_transaction
where
block_timestamp >= '2022-01-01' and block_timestamp < '2022-05-30'
and app_id = 465814103 -- USDC Market App
and try_base64_decode_string(tx_message:txn:note::string) = 'Market: rb' -- Repaying
group by 1
Run a query to Download Data