181_willtop_tvl_increase
Updated 2023-04-13
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
now as (
SELECT
CHAIN,
TVL_USD as tvl1
from
external.defillama.fact_chain_tvl
where
DATE = CURRENT_DATE - interval '1 day'
),
one_week as (
SELECT
CHAIN,
TVL_USD as tvl2
from
external.defillama.fact_chain_tvl
where
DATE = CURRENT_DATE - interval '8 day'
),
three_weeks as (
SELECT
CHAIN,
TVL_USD as tvl3
from
external.defillama.fact_chain_tvl
where
DATE = CURRENT_DATE - interval '22 day'
)
SELECT
c.CHAIN,
tvl1,
(tvl1 - w1.tvl2) / tvl2 * 100 as one_week_change_perc,
(tvl1 - w3.tvl3) / tvl3 * 100 as three_week_change_perc,
tvl2 as tvl_1_week_ago,
tvl3 as tvl_3_weeks_ago
FROM
Run a query to Download Data