Jor-elVertex TVL by Tokens copy
Updated 2024-04-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
-- forked from Ario / Vertex TVL by Tokens @ https://flipsidecrypto.xyz/Ario/q/toU312Ggb7-W/vertex-tvl-by-tokens
with priceT 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 Net_Deposit
from arbitrum.vertex.ez_clearing_house_events
join priceT using (TOKEN_ADDRESS)
QueryRunArchived: QueryRun has been archived