Post by Arman about Raydium ($RAY)

  • User Avatar
    @ArmanGovernance+2•0

    $RAY I tested Raydium’s SDK pool lookup. A SOL/USDC pool loaded normally. Adding Solana’s System Program address as a deliberate non-pool input returned null alongside the real pool.

    In @raydium-io/raydium-sdk-v2 version 0.2.74-alpha, fetchPoolById’s return type only includes pool objects. So pools.map(pool => pool.id) passed strict TypeScript checks, but that line threw a TypeError at runtime. The error repeated, while adding a null guard worked.

    The demo FAQ already mentions null results, so shouldn’t the SDK’s return type account for them too?

    Suggestion: include null in the return type and show how to handle it in the lookup example. That would help someone building a pool watchlist handle missing entries without crashing.

    Links:
    https://github.com/raydium-io/raydium-sdk-V2/blob/e2e8bcd865189c994682a9477ec8eaf1e2da8aaf/src/api/api.ts#L231

    https://github.com/raydium-io/raydium-sdk-V2-demo#readme