kenobi9270Top 5 Pairs
Updated 2022-05-23
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 add_tbl as (select contract_address,sum(event_inputs:fraction) as amount from ethereum_core.fact_event_logs
where contract_name='KashiPairMediumRiskV1' and event_name='LogAddAsset' group by 1),
remove_tbl as ( select contract_address , sum(event_inputs:fraction) as amount from ethereum_core.fact_event_logs
where contract_name='KashiPairMediumRiskV1' and event_name='LogRemoveAsset' group by 1)
((select 'B-The total available for lending' as lbl, add_tbl.contract_address as address,(add_tbl.amount-remove_tbl.amount)/1e18 as results ,(case
when address='0x418bc3ff0ba33ad64931160a91c92fa26b35acb0' then 'Kashi Wrapped BTC/Dai'
when address='0x77f3a4fa35bac0ea6cfac69037ac4d3a757240a1' then 'Kashi SushiBar/Dai'
when address='0x51d24429a72fa5be5b588a0de83a45f12fd57e57' then 'Kashi USD Coin/Hegic'
when address='0x5f92e4300024c447a103c161614e6918e794c764' then 'Kashi Wrapped Ether/Dai'
when address='0x18c9584d9ce56a0f62f73f630f180d5278c873b7' then 'Kashi Tribe/Fei'
else address end) as name
from add_tbl inner join remove_tbl
on add_tbl.contract_address=remove_tbl.contract_address
order by 3 desc
limit 5)
UNION
(select 'C-Total collateral deposited' as lbl , contract_address as address,sum(event_inputs:share/1e18) as results ,(case
when address='0x63d4026cbc902e538618b9aa51a4d05ef48ef5a4' then ' Kashi Amp/USD'
when address='0xa7c3304462b169c71f8edc894ea9d32879fb4823' then ' Kashi Dai Stablecoin/Rai'
when address='0x6eafe077df3ad19ade1ce1abdf8bdf2133704f89' then ' Kashi SushiBar/USD'
when address='0x77f3a4fa35bac0ea6cfac69037ac4d3a757240a1' then ' Kashi SushiBar/Dai'
when address='0x17fb5f39c55903de60e63543067031ce2b2659ee' then ' Kashi SushiBar/Tether USD'
else address
end) as name
from ethereum_core.fact_event_logs
where contract_name='KashiPairMediumRiskV1' and event_name='LogAddCollateral'
group by 2
order by 3 desc
limit 5)
UNION
(select 'A-The number of loans they have generated' as lbl , contract_address as address, count(contract_address) as results,(case
Run a query to Download Data