binhachonWhat Happens To Liquidated Collateral?
Updated 2022-04-12
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 bid_claimers as (
select
block_timestamp,
tx_id,
msg_value:sender::string as sender
from terra.msgs
where block_timestamp > getdate() - interval'180 days' --tx_id = '79A370D7C9A568815024B2731632C379B1CDBDEC4560A3A34DBCE9E8DC3B887F'
and msg_value:contract::string = 'terra1e25zllgag7j9xsun3me4stnye2pcg66234je3u'
and msg_value:execute_msg:claim_liquidations:collateral_token::string = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
),
transactions as (
select
block_timestamp,
tx_from[0]::string as tx_from,
tx_to[0]::string as tx_to
from terra.transactions
where block_timestamp > getdate() - interval'180 days'
),
bid_transactions as (
select
distinct transactions.tx_to,
bid_claimers.tx_id
from transactions
inner join bid_claimers on (transactions.block_timestamp > bid_claimers.block_timestamp and transactions.block_timestamp < bid_claimers.block_timestamp + interval'2 hours' and tx_from = sender)
),
bLUNA_related_tx_id as (
select
tx_id
from bid_transactions
where tx_to = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'
),
bid_transactions1 as (
select
*
from bid_transactions
where tx_id in (select tx_id from bLUNA_related_tx_id)
Run a query to Download Data