elsina2024-07-07: Long and Short positions based on token
Updated 2024-09-30
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
›
⌄
SELECT
date_trunc('day', block_timestamp) as date,
'long' as position,
COUNT(DISTINCT tx_hash) AS transaction_count,
COUNT(DISTINCT trader) AS unique_trader_count,
SUM(amount_usd) AS transaction_volume,
FROM
arbitrum.vertex.ez_perp_trades
WHERE
is_taker = true and
trade_type = 'buy/long' and
symbol = '{{token_name}}' and
date >= '2024-01-01'
group by date
union
SELECT
date_trunc('day', block_timestamp) as date,
'short' as position,
COUNT(DISTINCT tx_hash) AS transaction_count,
COUNT(DISTINCT trader) AS unique_trader_count,
-SUM(amount_usd) AS transaction_volume,
FROM
arbitrum.vertex.ez_perp_trades
WHERE
is_taker = true and
trade_type = 'sell/short' and
symbol = '{{token_name}}' and
date >= '2024-01-01'
group by date
QueryRunArchived: QueryRun has been archived