BlockTrackertx_fee different chain for swap
Updated 2023-07-17
999
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
›
⌄
--For more insights and detail of analysis please check out our dashboard: https://sociocrypto.gitlab.io/Green-Routes/
WITH
avalanche_f as (
SELECT
date_trunc('day', a.block_timestamp) as date,
sum(tx_fee*c.usd_price) as t_fee,
avg(tx_fee*c.usd_price) as avg_fee
FROM avalanche.core.fact_transactions a
INNER JOIN avalanche.core.ez_dex_swaps b using(tx_hash)
LEFT JOIN (
SELECT
date_trunc('d', hour) as date,
median(price) as usd_price
FROM avalanche.core.fact_hourly_token_prices
WHERE symbol like 'WAVAX' -- token_address = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7'
GROUP BY 1
) c ON date_trunc('d', a.block_timestamp) = c.date
WHERE
date >= CURRENT_DATE -90
GROUP BY 1
),
Bsc_f as (
SELECT
date_trunc('day', block_timestamp) as date,
sum(tx_fee*c.usd_price) as t_fee,
avg(tx_fee*c.usd_price) as avg_fee
FROM bsc.core.fact_transactions a
INNER JOIN bsc.core.ez_dex_swaps b using(tx_hash)
LEFT JOIN (
SELECT
date_trunc('d', hour) as date,
median(price) as usd_price
FROM bsc.core.fact_hourly_token_prices
WHERE symbol like 'WBNB' -- token_address = '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c'
Run a query to Download Data