Crate orca_whirlpools_docs

Source
Expand description

§Orca Whirlpools SDKs

Overview of Orca Whirlpools SDK suite

The Whirlpools SDKs are Orca’s primary set of SDKs designed to provide enhanced, modular interaction with the Whirlpool Program on Solana and Eclipse. Whether you are managing liquidity, building applications that require pool infrastructure, or building automation tools that interact with the program, our SDKs cover a spectrum of functionality from low-level granular control to high-level abstractions. This offering is divided into three main components:

§1. High-Level SDK

§Compatibility

Compatible with Solana SDK versions ^1.18.0 but <3.0.0. By default, Cargo will install the latest version of Solana SDK ^v2. This can cause dependcy issues when using older versions. To solve this you can apply a lockfile patch with the following command:

cargo update solana-sdk:<current-version> --precise <required-version>

You might also have to apply lockfile patches for solana-program, solana-client, solana-account-decoder, spl-token, spl-memo, spl-token-2022, spl-associated-token-account.

§Description

The High-Level SDK is our top recommendation for anyone who wants to integrate with the Whirlpool Program. It builds upon the Low-Level and Core SDKs to provide an easy-to-use interface for interacting with the Whirlpool Program. This SDK abstracts many of the underlying complexities, such as tick array management, and makes managing pools and positions, and executing swaps much simpler. It is suitable for developers who need efficient, high-level functionalities and want to minimize manual configuration and management.

§2. Core SDK

The Core SDK provides essential utilities for math operations and quotes, required for working with liquidity pools. This library focuses on calculations such as determining position status, price conversions, and computing quotes on adjusting liquidity and swaps. It is written in Rust but has been compiled to WebAssembly (Wasm) for easy integration into TypeScript projects.

§3. Low-Level SDK

§Compatibility
  • Compatible with anchor versions ^0.26 but <0.30. If you enable the anchor feature of orca_whirlpools_client in cargo.toml while using a version of anchor that’s ^0.30 in your project, you may need to apply a lockfile patch to switch to a lower version:
    cargo update anchor:<current-version> --precise 0.29
  • Compatible with solana-program versions ^1.18.0 but <3.0.0. By default, Cargo will install the latest version of Solana SDK ^v2. This can cause dependcy issues when using older versions. To solve this you can apply a lockfile patch with the following command:
    cargo update solana-program:<current-version> --precise <required-version>
  • NOTE: if you are dealing with compatibility issues for both anchor and solana-program, the order of the patches matters. First patch anchor, then patch solana-program.
§Description

The Low-Level SDK is autogenerated from the Whirlpool Program’s Interface Description Language (IDL). This SDK provides direct program interactions and is designed for developers who need complete, low-level control over Whirlpool operations. It covers direct access to Solana accounts, instructions, and transactions.

Modules§