binhachonMarket Module - API
Updated 2022-04-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 UST_mint_burn as (
select
block_id,
block_timestamp,
-msg_value:execute_msg:assert_limit_order:minimum_receive::float/1e6 as delta_UST -- Burn LUNA mint UST
from terra.msgs
where msg_value:contract::string = 'terra1vs9jr7pxuqwct3j29lez3pfetuu8xmq7tk3lzk'
and msg_value:execute_msg:assert_limit_order:ask_denom::string = 'uusd'
and tx_status = 'SUCCEEDED'
union all
select
block_id,
block_timestamp,
msg_value:execute_msg:assert_limit_order:offer_coin:amount::float/1e6 as delta_UST -- Burn UST mint LUNA
from terra.msgs
where msg_value:contract::string = 'terra1vs9jr7pxuqwct3j29lez3pfetuu8xmq7tk3lzk'
and msg_value:execute_msg:assert_limit_order:offer_coin:denom::string = 'uusd'
and tx_status = 'SUCCEEDED'
),
blocks as (
select
distinct block_id
from terra.blocks
where block_timestamp::date = '2022-03-15'
),
UST_mint_burn_with_blocks as (
select
blocks.block_id,
block_timestamp,
sum(coalesce(delta_UST, 0)) as delta_UST
from blocks
left join UST_mint_burn on (UST_mint_burn.block_id = blocks.block_id)
group by 1, 2
),
cumulative_UST_mint_burn as (
select
Run a query to Download Data