Pine Analyticsmiddle-olive
Updated 2024-10-15
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 tab1 as (
SELECT
DISTINCT tx_hash
FROM ethereum.defi.ez_dex_swaps
where (platform LIKE '%uniswap%'
or platform LIKE '%Uniswap%')
and block_timestamp > '2022-01-01'
)
SELECT
date_trunc('week', block_timestamp) as week,
sum(
case when tx_hash in (SELECT * from tab1)
then TX_FEE_PRECISE
else 0 end
) as uniswap_fees,
sum(
case when not tx_hash in (SELECT * from tab1)
then TX_FEE_PRECISE
else 0 end
) as other_fees,
(uniswap_fees/(uniswap_fees + other_fees)) * 100 as uniswap_fee_percent
FROM ethereum.core.fact_transactions
WHERE block_timestamp > '2022-01-01'
GROUP by 1
QueryRunArchived: QueryRun has been archived