Changing Position Mode

Change a position's mode.

Users can change their positions to another mode to increase the positions' health factors from better token factors.

Users may not always be able to change mode if the new mode debt ceiling in the target mode is reached or if the new mode does not support the current position's collaterals and borrows.

// Example change mode function
function changeMode(uint256 posId, uint16 newMode) external {
    // 1. change position mode
    IInitCore(INIT_CORE).setPosMode(posId, newMode);

Last updated