CalcTokenAmount

Curve Getter Plugin - CalcTokenAmount

Description

Estimate the amount of LP tokens minted or burned based on a deposit or withdrawal.

Method

calc_token_amount(uint256[], bool)

Input Parameters

to

FctAddress

Address of Curve pool

Method Parameters

NamePlugin TypeDescription

amounts

FctUint256

Amount of each coin being deposited.

isDeposit

FctBoolean

Set true for deposits, false for withdrawals.

Returned Values

NamePlugin TypeDescription

expectedAmount

FctValue

Expected amount of LP tokens minted or burned.

Example

Example with initParams

const calcTokenAmount = new Curve.getter.CalcTokenAmount({
   chainId: 1,
   initParams: {
     to: "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7", // DAI/USDC/USDT Pool
     methodParams: {
       amounts: ["...", "...", "..."],
       isDeposit: true
     }
   }
})

Example without initParams

const calcTokenAmount = new Curve.getter.CalcTokenAmount({ chainId: 1 })

calcTokenAmount.input.set({
    to: "0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7", // DAI/USDC/USDT Pool
    methodParams: {
       amounts: ["...", "...", "..."],
       isDeposit: true
    }
})

Learn more

Learn more about Curve calculate token amount here

Last updated