-
Notifications
You must be signed in to change notification settings - Fork 293
Updated Documentation for Rust SDK Compatibility with Solana SDK v2 #751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
ed3c258
2fdcb49
66898ba
183b433
7e8c4c7
90070d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,11 +4,30 @@ | |
|
|
||
| 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, compatible with Solana SDK versions `^1.18.0` but `<2.0.0` | ||
| ### 1. High-Level SDK | ||
| #### Compatibility | ||
| - Compatible with Solana SDK versions `^1.18.0` but `<3.0.0`. By default, the Rust compiler 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: | ||
| ```bash | ||
| cargo update solana-program:<current-version> --precise <required-version> | ||
|
||
| ``` | ||
|
|
||
| #### 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, compatible with Solana SDK versions `^1.16.0` but `<2.0.0` | ||
| ### 3. Low-Level SDK | ||
| #### Compatibility | ||
| - Compatible with `anchor v0.29.0`. If you enable the `anchor` feature of `orcah_whirlpools_client` in `cargo.toml` while using a different version of anchor in your project, you may need to apply a lockfile patch to resolve dependency conflicts: | ||
|
||
| ```bash | ||
| cargo update anchor:<current-version> --precise <required-version> | ||
| ``` | ||
| - Compatible with `solana-program` versions `^1.18.0` but `<3.0.0`. By default, the Rust compiler 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: | ||
| ```bash | ||
| 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. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,12 @@ This document covers the essential setup required to start building on Orca’s | |
| Add the necessary dependencies to your project: | ||
|
|
||
| ```bash | ||
| cargo add orca_whirlpools [email protected] [email protected] tokio serde_json | ||
| cargo add orca_whirlpools solana-sdk solana-client tokio serde_json | ||
| ``` | ||
|
|
||
| **Note**: If you're using the Rust SDK in an already existing project which does not use the latest version of Solana SDK, you may need to apply a patchfile lock to prevent dependency conflicts. To do this, run the following command: | ||
| ```bash | ||
| cargo update solana-sdk:<current-version> --precise <required-version> | ||
| ``` | ||
| </TabItem> | ||
| </Tabs> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust compiler -> cargo