• Calculates the micro-SOL price per token basis unit.

    Converts a SOL per token price to micro-SOL per smallest token unit, accounting for token decimals. This is used for precise sub-lamport pricing.

    Returns

    The price in micro-SOL per token basis unit

    Example

    // For a token with 6 decimals, priced at 0.5 SOL per token
    const priceUlamports = lamports(500_000_000); // 0.5 SOL
    const microSolPerBasis = uSolPerTokenBasis(priceUlamports, 6);
    // Returns price per smallest token unit (1/1,000,000 of a token)

    Parameters

    • solPerTokenInput: bigint | SolAmount

      The price in SOL per whole token (or lamports as bigint)

    • tokenDecimals: number

      The number of decimal places for the token

    Returns MicroSolAmount

Generated using TypeDoc