AlexayV2 All
Updated 2023-04-13Copy Reference Fork
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 avax_deposits as ( select date_trunc('day', block_timestamp) as day, sum(event_inputs:amount/ 1e18) as deposit
from avalanche.core.fact_event_logs
where block_timestamp >= CURRENT_DATE-60 AND
contract_Address='0x4f01aed16d97e3ab5ab2b501154dc9bb0f1a5a2c' and event_name = 'Deposit'
group by day
order by day desc),
avax_withdraws as ( select date_trunc('day', block_timestamp) as day, -sum(event_inputs:amount/ 1e18) as withdraw
from avalanche.core.fact_event_logs
where block_timestamp >= CURRENT_DATE-60 AND
contract_Address='0x4f01aed16d97e3ab5ab2b501154dc9bb0f1a5a2c' and event_name = 'Withdraw'
group by day
order by day desc),
eth_deposits as ( select date_trunc('day', block_timestamp) as day, sum(event_inputs:amount/1e18) as deposit
from ethereum.core.fact_event_logs
where block_timestamp>=CURRENT_DATE-60 and
event_name = 'Deposit' and contract_address = lower('0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9')
and event_inputs:reserve = lower('0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9') -- Aave Token
group by day
order by day desc),
eth_withdraws as ( select date_trunc('day', block_timestamp) as day, -sum(event_inputs:amount/1e18) as withdraw
from ethereum.core.fact_event_logs
where block_timestamp >= CURRENT_DATE-60 AND
event_name='Withdraw' and contract_address = lower('0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9') --aave address
and event_inputs:token = lower('0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9') -- Aave token
group by day
order by day desc),
pol_deposits as ( select date_trunc('day', block_timestamp) as day, sum(event_inputs:amount/1e18) as deposit
from polygon.core.fact_event_logs
where block_timestamp>=CURRENT_DATE-60 and
event_name = 'Deposit' and contract_address = '0x8dff5e27ea6b7ac08ebfdf9eb090f32ee9a30fcf'
and event_inputs:reserve = '0xd6df932a45c0f255f85145f286ea0b292b21c90b' -- Aave Token
group by day
Run a query to Download Data