HosseinUntitled Query
Updated 2022-12-09Copy Reference Fork
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
›
⌄
with txs as (
select
b.block_timestamp,
tx_from,
b.tx_id,
a.attribute_value as origin_chain,
c.attribute_value as destination_chain,
case
when a.attribute_value = 'Ethereum' then 10.5
when a.attribute_value ilike any ('Avalanche', 'Polygon', 'Arbitrum', 'Binance', 'Celo', 'Fantom', 'Moonbeam', 'Osmosis') then 1.5
when a.attribute_value ilike any ('Agoric', 'AssetMantle', 'axelar', 'comdex', 'cosmoshub', 'crescent', 'e-money', 'evmos', 'fetch', 'juno', 'ki', 'kujira', 'regan', 'secret', 'stargaze', 'umee') then 1
else null end as bridge_fee
from axelar.core.fact_msg_attributes a
join axelar.core.fact_transactions b
using(tx_id)
join axelar.core.fact_msg_attributes c
using(tx_id)
where a.attribute_key = 'chain'
-- and c.attribute_key = 'destinationChain'
and b.tx_succeeded = 1
)
select
origin_chain,
count(distinct(tx_id)) as tx_count,
count(distinct(tx_from)) as bridgers_count,
sum(bridge_fee) as total_bridge_fee,
avg(bridge_fee) as average_bridge_fee,
median(bridge_fee) as median_bridge_fee
from txs
group by 1
order by tx_count desc
Run a query to Download Data