M1CollateralValueCalculator
M1CollateralValueCalculator
Aggregation contracts used to calculate the value of M1 collateral.
View Methods
getAssetInBaseCurrency
function getAssetInBaseCurrency(address asset,uint256 amounts, address oracle) override public view returns (uint256)
Calculate the value of a specified amount of assets
Call Params
Return Value
getSingleLpInBaseCurrency
function getSingleLpInBaseCurrency(address lpContractAddress, uint256 lpAmounts, address oracle) external view returns (uint256);
Calculate the value of the specified amount of LP token
Call Params
Return Value
getUniswapV2InBaseCurrency
function getUniswapV2InBaseCurrency(address v2Pair, uint256 lpAmounts, address oracle) external view returns (uint256)
计算Uniswap v2 LP token数量的价值
Call Params
Return Value
getUniswapV2LpAmounts
function getUniswapV2LpAmounts(address v2Pair, uint256 lpAmounts) external view returns (address token0, address token1, uint256 amount0, uint256 amount1)
Get the address and number of underlying asset contracts corresponding to the number of Uniswap v2 LP tokens.
Call Params
Return Value
getUniswapV3NFTInBaseCurrency
function getUniswapV3NFTInBaseCurrency( address nonfungiblePositionManagerAddress, uint256 tokenId, address oracle) external view returns (uint256);
Get the value of Uniswap v3 NFT
Call Params
Return Value
getUniswapV3NFTAmounts
function getUniswapV3NFTAmounts(uint256 tokenId, address nonfungiblePositionManagerAddress) external view returns (address token0, address token1, uint24 fee, uint256 amount0, uint256 amount1);
Get the address of the underlying asset contract corresponding to Uniswap v3 NFT and its amount.
The number of assets in Uniswap V3 NFT changes all the time, and the Pool is able to monitor it in real-time.
Call Params
Return Value
getUniswapV3NFTPoolAddress
function getUniswapV3NFTPoolAddress(uint256 tokenId, address nonfungiblePositionManagerAddress) external view returns(address)
Get the address of the pool contract corresponding to the tokenId
of Uniswap v3
Call Params
Return Value
getUniswapV3NFTInBaseCurrencyV2
function getUniswapV3NFTInBaseCurrencyV2( address nonfungiblePositionManagerAddress, uint256 tokenId, address oracle) external view returns (uint256 currencyValue,address token0, address token1, uint256 fee , uint256 amount0, uint256 amount1);
Get the value of Uniswap v3 and basic information about the underlying assets
Call Params
Return Value
Last updated