fantaTop pairs of collateral deposited
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
›
⌄
with records as (select contract_address , event_name , event_inputs:fraction/pow(10,18) as fraction,event_inputs:share/pow(10,18) as share,
(case
when contract_address='0x6eafe077df3ad19ade1ce1abdf8bdf2133704f89' then 'SushiBar/USD'
when contract_address='0xff7d29c7277d8a8850c473f0b71d7e5c4af45a50' then 'Wrapped Ether/Tether'
when contract_address='0x4f68e70e3a5308d759961643afcadfc6f74b30f4' then 'Token/USD'
when contract_address='0xb7b45754167d65347c93f3b28797887b4b6cd2f3' then 'Wrapped Ether/USD'
when contract_address='0x17fb5f39c55903de60e63543067031ce2b2659ee' then 'SushiBar/Tether USD'
when contract_address='0x418bc3ff0ba33ad64931160a91c92fa26b35acb0' then 'Wrapped BTC/Dai'
when contract_address='0x77f3a4fa35bac0ea6cfac69037ac4d3a757240a1' then 'SushiBar/Dai'
when contract_address='0x51d24429a72fa5be5b588a0de83a45f12fd57e57' then 'USD Coin/Hegic'
when contract_address='0x5f92e4300024c447a103c161614e6918e794c764' then 'Wrapped Ether/Dai'
when contract_address='0x18c9584d9ce56a0f62f73f630f180d5278c873b7' then 'Tribe/Fei'
when contract_address='0x63d4026cbc902e538618b9aa51a4d05ef48ef5a4' then 'Amp/USD'
when contract_address='0xa7c3304462b169c71f8edc894ea9d32879fb4823' then 'Dai Stablecoin/Rai'
end) as contract_name
from ethereum_core.fact_event_logs
where contract_name='KashiPairMediumRiskV1' and event_name in ('LogAddAsset','LogRemoveAsset','LogAddCollateral')
)
, AddAsset as (select sum(fraction) as total_available ,contract_address,contract_name from records
where event_name='LogAddAsset'
group by 2,3
order by 1 desc)
, RemoveAsset as (select sum(fraction) as total_available ,contract_address,contract_name from records
where event_name='LogRemoveAsset'
group by 2,3
order by 1 desc)
select sum(share),contract_address,contract_name from records where event_name='LogAddCollateral'
group by 2,3
order by 1 desc
limit 5
Run a query to Download Data