calculateCentralAmountXByAmountY
@bidask-protocol/sdk / calculateCentralAmountXByAmountY
Function: calculateCentralAmountXByAmountY()
calculateCentralAmountXByAmountY(
tokenYAmount
,currentPrice
,bps
):bigint
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