NTokenUniswapV3

Implementation of the interest bearing token for the ParaSpace protocol

constructor

constructor(contract IPool pool) public

Constructor.

Parameters

NameTypeDescription

pool

contract IPool

The address of the Pool contract

getXTokenType

function getXTokenType() external pure returns (enum XTokenType)

return token type`of xToken

_decreaseLiquidity

function _decreaseLiquidity(address user, uint256 tokenId, uint128 liquidityDecrease, uint256 amount0Min, uint256 amount1Min, bool receiveEthAsWeth) internal returns (uint256 amount0, uint256 amount1)

A function that decreases the current liquidity.

Parameters

NameTypeDescription

user

address

tokenId

uint256

The id of the erc721 token

liquidityDecrease

uint128

The amount of liquidity to remove of LP

amount0Min

uint256

The minimum amount to remove of token0

amount1Min

uint256

The minimum amount to remove of token1

receiveEthAsWeth

bool

If convert weth to ETH

Return Values

NameTypeDescription

amount0

uint256

The amount received back in token0

amount1

uint256

The amount returned back in token1

decreaseUniswapV3Liquidity

function decreaseUniswapV3Liquidity(address user, uint256 tokenId, uint128 liquidityDecrease, uint256 amount0Min, uint256 amount1Min, bool receiveEthAsWeth) external

Decreases liquidity for underlying Uniswap V3 NFT LP and validates that the user respects liquidation checks.

Parameters

NameTypeDescription

user

address

The user address decreasing liquidity for

tokenId

uint256

The id of the erc721 token

liquidityDecrease

uint128

The amount of liquidity to remove of LP

amount0Min

uint256

The minimum amount to remove of token0

amount1Min

uint256

The minimum amount to remove of token1

receiveEthAsWeth

bool

If convert weth to ETH

_safeTransferETH

function _safeTransferETH(address to, uint256 value) internal

receive

receive() external payable