MLDZMNatvl
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
›
⌄
-- forked from etvl @ https://flipsidecrypto.xyz/edit/queries/c137d795-423f-4835-ad69-d8145e028f0e
-- forked from depbr1 @ https://flipsidecrypto.xyz/edit/queries/915f8a76-383b-454f-be6e-6e2e786e4ef9
with t1 as ( select
hour::date as day,
avg(price) as avg_price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
group by 1),
dep as (select
s.block_timestamp::date as date,
sum(ETH_VALUE*avg_price) as volume_deposit_usd
from ethereum.core.fact_event_logs s
left join ethereum.core.fact_transactions a on s.tx_hash=a.tx_hash
left join t1 on s.block_timestamp::date=t1.day
where s.CONTRACT_ADDRESS=lower('0xfb3330531E3f98671296f905cd82CC407d90CE97')
and s.ORIGIN_FUNCTION_SIGNATURE='0x3bc1f1ed'
--and s.tx_hash='0x4dcf1ce24a0ddef9cfa3ab5434de5af9e2e9ac8b10fb5bc34003ab918eb39037'
group by 1
),
bor as (select
s.block_timestamp::date as date,
sum(ETH_VALUE*avg_price) as volume_borrow_usd
from ethereum.core.fact_event_logs s
left join ethereum.core.fact_transactions a on s.tx_hash=a.tx_hash
left join t1 on s.block_timestamp::date=t1.day
where s.CONTRACT_ADDRESS=lower('0xfb3330531E3f98671296f905cd82CC407d90CE97')
and s.ORIGIN_FUNCTION_SIGNATURE='0xfbf37739'
group by 1)
select
dep.date as date,
Run a query to Download Data