freemartianAverage Daily Fee Paid in Luna on Wormhole to BSC
Updated 2022-01-11
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
›
⌄
WITH wh_source1 AS (
select tx_id,msg_value, block_timestamp AS TX_TIME
from terra.msgs
where msg_value:contract = 'terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf'
and msg_value:execute_msg:initiate_transfer is not null
and TX_STATUS = 'SUCCEEDED'
AND block_timestamp > '2021-01-01'
),
wh_source2 AS(
SELECT tx_id, fee, block_timestamp FROM terra.transactions
WHERE block_timestamp > '2021-01-01'
),
wh_result AS(
SELECT TX_TIME, wh_source1.tx_id,'Wormhole' AS bridge_label, wh_source2.fee[0]:amount[0]:amount/1000000 AS Fee_Pay,
wh_source2.fee[0]:amount[0]:denom AS Fee_Token
FROM wh_source1
LEFT JOIN wh_source2 ON wh_source1.tx_id = wh_source2.tx_id
WHERE wh_source2.fee[0]:amount[1]:amount IS NULL
)
SELECT date_trunc('day', TX_TIME) AS DATE , COUNT(tx_id) AS Number_OF_Transactions, SUM(Fee_Pay) AS SUM_of_Fee_Pay , 'uluna' AS Token
FROM wh_result
GROUP BY DATE ORDER BY DATE DESC
Run a query to Download Data