You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the protocol has defined isolated asset, which can only 1.) be used as the only collateral, 2.) can only borrow assets that defined under borrowableInIsolation=true. However, when there are more assets being added as isolated asset, making an asset borrowable to this increasing amount of higher risk set of asset becomes an intricate and tricky risk assessment task. Secondly, each isolated asset has different risk properties and having the same set of borrowable is also a limiting factor, preventing the protocol from onboarding new and different new assets to the lending market using this feature
Solution
Add a mapping of bitmap to Pool/PoolStorage, that defines each reserveIndex to all the other reserveIndex (uint16 => uint128) using the bit as representation (since there are max 128 reserves). If the bit is flipped then the reserve is not borrowable. So a reserve with a bitmap value of 0, means it can borrow any asset just like an open asset now. A current isolated asset would have a bitmap with all bits flipped to 1, except the index of assets with borrowableInIsolation set to true.
Setting this bitmap is quite easy and gas efficient, just pre-compute the needed number by flipping bit on the required reserveIndex.
Checking this bitmap is also easy, just do a bit-wise operation to see if the collateral's bitmap has flipped the bit on the borrowed asset index
require( _reservesBlacklistBitmap[collateralIndex] &1<< toBorrowReserveIndex >0, "the collateral is forbidden to borrow this asset");
Benefit
This provides a much more granular control over isolated asset, and thus enable the protocol to onboard more isolated asset to capture TVL and market shares.
The text was updated successfully, but these errors were encountered:
Context
Currently the protocol has defined isolated asset, which can only 1.) be used as the only collateral, 2.) can only borrow assets that defined under borrowableInIsolation=true. However, when there are more assets being added as
isolated
asset, making an asset borrowable to this increasing amount of higher risk set of asset becomes an intricate and tricky risk assessment task. Secondly, each isolated asset has different risk properties and having the same set of borrowable is also a limiting factor, preventing the protocol from onboarding new and different new assets to the lending market using this featureSolution
Add a mapping of bitmap to Pool/PoolStorage, that defines each reserveIndex to all the other reserveIndex
(uint16 => uint128)
using the bit as representation (since there are max 128 reserves). If the bit is flipped then the reserve is not borrowable. So a reserve with a bitmap value of 0, means it can borrow any asset just like an open asset now. A current isolated asset would have a bitmap with all bits flipped to 1, except the index of assets with borrowableInIsolation set to true.Setting this bitmap is quite easy and gas efficient, just pre-compute the needed number by flipping bit on the required reserveIndex.
Checking this bitmap is also easy, just do a bit-wise operation to see if the collateral's bitmap has flipped the bit on the borrowed asset index
Benefit
This provides a much more granular control over isolated asset, and thus enable the protocol to onboard more isolated asset to capture TVL and market shares.
The text was updated successfully, but these errors were encountered: