Flipside TeamClanker world copy
Updated 2024-11-27
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
›
⌄
with tab1 as (
SELECT
DISTINCT tx_hash
FROM base.core.fact_transactions
where from_address in (lower('0xE0c959EeDcFD004952441Ea4FB4B8f5af424e74B'), lower('0xC204af95b0307162118f7Bc36a91c9717490AB69'))
AND STATUS like 'SUCCESS'
), tab2 as (
SELECT
DISTINCT CONTRACT_ADDRESS
from base.core.fact_token_transfers
where tx_hash in (SELECT * from tab1)
and from_address like '0x0000000000000000000000000000000000000000'
)
SELECT --*,
date(block_timestamp) as date,
count(*) as swaps,
count(DISTINCT ORIGIN_FROM_ADDRESS) as trader,
suM(
case when not AMOUNT_OUT_USD is NULL then AMOUNT_OUT_USD
when not AMOUNT_IN_USD is NULL then AMOUNT_IN_USD end
) as volume_usd
FROM base.defi.ez_dex_swaps
where token_out in (select * from tab2)
OR token_in in (select * from tab2)
GROUP BY 1
--LIMIT 1000
QueryRunArchived: QueryRun has been archived