Skip to content

@gala-chain/chaincodeAPI


API > getAddLiquidityEstimation

Function: getAddLiquidityEstimation()

getAddLiquidityEstimation(ctx, dto): Promise\<GetAddLiquidityEstimationResDto>

Parameters

ctx: GalaChainContext

GalaChainContext – The execution context providing access to the GalaChain environment.

dto: GetAddLiquidityEstimationDto

GetAddLiquidityEstimationDto – A data transfer object containing: token0 – The first token of the pool. or token1 – The second token of the pool. Liquidity parameters – Details related to the amount of liquidity to be added.

Returns

Promise – An array containing: - Estimated token0 amount required for the liquidity addition. - Estimated token1 amount required for the liquidity addition. - Liquidity amount that will be received in return.

Dev

The getAddLiquidityEstimation function estimates the required token amounts and liquidity when adding liquidity to a Uniswap V3 pool within the GalaChain ecosystem.

Source

chaincode/src/dex/getFunctions.ts:167