Afonso_Diaznumber of users before and after fee changes copy
Updated 2024-07-30
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
33
34
35
36
›
⌄
with tab1 as (
select
block_timestamp::Date AS date,tx_hash,
amount_in_usd AS amountUSD,
origin_from_address as userAddress,
case when date>='2023-10-17' then 'after fee changes' else 'before fee changes' end as TimePeriod
from arbitrum.defi.ez_dex_swaps
where amount_in_usd<power(10,6)
and tx_hash in (select distinct(tx_hash) from arbitrum.core.ez_decoded_event_logs where origin_to_address in ('0x5e325eda8064b456f4781070c0738d849c824258','0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b','0x4c60051384bd2d3c01bfc845cf5f4b44bcbe9de5'))
and date>='2023-01-01'
and platform = 'uniswap-v3'
),
NotUsingUniswapFrontEnd AS (
SELECT
DISTINCT ORIGIN_FROM_ADDRESS AS UserAddress
FROM
arbitrum.defi.ez_dex_swaps
JOIN
arbitrum.core.fact_transactions USING (TX_HASH)
WHERE
TO_ADDRESS in ('0x5e325eda8064b456f4781070c0738d849c824258','0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b','0x4c60051384bd2d3c01bfc845cf5f4b44bcbe9de5')
AND BLOCK_TIMESTAMP>=DATE('2023-10-17')
AND NOT UserAddress IN (SELECT UserAddress FROM tab1)
),
finally AS (
SELECT
ORIGIN_FROM_ADDRESS AS UserAddress,
TX_HASH,
PLATFORM,
BLOCK_TIMESTAMP,
COALESCE(AMOUNT_IN_USD,AMOUNT_OUT_USD) AS AmountUsd
FROM
arbitrum.defi.ez_dex_swaps
JOIN
QueryRunArchived: QueryRun has been archived