Skip to content

FluidSmartLendingResolver ​

Git Source

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 ​

solidity
uint256 internal constant SECONDS_PER_YEAR = 365 days;

DEX_RESOLVER ​

solidity
FluidDexResolver public immutable DEX_RESOLVER;

SMART_LENDING_FACTORY ​

solidity
FluidSmartLendingFactory public immutable SMART_LENDING_FACTORY;

_NATIVE_TOKEN_ADDRESS ​

solidity
address internal constant _NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

Functions ​

constructor ​

solidity
constructor(FluidDexResolver dexResolver_, FluidSmartLendingFactory smartLendingFactory_);

getAllSmartLendingAddresses ​

List of all existing SmartLending tokens

solidity
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.

solidity
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.

solidity
function getSmartLendingEntireViewData(address payable smartLending_)
    public
    view
    returns (SmartLendingEntireData memory data_);

Parameters

NameTypeDescription
smartLending_address payableThe address of the SmartLending

Returns

NameTypeDescription
data_SmartLendingEntireDataA 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.

solidity
function getSmartLendingEntireViewDatas(address[] memory smartLendings_)
    public
    view
    returns (SmartLendingEntireData[] memory datas_);

Parameters

NameTypeDescription
smartLendings_address[]An array of SmartLending addresses

Returns

NameTypeDescription
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.

solidity
function getAllSmartLendingEntireViewDatas() public view returns (SmartLendingEntireData[] memory datas_);

Returns

NameTypeDescription
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

solidity
function getSmartLendingEntireData(address payable smartLending_)
    public
    returns (SmartLendingEntireData memory data_);

Parameters

NameTypeDescription
smartLending_address payableThe address of the SmartLending

Returns

NameTypeDescription
data_SmartLendingEntireDataA struct containing all the data for the SmartLending

getSmartLendingEntireDatas ​

Get the entire data for multiple SmartLendings

expected to be called via callStatic

solidity
function getSmartLendingEntireDatas(address[] memory smartLendings_)
    public
    returns (SmartLendingEntireData[] memory datas_);

Parameters

NameTypeDescription
smartLendings_address[]An array of SmartLending addresses

Returns

NameTypeDescription
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

solidity
function getAllSmartLendingEntireDatas() public returns (SmartLendingEntireData[] memory datas_);

Returns

NameTypeDescription
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.

solidity
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

solidity
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.

solidity
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

solidity
function getUserPositions(address user_) external returns (SmartLendingEntireDataUserPosition[] memory);

Errors ​

FluidSmartLendingResolver__AddressZero ​

thrown if an input param address is zero

solidity
error FluidSmartLendingResolver__AddressZero();