binhachonFolks Finance Deposits and Redeems - #5
Updated 2022-05-18
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
›
⌄
with collateral_list as (
select
asset_id,
creator_address,
decimals
from flipside_prod_db.algorand.asset
where asset_id in ( 686505742, --fALGO
686508050, --fUSDC
686509463, --fUSDt
686510134, --fgoBTC
694408528, --fgoETH
694474015 --fgALGO3
)
),
borrow_list as (
select
asset_id,
asset_name,
decimals
from flipside_prod_db.algorand.asset
where asset_id in ( 0, --ALGO
31566704, --USDC
312769, --USDt
386192725, --goBTC
386195940, --goETH
694432641 --gALGO3
)
),
deposit_and_redeem_transactions as (
select
distinct
case when try_base64_decode_string(tx_message :txn :apaa [0] :: string) = 'd' then 'Deposit' else 'Redeem' end as type,
app_id,
tx_group_id
from flipside_prod_db.algorand.application_call_transaction
where app_id in ( 686498781, --ALGO
Run a query to Download Data