Team ethToken Flow- TVL
Updated 2024-03-22
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
›
⌄
WITH
base AS (
SELECT
livequery.live.udf_api (
'https://api.llama.fi/v2/historicalChainTvl/Ethereum'
) AS response
),
base2 as (
select
to_date(tvl.value:date::string) as date,
tvl.value:tvl as TVL -- This TVL excluding liquid staking according to Defillama
from base
join lateral flatten (input => response:data) tvl
),
TVL2 as (select
DATE,
TVL_USD -- This TVL contains liquid staking too
from external.defillama.fact_chain_tvl
where CHAIN= 'Ethereum'
and DATE>='{{Start_date}}')
select
base2.date as day,
TVL as "TVL (exclude liquid staking)", -- This TVL excluding liquid staking according to Defillama
TVL_USD as "TVL (include liquid staking)"-- This TVL contains liquid staking too
from base2
left join tvl2 on base2.date=tvl2.DATE
where base2.date >='{{Start_date}}'
QueryRunArchived: QueryRun has been archived