MoneyMarketHook
View Functions
CORE
InitCore contract address.
function CORE() external view returns (address initCore);POS_MANAGER
PosManager contract address.
function POS_MANAGER() external view returns (address posManager);lastPosIds
Last opened position id (increasing from 0) of a user.
function lastPosIds(address _user) external view returns (uint256 lastPosId);initPosIds
Mapped user's position id on money market hook to InitCore's position id.
function initPosIds(address _user, uint256 _posId) external view returns (uint256 initPosId);External Functions
execute
Main function to interact with the contract to handle interactions to InitCore.
The function:
Create a position, if not existed
Perform
multicallto InitCore, which performs:Decollateralize inToken from the position and redeem token in lending pool
Withdraw from lending pool
Change position mode, if specified
Borrow tokens from lending pool
Mint inToken from lending pool and collateralize to the position
Unwrap rebase tokens, if specified
Unwrap wrapped native token to native token, if specified
Parameters:
_params
OperationParams
parameters to execute the fucntion
Returns:
posId
uint256
running position id (per each user) on money market hook
initPosId
uint256
position id on InitCore
results[]
bytes
results of multicall to InitCore
Last updated