• Scale a human-readable price to a chain integer.

    Truncates to the market's maximum precision using floor rounding.

    Parameters

    • market: Market

      The market definition (provides quote decimals and precision).

    • humanPrice: number

      The human-readable price as a number.

    Returns bigint

    The scaled price as a chain integer (bigint).

    const chainPrice = scalePriceForMarket(market, 0.025); // e.g., 25000000n