CryptoIcicleSushi-65.Kashi TVL
Updated 2022-04-11
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
›
⌄
-- Kashi TVL
-- Payout 27.1 SUSHI
-- Grand Prize 81.3 SUSHI
-- Level Intermediate
-- Q65. What is the Total Value Locked (TVL) by liquidity pool on Kashi? draw a weekly chart for 2022. what are the top 10 pools?
with token_price as (
select
date_trunc('week',hour) as date,
token_address,
symbol,
avg(price) as price
from ethereum.token_prices_hourly
where hour >= '2022-01-01'
group by date, symbol, token_address
),
kashi_txns as (
select
distinct tx_id
-- distinct contract_name, contract_address
from ethereum.events_emitted
where
block_timestamp::date >= '2022-01-01'
and contract_name like 'KashiPair%'
),
lending_txns as (
select
t.date,
t.symbol as token,
sum((event_inputs:amount * t.price)/1e18) as tvl,
sum(tvl) over (partition by token order by date asc rows between unbounded preceding and current row) as cum_tvl
-- e.*
from ethereum.events_emitted e
join ethereum.labels l on event_inputs:token = l.address
join token_price t on event_inputs:token = t.token_address and t.date = date_trunc('week',block_timestamp)
Run a query to Download Data