ArioVertex Shorts - Longs for each token
Updated 2024-03-16
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 Long as (
select
split(symbol, '-')[0] as Symbol,
count(distinct TX_HASH) as "# Long Trades",
count(DISTINCT trader) as "# Long Traders",
sum(case when IS_TAKER = 'TRUE' then zeroifnull(AMOUNT_USD) end) as Long_Volume
from arbitrum.vertex.ez_perp_trades
where block_timestamp > current_timestamp - interval '24 hours'
and TRADE_TYPE = 'buy/long'
group by 1
order by Long_Volume desc
),
short as (
select
split(symbol, '-')[0] as Symbol,
count(distinct TX_HASH) as "# Shrot Trades",
count(DISTINCT trader) as "# Shrot Traders",
sum(case when IS_TAKER = 'TRUE' then zeroifnull(AMOUNT_USD) end) as Short_Volume
from arbitrum.vertex.ez_perp_trades
where block_timestamp > current_timestamp - interval '24 hours'
and TRADE_TYPE = 'sell/short'
group by 1
order by Short_Volume desc
)
select
Symbol,
"# Long Trades",
"# Shrot Trades",
"# Long Traders",
"# Shrot Traders",
Long_Volume,
Short_Volume,
Long_Volume - Short_Volume as Net_Volume
from long join short using(symbol)
order by abs(Net_Volume) desc
QueryRunArchived: QueryRun has been archived