FluidSmartLendingResolver ​
Inherits:Structs
Fluid Smart Lending resolver Implements various view-only methods to give easy access to Smart Lending protocol data.
State Variables ​
SECONDS_PER_YEAR ​
uint256 internal constant SECONDS_PER_YEAR = 365 days;
DEX_RESOLVER ​
FluidDexResolver public immutable DEX_RESOLVER;
SMART_LENDING_FACTORY ​
FluidSmartLendingFactory public immutable SMART_LENDING_FACTORY;
_NATIVE_TOKEN_ADDRESS ​
address internal constant _NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
Functions ​
constructor ​
constructor(FluidDexResolver dexResolver_, FluidSmartLendingFactory smartLendingFactory_);
getAllSmartLendingAddresses ​
List of all existing SmartLending tokens
function getAllSmartLendingAddresses() public view returns (address[] memory);
getSmartLendingAddress ​
Get the address of a SmartLending for a certain dexId. address zero if no SmartLending exists for the dex.
function getSmartLendingAddress(uint256 dexId_) public view returns (address smartLending);
getSmartLendingEntireViewData ​
Get the entire data for a SmartLending, EXCEPT underlying DexEntireData. use write method for that.
function getSmartLendingEntireViewData(address payable smartLending_)
public
view
returns (SmartLendingEntireData memory data_);
Parameters
Name | Type | Description |
---|---|---|
smartLending_ | address payable | The address of the SmartLending |
Returns
Name | Type | Description |
---|---|---|
data_ | SmartLendingEntireData | A struct containing all the data for the SmartLending |
getSmartLendingEntireViewDatas ​
Get the entire view data for multiple SmartLendings, EXCEPT underlying DexEntireData. use write method for that.
function getSmartLendingEntireViewDatas(address[] memory smartLendings_)
public
view
returns (SmartLendingEntireData[] memory datas_);
Parameters
Name | Type | Description |
---|---|---|
smartLendings_ | address[] | An array of SmartLending addresses |
Returns
Name | Type | Description |
---|---|---|
datas_ | SmartLendingEntireData[] | An array of structs containing all the data for each SmartLending |
getAllSmartLendingEntireViewDatas ​
Get the entire data for all SmartLendings, EXCEPT underlying DexEntireData. use write method for that.
function getAllSmartLendingEntireViewDatas() public view returns (SmartLendingEntireData[] memory datas_);
Returns
Name | Type | Description |
---|---|---|
datas_ | SmartLendingEntireData[] | An array of structs containing all the data for all SmartLendings |
getSmartLendingEntireData ​
Get the entire data for a SmartLending, incl. underlying DexEntireData and totalUnderlyingAssets for each token
expected to be called via callStatic
function getSmartLendingEntireData(address payable smartLending_)
public
returns (SmartLendingEntireData memory data_);
Parameters
Name | Type | Description |
---|---|---|
smartLending_ | address payable | The address of the SmartLending |
Returns
Name | Type | Description |
---|---|---|
data_ | SmartLendingEntireData | A struct containing all the data for the SmartLending |
getSmartLendingEntireDatas ​
Get the entire data for multiple SmartLendings
expected to be called via callStatic
function getSmartLendingEntireDatas(address[] memory smartLendings_)
public
returns (SmartLendingEntireData[] memory datas_);
Parameters
Name | Type | Description |
---|---|---|
smartLendings_ | address[] | An array of SmartLending addresses |
Returns
Name | Type | Description |
---|---|---|
datas_ | SmartLendingEntireData[] | An array of structs containing all the data for each SmartLending |
getAllSmartLendingEntireDatas ​
Get the entire data for all SmartLendings
expected to be called via callStatic
function getAllSmartLendingEntireDatas() public returns (SmartLendingEntireData[] memory datas_);
Returns
Name | Type | Description |
---|---|---|
datas_ | SmartLendingEntireData[] | An array of structs containing all the data for all SmartLendings |
getUserPositionView ​
gets a user position at a certain SmartLending. EXCLUDING underlyingAssetsToken0 and underlyingAssetsToken1. use write method for that.
function getUserPositionView(address payable smartLending_, address user_)
public
view
returns (UserPosition memory userPosition_);
getUserPosition ​
gets a user position at a certain SmartLending incl. underlyingAssetsToken0 and underlyingAssetsToken1
expected to be called via callStatic
function getUserPosition(address payable smartLending_, address user_)
public
returns (UserPosition memory userPosition_);
getUserPositionsView ​
gets all Smart lendings entire data and all user positions for each. Excluding underlying DexEntireData and underlyingAssetsToken0 and underlyingAssetsToken1. use write method for that.
function getUserPositionsView(address user_) external view returns (SmartLendingEntireDataUserPosition[] memory);
getUserPositions ​
gets all Smart lendings entire data and all user positions for each. incl. underlying Dex (=getSmartLendingEntireViewData()
+ DexEntireData) and underlyingAssetsToken0 and underlyingAssetsToken1.
expected to be called via callStatic
function getUserPositions(address user_) external returns (SmartLendingEntireDataUserPosition[] memory);
Errors ​
FluidSmartLendingResolver__AddressZero ​
thrown if an input param address is zero
error FluidSmartLendingResolver__AddressZero();