CryptoLionanchor tvl
Updated 2021-08-04
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 deposit_bluna as (
SELECT
tx_id,
msg_value:execute_msg:send:amount/POW(10,6) as amount,
msg_value:execute_msg:send:contract as contract
FROM terra.msgs
WHERE msg_value:execute_msg:send:msg LIKE '%deposit_collateral%'
AND tx_status='SUCCEEDED'
),
withdraw_bluna as (
SELECT
tx_id,
-- msg_value:execute_msg:unlock_collateral:collaterals[0][0]
msg_value:execute_msg:unlock_collateral:collaterals[0][1] / POW(10,6) as amount,
msg_value:execute_msg:unlock_collateral:collaterals[0][0] as contract
FROM terra.msgs
WHERE msg_value:execute_msg LIKE '%unlock_collateral%'
AND tx_status='SUCCEEDED'
),
deposit_ust as (
SELECT
tx_id,
msg_value:coins[0]:amount::float / POW(10,6) as amount,
msg_value:contract as contract
FROM terra.msgs
WHERE
tx_status='SUCCEEDED'
AND msg_value:execute_msg::string='{"deposit_stable":{}}'
),
withdraw_ust as (
SELECT
tx_id,
msg_value:execute_msg:send:amount / POW(10,6) as amount,
msg_value:contract as contract
FROM terra.msgs