PoolLogic

Implements the logic for Pool specific functions

MintedToTreasury

event MintedToTreasury(address reserve, uint256 amountMinted)

executeInitReserve

function executeInitReserve(mapping(address => struct DataTypes.ReserveData) reservesData, mapping(uint256 => address) reservesList, struct DataTypes.InitReserveParams params) external returns (bool)

Initialize an asset reserve and add the reserve to the list of reserves

Parameters

NameTypeDescription

reservesData

mapping(address => struct DataTypes.ReserveData)

The state of all the reserves

reservesList

mapping(uint256 => address)

The addresses of all the active reserves

params

struct DataTypes.InitReserveParams

Additional parameters needed for initiation

Return Values

NameTypeDescription

[0]

bool

true if appended, false if inserted at existing empty spot

executeRescueTokens

function executeRescueTokens(enum DataTypes.AssetType assetType, address token, address to, uint256 amountOrTokenId) external

Rescue and transfer tokens locked in this contract

Parameters

NameTypeDescription

assetType

enum DataTypes.AssetType

The asset type of the token

token

address

The address of the token

to

address

The address of the recipient

amountOrTokenId

uint256

The amount or id of token to transfer

executeMintToTreasury

function executeMintToTreasury(mapping(address => struct DataTypes.ReserveData) reservesData, address[] assets) external

Mints the assets accrued through the reserve factor to the treasury in the form of xTokens

Parameters

NameTypeDescription

reservesData

mapping(address => struct DataTypes.ReserveData)

The state of all the reserves

assets

address[]

The list of reserves for which the minting needs to be executed

executeDropReserve

function executeDropReserve(mapping(address => struct DataTypes.ReserveData) reservesData, mapping(uint256 => address) reservesList, address asset) external

Drop a reserve

Parameters

NameTypeDescription

reservesData

mapping(address => struct DataTypes.ReserveData)

The state of all the reserves

reservesList

mapping(uint256 => address)

The addresses of all the active reserves

asset

address

The address of the underlying asset of the reserve

executeGetUserAccountData

function executeGetUserAccountData(address user, struct DataTypes.PoolStorage ps, address oracle) external view returns (uint256 totalCollateralBase, uint256 totalDebtBase, uint256 availableBorrowsBase, uint256 currentLiquidationThreshold, uint256 ltv, uint256 healthFactor, uint256 erc721HealthFactor)

Returns the user account data across all the reserves

Return Values

NameTypeDescription

totalCollateralBase

uint256

The total collateral of the user in the base currency used by the price feed

totalDebtBase

uint256

The total debt of the user in the base currency used by the price feed

availableBorrowsBase

uint256

The borrowing power left of the user in the base currency used by the price feed

currentLiquidationThreshold

uint256

The liquidation threshold of the user

ltv

uint256

The loan to value of The user

healthFactor

uint256

The current health factor of the user

erc721HealthFactor

uint256

The current erc721 health factor of the user

executeGetAssetLtvAndLT

function executeGetAssetLtvAndLT(struct DataTypes.PoolStorage ps, address asset, uint256 tokenId) external view returns (uint256 ltv, uint256 lt)