Pine AnalyticsStargate 3 (FINAL)
Updated 2024-07-13
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 tab_price as (
select
date_trunc('day', hour) as Date,
avg(price) as Price
from base.price.ez_prices_hourly
where symbol like 'WETH'
group by 1
order by 1
)
, tab_main as (
select
date_trunc('day', block_timestamp) as Date,
'Base' as Platform,
count(distinct tx_hash) as Transactions,
count(distinct sender) as Users,
sum(case when token_symbol like 'SGETH' then amount*price else amount_usd end) as volume_usd
from base.defi.ez_bridge_activity a left outer join tab_price b on date_trunc('day', block_timestamp) = b.date
where platform like 'stargate'
group by 1,2
UNION ALL
select
date_trunc('day', block_timestamp) as Date,
'Arbitrum' as Platform,
count(distinct tx_hash) as Transactions,
count(distinct sender) as Users,
sum(case when token_symbol like 'SGETH' then amount*price else amount_usd end) as volume_usd
from arbitrum.defi.ez_bridge_activity a left outer join tab_price b on date_trunc('day', block_timestamp) = b.date
where platform like 'stargate'
QueryRunArchived: QueryRun has been archived