Sbhn_NPWallet Summary
Updated 2023-08-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
34
›
⌄
with price as(
select hour::date as datee,
token_address,
avg(price) as usdprice
from crosschain.core.fact_hourly_prices
group by 1,2
),
base as (select tx_hash,
origin_from_address,
token_in,
pool_name,
platform,
block_timestamp,
amount_in,
amount_in_usd
from base.defi.ez_dex_swaps
),
agg as (select *,
ifnull(amount_in_usd,amount_in * usdprice) as usd_volume
from base
join price on block_timestamp::date=datee and token_address=token_in)
select
origin_from_address as "User",
count(DISTINCT tx_hash) as "Swaps",
sum(usd_volume) as "Swapped Volume $",
count(DISTINCT platform) as "Used Platforms",
count(DISTINCT block_timestamp::date) as "Active Days"
from agg
where origin_from_address = lower('{{Custom_Wallet}}')
group by 1
Run a query to Download Data