CryptoIcicleSushi-103.Fees on Kashi Markets - Polygon
Updated 2022-07-10
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
›
⌄
-- Fees on Kashi Markets
-- Q103. How much fees each Kashi market has generated and which are the top markets in terms of fees generated?
-- Payout 44.248 SUSHI
-- Grand Prize 132.74 SUSHI
-- Level Beginner
-- Hint: you can use the cross-chain sushi ez_lending and ez_borrowing.
-- Note: Currently the polygon data is only showing the recent months.
-- We will back-fill the data in the future. Make sure your dashboard mentions the starting date on polygon data.
with eth_price as (
select
date_trunc('day', hour) as date,
avg(price) as price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH' and hour >= '{{start_date}}'
group by date
),
matic_price as (
select
date_trunc('day', hour) as date,
avg(price) as price
from ethereum.core.fact_hourly_token_prices
where symbol = 'MATIC' and hour >= '{{start_date}}'
group by date
),
borrowing_lending_txns as (
(
select
tx_hash,
concat('Borrow::',lending_pool) as category
from polygon.sushi.ez_borrowing
) union (
select
tx_hash,
Run a query to Download Data