Skip to main content

calculateCentralAmountYByAmountX

@bidask-protocol/sdk


@bidask-protocol/sdk / calculateCentralAmountYByAmountX

Function: calculateCentralAmountYByAmountX()

calculateCentralAmountYByAmountX(tokenXAmount, currentPrice, bps): bigint

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

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

Parameters​

tokenXAmount​

bigint

The amount of token X 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 Y required