Abbas_ra21Active Supply 2
Updated 2024-09-29
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 Active Supply 2 @ https://flipsidecrypto.xyz/edit/queries/f7a8bef5-63cf-420b-bda1-f15de89e13bb
-- forked from Active Supply Table @ https://flipsidecrypto.xyz/edit/queries/9c5db5f6-31ae-44a2-8c3a-0337eab05366
-- forked from Borrows Table @ https://flipsidecrypto.xyz/edit/queries/0e60ae35-9afe-41a3-8b46-37b7cb582ccc
with prices AS (
select
SYMBOL,
PRICE,
rank() over (
partition by SYMBOL
order by
HOUR desc
) AS rank
from
base.price.ez_prices_hourly
where
TOKEN_ADDRESS in (
select
DISTINCT TOKEN_ADDRESS
from
base.price.ez_prices_hourly
) qualify rank = 1
),
main AS (
select
SYMBOL,
sum(AMT) AS "Active Supply Amount"
from
(
select
TOKEN_SYMBOL AS SYMBOL,
sum(AMOUNT) AS AMT
from
base.defi.ez_lending_deposits
QueryRunArchived: QueryRun has been archived