MLDZMNgtrade
Updated 2023-12-05
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 prc as (select
RECORDED_HOUR::date days ,
avg(close) as price
from solana.price.ez_token_prices_hourly
where token_address='AZsHEMXd36Bj1EMNXhowJajpUXzrKcK57wW4ZGXVa7yR'
group by 1)
, sell as (select
BLOCK_TIMESTAMP::date as date,
count (distinct tx_id) as num_swaps,
sum(num_swaps)over(order by date) as cum_swaps,
count (distinct swapper) as num_swappers,
sum(num_swappers)over(order by date) as cum_num_swappers,
sum (SWAP_FROM_AMOUNT) as native_volume,
sum ((SWAP_FROM_AMOUNT)*price) as USD_Volume,
sum(native_volume)over(order by date) as cum_native_volume,
sum(USD_Volume)over(order by date) as cum_USD_Volume,
USD_Volume / num_swappers as usd_per_trader ,
avg((SWAP_FROM_AMOUNT)*price) as usd_per_trade
from solana.defi.fact_swaps sw
inner join prc pr on sw.block_timestamp::date = pr.days
where
SWAP_FROM_MINT = 'AZsHEMXd36Bj1EMNXhowJajpUXzrKcK57wW4ZGXVa7yR'
and
swap_from_amount is not null
and
swap_from_amount > 0
and block_timestamp>= '2023-08-15'
group by 1)
, buy as (select
BLOCK_TIMESTAMP::date as date,
count (distinct tx_id) as num_swaps,
sum(num_swaps)over(order by date) as cum_swaps,
Run a query to Download Data