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
function borrowingsInfo(bytes32) externalviewreturns (addressborrower, addresssaleToken, addressholdToken, uint256borrowedAmount, uint256liquidationBonus, uint256accLoanRatePerSeconds, uint256dailyRateCollateralBalance)
borrowingKey=>BorrowingInfo
Parameters
Name
Type
Description
_0
bytes32
undefined
Returns
Name
Type
Description
borrower
address
undefined
saleToken
address
undefined
holdToken
address
undefined
borrowedAmount
uint256
undefined
liquidationBonus
uint256
undefined
accLoanRatePerSeconds
uint256
undefined
dailyRateCollateralBalance
uint256
undefined
calculateCollateralAmtForLifetime
function calculateCollateralAmtForLifetime(bytes32borrowingKey, uint256lifetimeInSeconds) externalviewreturns (uint256collateralAmt)
Calculates the collateral amount required for a lifetime in seconds.
Parameters
Name
Type
Description
borrowingKey
bytes32
The unique identifier of the borrowing.
lifetimeInSeconds
uint256
The duration of the borrowing in seconds.
Returns
Name
Type
Description
collateralAmt
uint256
The calculated collateral amount that is needed.
checkDailyRateCollateral
function checkDailyRateCollateral(bytes32borrowingKey) externalviewreturns (int256balance, uint256estimatedLifeTime)
This function is used to check the daily rate collateral for a specific borrowing.
Parameters
Name
Type
Description
borrowingKey
bytes32
The key of the borrowing.
Returns
Name
Type
Description
balance
int256
The balance of the daily rate collateral.
estimatedLifeTime
uint256
The estimated lifetime of the collateral in seconds.
collectLoansFees
function collectLoansFees(address[] tokens) external nonpayable
This function allows the caller to collect their own loan fees for multiple tokens and transfer them to themselves.
Parameters
Name
Type
Description
tokens
address[]
An array of addresses representing the tokens for which fees will be collected.
collectProtocol
function collectProtocol(addressrecipient, address[] tokens) external nonpayable
This function allows the owner to collect protocol fees for multiple tokens and transfer them to a specified recipient.
Only the contract owner can call this function.
Parameters
Name
Type
Description
recipient
address
The address of the recipient who will receive the collected fees.
tokens
address[]
An array of addresses representing the tokens for which fees will be collected.
computePoolAddress
function computePoolAddress(addresstokenA, addresstokenB, uint24fee) externalviewreturns (addresspool)
Computes the address of a Uniswap V3 pool based on the provided parameters. This function calculates the address of a Uniswap V3 pool contract using the token addresses and fee. It follows the same logic as Uniswap's pool initialization process.
Parameters
Name
Type
Description
tokenA
address
The address of one of the tokens in the pair.
tokenB
address
The address of the other token in the pair.
fee
uint24
The fee level of the pool.
Returns
Name
Type
Description
pool
address
The computed address of the Uniswap V3 pool.
dafaultLiquidationBonusBP
function dafaultLiquidationBonusBP() externalviewreturns (uint256)
Returns
Name
Type
Description
_0
uint256
undefined
flashLoanAggregatorAddress
function flashLoanAggregatorAddress() externalviewreturns (address)
Returns
Name
Type
Description
_0
address
undefined
getBorrowerDebtsInfo
function getBorrowerDebtsInfo(addressborrower) externalviewreturns (struct ILiquidityBorrowingManager.BorrowingInfoExt[] extinfo)
Retrieves the debts information for a specific borrower.
Parameters
Name
Type
Description
borrower
address
The address of the borrower.
Returns
Name
Type
Description
extinfo
ILiquidityBorrowingManager.BorrowingInfoExt[]
An array of BorrowingInfoExt structs representing the borrowing information.
getBorrowingKeysForBorrower
function getBorrowingKeysForBorrower(addressborrower) externalviewreturns (bytes32[] borrowingKeys)
Retrieves the borrowing keys for a specific borrower.
Parameters
Name
Type
Description
borrower
address
The address of the borrower.
Returns
Name
Type
Description
borrowingKeys
bytes32[]
An array of borrowing keys.
getBorrowingKeysForTokenId
function getBorrowingKeysForTokenId(uint256tokenId) externalviewreturns (bytes32[] borrowingKeys)
Retrieves the borrowing keys associated with a token ID.
Parameters
Name
Type
Description
tokenId
uint256
The identifier of the token.
Returns
Name
Type
Description
borrowingKeys
bytes32[]
An array of borrowing keys.
getFeesInfo
function getFeesInfo(addressfeesOwner, address[] tokens) externalviewreturns (uint256[] fees)
Returns the fees information for multiple tokens in an array.
Parameters
Name
Type
Description
feesOwner
address
The address of the owner of the fees.
tokens
address[]
An array of token addresses for which the fees are to be retrieved.
Returns
Name
Type
Description
fees
uint256[]
An array containing the fees for each token.
getHoldTokenInfo
function getHoldTokenInfo(addresssaleToken, addressholdToken) externalviewreturns (struct IDailyRateAndCollateral.TokenInfo holdTokenRateInfo)
Returns the current daily rate for holding token.
Parameters
Name
Type
Description
saleToken
address
The address of the token being sold.
holdToken
address
The address of the token being held.
Returns
Name
Type
Description
holdTokenRateInfo
IDailyRateAndCollateral.TokenInfo
The structured data containing detailed information for the hold token.
getLenderCreditsInfo
function getLenderCreditsInfo(uint256tokenId) externalviewreturns (struct ILiquidityBorrowingManager.BorrowingInfoExt[] extinfo)
Retrieves the borrowing information for a specific NonfungiblePositionManager tokenId.
Parameters
Name
Type
Description
tokenId
uint256
The unique identifier of the PositionManager token.
Returns
Name
Type
Description
extinfo
ILiquidityBorrowingManager.BorrowingInfoExt[]
An array of BorrowingInfoExt structs representing the borrowing information.
getLiquidationBonus
function getLiquidationBonus(addresstoken, uint256borrowedAmount) externalviewreturns (uint256liquidationBonus)
Calculates the liquidation bonus for a given token, borrowed amount, and times factor.
Parameters
Name
Type
Description
token
address
The address of the token.
borrowedAmount
uint256
The amount of tokens borrowed.
Returns
Name
Type
Description
liquidationBonus
uint256
The calculated liquidation bonus.
getLoansInfo
function getLoansInfo(bytes32borrowingKey) externalviewreturns (struct ILiquidityManager.LoanInfo[] loans)
Get information about loans associated with a borrowing key
This function retrieves an array of loan information for a given borrowing key. The loans are stored in the loansInfo mapping, which is a mapping of borrowing keys to LoanInfo arrays.
Parameters
Name
Type
Description
borrowingKey
bytes32
The unique key associated with the borrowing
Returns
Name
Type
Description
loans
ILiquidityManager.LoanInfo[]
An array containing LoanInfo structs representing the loans associated with the borrowing key
getPlatformFeesInfo
function getPlatformFeesInfo(address[] tokens) externalviewreturns (uint256[] fees)
Get the platform fees information for a list of tokens. This function returns an array of fees corresponding to the list of input tokens provided. Each fee is retrieved from the platformsFeesInfo mapping which stores the fee for each token address.
Parameters
Name
Type
Description
tokens
address[]
An array of token addresses for which to retrieve the fees information.
Returns
Name
Type
Description
fees
uint256[]
Returns an array of fees, one per each token given as input in the same order.
harvest
function harvest(bytes32borrowingKey) external nonpayable returns (uint256harvestedAmt)
Allows lenders to harvest the fees accumulated from their loans.
Retrieves and updates fee amounts for all loans associated with a borrowing position. The function iterates through each loan, calculating and updating the amount of fees due. Requirements: - The borrowingKey must correspond to an active and valid borrowing position. - The collateral balance must be above zero or the current fees must be above the minimum required amount.
Parameters
Name
Type
Description
borrowingKey
bytes32
The unique identifier for the specific borrowing position.
Returns
Name
Type
Description
harvestedAmt
uint256
The total amount of fees harvested by the borrower.
increaseCollateralBalance
function increaseCollateralBalance(bytes32borrowingKey, uint256collateralAmt, uint256deadline) external nonpayable
This function is used to increase the daily rate collateral for a specific borrowing.
Parameters
Name
Type
Description
borrowingKey
bytes32
The unique identifier of the borrowing.
collateralAmt
uint256
The amount of collateral to be added.
deadline
uint256
The deadline timestamp after which the transaction is considered invalid.
lightQuoterV3Address
function lightQuoterV3Address() externalviewreturns (address)
The Quoter contract.
Returns
Name
Type
Description
_0
address
undefined
liquidationBonusForToken
function liquidationBonusForToken(address) externalviewreturns (uint256bonusBP, uint256minBonusAmount)
Parameters
Name
Type
Description
_0
address
undefined
Returns
Name
Type
Description
bonusBP
uint256
undefined
minBonusAmount
uint256
undefined
operator
function operator() externalviewreturns (address)
Returns
Name
Type
Description
_0
address
undefined
owner
function owner() externalviewreturns (address)
Returns the address of the current owner.
Returns
Name
Type
Description
_0
address
undefined
platformFeesBP
function platformFeesBP() externalviewreturns (uint256)
Returns
Name
Type
Description
_0
uint256
undefined
renounceOwnership
function renounceOwnership() external nonpayable
Leaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.
repay
function repay(ILiquidityBorrowingManager.RepayParams params, uint256deadline) external nonpayable returns (uint256saleTokenOut, uint256holdTokenOut)
Parameters
Name
Type
Description
params
ILiquidityBorrowingManager.RepayParams
undefined
deadline
uint256
undefined
Returns
Name
Type
Description
saleTokenOut
uint256
undefined
holdTokenOut
uint256
undefined
setSwapCallToWhitelist
function setSwapCallToWhitelist(addressswapTarget, boolisAllowed) external nonpayable
Adds or removes a swap call params to the whitelist.
Parameters
Name
Type
Description
swapTarget
address
The address of the target contract for the swap call.
isAllowed
bool
A boolean indicating whether the swap call is allowed or not.
swapIsWhitelisted
function swapIsWhitelisted(addressswapTarget) externalviewreturns (boolIsWhitelisted)
Checks if a swap call is whitelisted.
Determines if a given swapTarget address and function selector are whitelisted for swaps.
Parameters
Name
Type
Description
swapTarget
address
The address to check if it is a whitelisted destination for a swap call.
Returns
Name
Type
Description
IsWhitelisted
bool
Returns true if the swapTarget address and selector combination is whitelisted, otherwise false.
transferOwnership
function transferOwnership(addressnewOwner) external nonpayable
Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.
Parameters
Name
Type
Description
newOwner
address
undefined
underlyingPositionManager
function underlyingPositionManager() externalviewreturns (contractINonfungiblePositionManager)
The Nonfungible Position Manager contract.
Returns
Name
Type
Description
_0
contract INonfungiblePositionManager
undefined
uniswapV3SwapCallback
function uniswapV3SwapCallback(int256amount0Delta, int256amount1Delta, bytesdata) external nonpayable
Callback function invoked by Uniswap V3 swap. This function is called when a swap is executed on a Uniswap V3 pool. It performs the necessary validations and payment processing. Requirements: - The swap must not entirely fall within 0-liquidity regions, as it is not supported. - The caller must be the expected Uniswap V3 pool contract.
Parameters
Name
Type
Description
amount0Delta
int256
The change in token0 balance resulting from the swap.
amount1Delta
int256
The change in token1 balance resulting from the swap.
data
bytes
Additional data required for processing the swap, encoded as (uint24, address, address).
updateHoldTokenDailyRate
function updateHoldTokenDailyRate(addresssaleToken, addressholdToken, uint256value) external nonpayable
This function is used to update the daily rate for holding token for specific pair.
Only the daily rate operator can call this function.The value must be within the range of MIN_DAILY_RATE and MAX_DAILY_RATE.
Parameters
Name
Type
Description
saleToken
address
The address of the sale token.
holdToken
address
The address of the hold token.
value
uint256
The new value of the daily rate for the hold token will be calculated based on the volatility of the pair and the popularity of loans in it
updateHoldTokenEntranceFee
function updateHoldTokenEntranceFee(addresssaleToken, addressholdToken, uint256value) external nonpayable
Parameters
Name
Type
Description
saleToken
address
undefined
holdToken
address
undefined
value
uint256
undefined
updateSettings
function updateSettings(enum IOwnerSettings.ITEM _item, uint256[] values) external nonpayable
This external function is used to update the settings for a particular item. The function requires two parameters: _item, which is the item to be updated, and values, which is an array of values containing the new settings. Only the owner of the contract has the permission to call this function.
Can only be called by the owner of the contract.
Parameters
Name
Type
Description
_item
enum IOwnerSettings.ITEM
The item to update the settings for.
values
uint256[]
An array of values containing the new settings.
wagmiLeverageFlashCallback
function wagmiLeverageFlashCallback(uint256bodyAmt, uint256feeAmt, bytesdata) external nonpayable
Executes a flash loan callback function for the Wagmi Leverage protocol. It performs various operations based on the received flash loan data. If the sale token balance is insufficient, it initiates a flash loan to borrow the required amount. Otherwise, it increases liquidity and performs token swaps. Finally, it charges platform fees and makes payments to the vault and flash loan aggregator contracts.