Skip to content

@gala-chain/apiAPI


API > getAmount1Delta

Function: getAmount1Delta()

getAmount1Delta(sqrtPriceLower, sqrtPriceUpper, liquidityDelta): BigNumber

Gets the amount1 delta between two prices.

Calculates liquidity * (sqrt(upper) - sqrt(lower)).

Parameters

sqrtPriceLower: BigNumber

A square root price (lower bound).

sqrtPriceUpper: BigNumber

Another square root price (upper bound).

liquidityDelta: BigNumber

The amount of usable liquidity.

Returns

The amount of token1 required to cover a position of size liquidity between the two passed prices.

Source

chain-api/src/utils/dex/sqrtPriceMath.helper.ts:52