messariperps
Updated 2024-11-14
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
›
⌄
with arb as (
SELECT
DATE_TRUNC('day', block_timestamp) AS date,
'abritrum' as chain,
sum(fee_amount) as perp_fees_usd,
SUM(amount_usd) AS perp_volume_usd,
count(distinct trader) as perp_traders,
count(*) as perp_trades
FROM arbitrum.vertex.ez_perp_trades
WHERE date(block_timestamp) >= date('2023-03-09')
AND is_taker = 'TRUE'
GROUP BY 1, 2
),
bse as (
SELECT
DATE_TRUNC('day', block_timestamp) AS date,
'base' as chain,
sum(fee_amount) as perp_fees_usd,
SUM(amount_usd) AS perp_volume_usd,
count(distinct trader) as perp_traders,
count(*) as perp_trades
FROM base.vertex.ez_perp_trades
WHERE date(block_timestamp) >= date('2024-09-06')
AND is_taker = 'TRUE'
GROUP BY 1, 2
)
select * from arb union all select * from bse order by 1 desc, 2 asc;
QueryRunArchived: QueryRun has been archived