Position manager is responsible for managing individual positions, including debt shares and collaterals.
Get a user's next nonce for calculating the creation of position id.
function nextNonces(address _user) external view returns (uint256 nonce);
InfinitCore contract address.
function core() external view returns (address infinitCore);
Max collateral count allowed.
function maxCollCount() external view returns (uint8 count);
Position's pending reward token amounts.
function pendingRewards(uint256 _posId, address _rewardToken) external view returns (uint256 rewardAmount);
isCollateralized
Get whether the wrapped LP token id is already collateralized to the position.
Get a position's borrow information.
Parameters:
position id to get borrow info
Returns:
array of lending pool addresses that the position borrows from
array of debt shares of each borrow token
getPosBorrExtraInfo
Get a position's borrow extra information.
totalInterest may not be exact. Use with caution.
Parameters:
position id to get borrow extra info
lending pool address to get borrow extra info
Returns:
total interest that the lending pool has accrued borrow interest
the last known debt amount
Get a position's collateral information.
Parameters:
position id to get collateral info
Returns:
array of lending addresses that the position puts as collateral
array of lending pool collateralization amounts
array of wrapped LP addresses
array of array of wrapped LP's token ids
array of array of wrapped LP's token amount for each token id
Get a position's collateral amount of the specified lending pool.
Parameters:
position id to get collateral amount
lending pool to get collateral amount
Returns:
Get a position's collateral amount of the specified wrapped LP.
Parameters:
position id to get collateral wLp amount
wrapped LP contract address to get collateral amount
wrapped LP token id to get collateral amount
Returns:
getPosCollCount
Get a position's collateral count of a given position id.
Parameters:
position id to get collateral count
Returns:
getPosCollWLpCount
Get a position's wrapped LP collateral count of a given position id.
Parameters:
position id to get wLp collateral count
Returns:
Get a position's general information.
Parameters:
position id to get information
Returns:
viewer address of the position
Get a position's mode.
Parameters:
Returns:
getPosDebtShares
Get a position's debt shares (without borrow interest accrual).
Parameters:
position id to get debt shares information
lending pool address to get debt shares of
Returns:
lending pool debt shares of the position
getViewerPosIdsAt
Get a reverse-mapping lookup for the specified viewer address and the array index.
Parameters:
viewer address to get position id
Returns:
getViewerPosIdsLength
Get a reverse-mapping lookup array length for the specified viewer address.
Parameters:
viewer address to get position id count
Returns:
position id count corresponding to the viewer
Check whether the account is authorized for modifying the position.
Parameters:
address to check authorization
position id to check authorization
Returns:
whether the account is authorized to modify the position id
External Functions
Harvest reward tokens of the specified wrapped LP to the target address.
Parameters:
position id to harvest rewards from
wrapped LP contract address to harvest rewards
wrapped LP token id to harvest rewards
address to receive the reward tokens
Returns:
array of reward token addresses
array of reward token amounts transferred
claimPendingRewards
Claim pending reward tokens from the position.
Parameters:
position id to claim pending rewards
array of reward tokens to claim
address to receive the reward tokens
Returns:
array of reward token amounts
Set a new viewer to the position.
Parameters:
position id to set new viewer address
new viewer address to set