hessblitz tvl
Updated 2024-04-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
35
36
›
⌄
with final as ( Select
value:"DATE" as date,
value:"DEPOSIT_VOLUME" as deposit_volume,
value:"WITHDRAW_VOLUME" as withdraw_volume,
value:"TVL" as tvl,
value,
this
from (
SELECT livequery.live.udf_api(
'https://flipsidecrypto.xyz/api/v1/queries/8279cd8b-d02d-4fc9-9178-c6c53964aac5/data/latest') as resp
)
,LATERAL FLATTEN (input => resp:data))
,
price as ( select date(hour) as date,
avg(price) as avg_price
from ethereum.price.ez_hourly_token_prices
where symbol = 'WETH'
group by 1)
,
volume as ( select date(block_timestamp) as date,
trader,
symbol,
tx_hash,
modification_type,
case when symbol = 'USDB' then amount else amount*avg_price end as volume
from blast.blitz.ez_clearing_house_events a left outer join price b on a.block_timestamp::date = b.date)
,
price_2 as ( Select trunc(TO_TIMESTAMP(value[0]::string),'hour') as hour, value[1] as avg_price
from (
SELECT livequery.live.udf_api(
'https://api.coingecko.com/api/v3/coins/ethereum/market_chart?vs_currency=usd&days=90') as resp
)
,LATERAL FLATTEN (input => resp:data:prices)
group by all
order by 1 desc
QueryRunArchived: QueryRun has been archived