Skip to main content

calculateCentralAmountXByAmountY

@bidask-protocol/sdk


@bidask-protocol/sdk / calculateCentralAmountXByAmountY

Function: calculateCentralAmountXByAmountY()

calculateCentralAmountXByAmountY(tokenYAmount, currentPrice, bps): bigint

Defined in: utils/liquidity/shapes/central-bin.ts:11

Calculates the amount of token X needed for a central bin position given an amount of token Y

Parameters

tokenYAmount

bigint

The amount of token Y to provide

currentPrice

number

The current price of the token pair

bps

bigint

The basis points for bin spacing

Returns

bigint

The calculated amount of token X required