• Fetches all positions for a given Whirlpool.

    Parameters

    • rpc: Rpc<GetProgramAccountsApi>

      The Solana RPC client used to fetch positions.

    • whirlpool: Address

      The address of the Whirlpool.

    Returns Promise<HydratedPosition[]>

    • A promise that resolves to an array of hydrated positions.
    import { fetchPositionsInWhirlpool } from '@orca-so/whirlpools';
    import { createSolanaRpc, devnet, address } from '@solana/web3.js';

    const devnetRpc = createSolanaRpc(devnet('https://api.devnet.solana.com'));

    const whirlpool = address("Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE");
    const positions = await fetchPositionsInWhirlpool(devnetRpc, whirlpool);