Yousefi_1994Total StableCoin supply on Algorand is being lent or borrowed
Updated 2022-06-03
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 supplying_list as (
select
'lent' as type,
case
when transfer.asset_id = 312769 then 'Tether USD (USDT)'
when transfer.asset_id = 31566704 then 'USD Coin (USDC)'
when transfer.asset_id = 2757561 then 'realioUSD (rUSD)'
end as stable_coin,
sum(transfer.asset_amount/1e6) as amount
from algorand.application_call_transaction application
left join algorand.asset_transfer_transaction transfer using(tx_group_id)
where try_base64_decode_string(application.tx_message:txn:note::string) = 'Market: mt'
and transfer.asset_id in (312769, 31566704, 2757561)
group by type, stable_coin
having amount > 0
),
borrowing_list as (
select
'borrowed' as type,
case
when transfer.asset_id = 312769 then 'Tether USD (USDT)'
when transfer.asset_id = 31566704 then 'USD Coin (USDC)'
when transfer.asset_id = 2757561 then 'realioUSD (rUSD)'
end as stable_coin,
sum(transfer.asset_amount/1e6) as amount
from algorand.application_call_transaction application
left join algorand.asset_transfer_transaction transfer using(tx_group_id)
where try_base64_decode_string(application.tx_message:txn:note::string) = 'Market: b'
and transfer.asset_id in (312769, 31566704, 2757561)
group by type, stable_coin
having amount > 0
)
select * from supplying_list
union
select * from borrowing_list
Run a query to Download Data