M1CollateralValueCalculator
Last updated
Last updated
M1CollateralValueCalculator
Aggregation contracts used to calculate the value of M1 collateral.
function getAssetInBaseCurrency(address asset,uint256 amounts, address oracle) override public view returns (uint256)
Calculate the value of a specified amount of assets
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
function getSingleLpInBaseCurrency(address lpContractAddress, uint256 lpAmounts, address oracle) external view returns (uint256);
Calculate the value of the specified amount of LP token
function getUniswapV2InBaseCurrency(address v2Pair, uint256 lpAmounts, address oracle) external view returns (uint256)
计算Uniswap v2 LP token数量的价值
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.
function getUniswapV3NFTInBaseCurrency( address nonfungiblePositionManagerAddress, uint256 tokenId, address oracle) external view returns (uint256);
Get the value of Uniswap v3 NFT
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.
function getUniswapV3NFTPoolAddress(uint256 tokenId, address nonfungiblePositionManagerAddress) external view returns(address)
Get the address of the pool contract corresponding to the tokenId
of Uniswap v3
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
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
assets
address
contract address of assets
amounts
uint256
the evaluated amount of assets
oracle
address
Underlying asset take-or-pay contracts in collateral assets
uint256
Returns the value of the specified amount of assets passed in.
lpContractAddress
address
token address of the LP token
lpAmounts
uint256
the amount need to be evaluate
oracle
address
Underlying asset take-or-pay contracts in collateral assets
uint256
The evaluated results
v2Pair
address
the pool address ofUniswap V2 LP
lpAmounts
uint256
the amount need to be evaluate
oracle
address
Underlying asset take-or-pay contracts in collateral assets
uint256
The evaluated results to the corresponding asset and amount.
v2Pair
address
the pool address ofUniswap V2 LP
lpAmounts
uint256
the LP amount need to be evaluate
token0
address
Uniswap v2 LP corresponds to the token0 contract address.
token1
address
Uniswap v2 LP corresponds to the token1 contract address.
amount0
uint256
The amount of assets corresponding to token0 for Uniswap v2 LP.
amount1
uint256
The amount of assets corresponding to token1 for Uniswap v2 LP.
nonfungiblePositionManagerAddress
address
Each pair of Uniswap is grouped under a single administrative address. They have different token IDs but the same address.
tokenId
uint256
token id
oracle
address
Underlying asset take-or-pay contracts in collateral assets
uint256
Returns the value of the token ID passed into Uniswap v3.
tokenId
uint256
token id
nonfungiblePositionManagerAddress
address
Uniswap v3's nft position manager address
token0
address
Uniswap v3 NFT corresponds to token0 contract address.
token1
address
Uniswap v3 NFT corresponds to token1 contract address.
fee
uint256
The uncollected fee of the NFT
amount0
uint256
Uniswap v3 NFT amount of assets corresponding to token0.
amount1
uint256
Uniswap v3 NFT amount of assets corresponding to token1.
tokenId
uint256
token id
nonfungiblePositionManagerAddress
address
Uniswap v3's nft position manager address
address
Uniswap v3 NFT corresponds to the contract address of the pool.
nonfungiblePositionManagerAddress
address
Uniswap v3's nft position manager address
tokenId
uint256
token id
oracle
address
Underlying asset take-or-pay contracts in collateral assets
currencyValue
uint256
Returns the value of the tokenid
of Uniswap v3.
token0
address
Uniswap v3 NFT corresponds to token0 contract address.
token1
address
Uniswap v3 NFT corresponds to token1 contract address.
fee
uint256
Uniswap v3 uncollected fee
amount0
uint256
the amount of assets corresponding to token0 in the NFT.
amount1
uint256
the amount of assets corresponding to token1 in the NFT.