MasiDaily New Traders
Updated 2024-10-26
999
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 tb1 as ( select trunc(block_timestamp,'hour') as hourly,
platform,
tx_hash,
trader,
amount_in_usd,
amount_out_usd,
SYMBOL_OUT,
amount_in,
amount_out,
symbol_in,
TOKEN_OUT_CONTRACT,
TOKEN_IN_CONTRACT,
case when amount_in_usd is null then amount_out_usd else amount_in_usd end as vol
from near.defi.ez_dex_swaps
where platform in ('ref-playground.near','v2.ref-finance.near','ref.marior.near','ref-finance.near')
)
,
tb2 as ( select hour,
token_address,
symbol,
avg(price) as avg_price
from crosschain.price.ez_prices_hourly
where blockchain = 'near'
group by 1,2,3
UNION
select HOUR,
'wrap.near' as token_address,
'wNEAR' as symbol,
avg(price) as avg_price
from near.price.ez_prices_hourly
where symbol = 'WNEAR'
group by 1,2,3 )
,
tb3 as ( select hourly::date as date,
platform,
tx_hash,
QueryRunArchived: QueryRun has been archived