JonasoVertex I perp + spot (3)
Updated 2024-12-19
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
A as(
select block_timestamp, trader, amount_usd, 'spot' as type from arbitrum.vertex.ez_spot_trades union all
select block_timestamp, trader, amount_usd, 'perp' as type from arbitrum.vertex.ez_perp_trades ),
B as(
select trader,
sum(amount_usd) as volume_all,
count(*) as txs,
sum(case when type = 'spot' then amount_usd end) as volume_spot,
sum(case when type = 'perp' then amount_usd end) as volume_perp
from A
where block_timestamp >= current_date - interval '30 days'
and trader not in ('0x0000000000000000000000000000000000000000')
group by 1
order by 2 desc
limit 100)
select left(trader,10) as trader,
to_varchar(volume_all,'$999,999,999,999') as volume
from B
order by volume_all desc
QueryRunArchived: QueryRun has been archived