SocioAnalyticaaave (avax) copy
Updated 2024-04-30
999
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 avve (eth) @ https://flipsidecrypto.xyz/edit/queries/cfc6d548-120e-4bc6-bb0e-0f0eafb1de18
with supply as (
select
token_address,
sum(amount) as supply_amount
from (
select token_address, amount
from avalanche.defi.ez_lending_deposits
where platform ilike '%Aave%'
qualify row_number() over (partition by tx_hash order by event_index desc) = 1
)
group by 1
)
,
withdraw as (
select
token_address,
sum(amount) as withdraw_amount
from (
select token_address, amount
from avalanche.defi.ez_lending_withdraws
where platform ilike '%Aave%'
qualify row_number() over (partition by tx_hash order by event_index desc) = 1
)
group by 1
)
,
borrow as (
select
token_address,
sum(amount) as borrow_amount
from (
select token_address, amount
from avalanche.defi.ez_lending_borrows
QueryRunArchived: QueryRun has been archived