datavortexgas fees percentage
Updated 2024-09-17
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
›
⌄
WITH all_swaps AS (
SELECT
ez_dex_swaps.tx_hash,
fact_transactions.tx_fee
FROM polygon.defi.ez_dex_swaps AS ez_dex_swaps
JOIN polygon.core.fact_transactions AS fact_transactions
ON ez_dex_swaps.tx_hash = fact_transactions.tx_hash
),
stablecoin_swaps AS (
SELECT
ez_dex_swaps.tx_hash,
fact_transactions.tx_fee
FROM polygon.defi.ez_dex_swaps AS ez_dex_swaps
JOIN polygon.core.fact_transactions AS fact_transactions
ON ez_dex_swaps.tx_hash = fact_transactions.tx_hash
WHERE ez_dex_swaps.symbol_in IN ('USDT', 'USDC', 'EURS', 'DAI', 'UST', 'BUSD', 'TUSD')
AND ez_dex_swaps.block_timestamp >= '{{ start_date }}'
AND ez_dex_swaps.block_timestamp < '{{ end_date }}'
)
SELECT
(SELECT SUM(tx_fee) FROM all_swaps) AS total_fees,
(SELECT SUM(tx_fee) FROM stablecoin_swaps) AS stablecoin_fees,
(SELECT SUM(tx_fee) FROM stablecoin_swaps) / (SELECT SUM(tx_fee) FROM all_swaps) * 100 AS stablecoin_fee_percentage;
QueryRunArchived: QueryRun has been archived