• Converts micro-SOL per token basis unit to SOL per whole token.

    Takes a price in micro-SOL per smallest token unit and converts it to SOL per whole token, accounting for token decimals.

    Returns

    The price in SOL per whole token

    Example

    // For a token with 6 decimals
    const microSolPerBasis = microLamports(500n); // Price per smallest unit
    const solPerWholeToken = solPerToken(microSolPerBasis, 6);
    // Returns price in SOL for one whole token

    Parameters

    • ulamportsPerTokenBasis: MicroSolInput

      The price in micro-SOL per token basis unit

    • tokenDecimals: number

      The number of decimal places for the token

    Returns SolAmount

Generated using TypeDoc