getLiquidityValue

function getLiquidityValue(
    address _tokenA,
    address _tokenB,
    uint256 _liquidityAmount
) external view returns (
    uint256 tokenAAmount,
    uint256 tokenBAmount
)

์œ ๋™์„ฑ ํ’€ Token์„ ํ†ตํ•ด ๊ฐ ํ† ํฐ์˜ ๊ฐœ์ˆ˜๋ฅผ ์–ป์„ ๋•Œ ์‚ฌ์šฉ

Parameters

Return Values

Example

// ์œ ๋™์„ฑํ’€์„ ํ†ตํ•œ ํ† ํฐ ๊ฐœ์ˆ˜ ์–ป๊ธฐ
await ComputeContract.connect(accounts[0]).getLiquidityValue(
    mockToken0Contract.address,
    mockToken1Contract.address,
    1000000
)

// ๊ฒฐ๊ณผ (ํ† ํฐA, ํ† ํฐB ๊ฐœ์ˆ˜)
[ BigNumber { value: "1414213" }, BigNumber { value: "707106" } ]

2022.12.22

Last updated