feyikemi2024-04-14 05:41 PM
Updated 2024-04-14
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
with Tprice as (
select
TOKEN_ADDRESS,
avg(PRICE) as Price
from arbitrum.price.ez_hourly_token_prices
where HOUR >= current_timestamp - interval '24 hours'
and token_address in (select
DISTINCT TOKEN_ADDRESS
from arbitrum.vertex.ez_clearing_house_events
)
group by 1
)
select
sum(AMOUNT * price) as TVL
from arbitrum.vertex.ez_clearing_house_events
join Tprice using (TOKEN_ADDRESS)
QueryRunArchived: QueryRun has been archived