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:

  1. Create a position, if not existed

  2. Perform multicall to InitCore, which performs:

    1. Decollateralize inToken from the position and redeem token in lending pool

    2. Withdraw from lending pool

    3. Change position mode, if specified

    4. Borrow tokens from lending pool

    5. Mint inToken from lending pool and collateralize to the position

  3. Unwrap rebase tokens, if specified

  4. Unwrap wrapped native token to native token, if specified

Parameters:

Name
Type
Description

_params

OperationParams

parameters to execute the fucntion

Returns:

Name
Type
Description

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