adriaparcerisasFees on Kashi Markets 2
Updated 2022-07-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
›
⌄
-- How much fees each Kashi market has generated and which are the top markets in terms of fees generated?
WITH
lendings as (
select
block_timestamp,
--trunc(block_timestamp,'month') as date,
lending_pool as kashi_pair,
tx_hash
from flipside_prod_db.crosschain.ez_lending
where platform ='sushi' --and symbol in ('DAI','USDT','USDC','USDN') and action='Deposit'
--group by 1,2
),
collaterals as (
SELECT
block_timestamp,
--trunc(block_timestamp,'month') as date,
lending_pool as kashi_pair,
tx_hash
from flipside_prod_db.crosschain.ez_borrowing
where platform='sushi' --and block_chain --and collateral_symbol in ('DAI','USDT','USDC','USDN') and action='Borrow'
--group by 1,2
),
lending_fees as (
SELECT
y.kashi_pair,
sum(tx_fee) as monthly_eth_fees_generated
from polygon.core.fact_transactions x
join lendings y on x.tx_hash=y.tx_hash
group by 1
order by 2 desc
),
collateral_fees as (
SELECT
y.kashi_pair,
sum(tx_fee) as monthly_eth_fees_generated
Run a query to Download Data