Skip to main content

getRawPrice

@bidask-protocol/sdk


@bidask-protocol/sdk / getRawPrice

Function: getRawPrice()

getRawPrice(humanReadablePrice, jetton0Decimals, jetton1Decimals): number

Defined in: utils/price.ts:51

Converts a human-readable price to its blockchain representation accounting for decimal differences

Parameters​

humanReadablePrice​

number

Price in human-readable format (as if tokens had same decimal places)

jetton0Decimals​

number

Number of decimal places for the first token

jetton1Decimals​

number

Number of decimal places for the second token

Returns​

number

Price adjusted for the blockchain with proper decimal scaling