You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Set up and first bulk
* Save state
* Finish restructuring. Add actions to examples. Add tx-sender to docs.
* Nits
* Add changeset. Remove package-lock.json.
* Update actions
* Update lock files
* Add tx-sender example
* Add tx-sender example
* Add Rust tx-sender to Rust code examples
* Fix test

21
-
22
-
Orca provides a range of SDKs that cater to different levels of development needs for interacting 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.
23
-
24
-
What follows is a brief overview of our SDK suite, distinguishing between the Whirlpools SDKs and the Legacy SDK, and explaining their intended purposes and relationships.
25
-
26
-
### Whirlpools SDKs
27
-
28
-
The Whirlpools SDKs are our primary set of SDKs designed to provide enhanced, modular interaction with the Whirlpool Program. This offering is divided into three main components:
- 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:
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`.
39
-
-**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.
-**Description**: 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.
- 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:
- 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:
- 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`.
59
-
-**Description**: The Low-Level SDK is autogenerated from the Whirlpool Program's Interface Description Language (IDL) using Codama. 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.
60
-
61
-
### Legacy SDK
62
-
-**TypeScript**: [@orca-so/whirlpools-sdk](https://www.npmjs.com/package/@orca-so/whirlpools-sdk) (Compatible with Solana Web3.js)
63
-
-**Description**: Despite being called "Legacy", this SDK remains a reliable choice for integrating with projects that use Solana Web3.js. It offers foundational tools for interacting with Orca's Whirlpool Program and includes utilities from @orca-so/common-sdk.
64
-
65
-
## How to use this documentation
66
-
67
-
In the next section you will find information about the Whirlpool Program and its architecture.
68
-
69
-
In the following sections you will find documentation on the Whirlpools SDKs and the Legacy SDK and how to use it to interact with the program.
70
-
71
-
If you have any questions or need help, feel free to reach out to us on the [Discord](https://discord.orca.so).
The owner of a Config account has the authority to define the many authorities over the pools that it owns (ex. default fees, collect protocol fees etc) . Whirlpools visible on the ORCA UI are all derived and controlled by a WhirlpoolsConfig account owned by the ORCA foundation. To learn more about managing pools, start [here](../03-Whirlpools%20SDKs/01-Whirlpools/03-Whirlpool%20Management/01-Create%20Pool.mdx).
8
+
9
+
The owner of a Config account has the authority to define the many authorities over the pools that it owns (ex. default fees, collect protocol fees etc) . Whirlpools visible on the ORCA UI are all derived and controlled by a WhirlpoolsConfig account owned by the ORCA foundation. To learn more about managing pools, start [here](../03-SDKs/03-Whirlpool%20Management/01-Create%20Pool.mdx).
8
10
9
11
Users and other protocols are free to deploy their own WhirlpoolsConfig account on our Whirlpool program to spawn their own set of liquidity pools.
10
12
@@ -13,35 +15,42 @@ Users and other protocols are free to deploy their own WhirlpoolsConfig account
13
15
WhirlpoolsConfig account may have WhirlpoolsConfigExtension account. WhirlpoolsConfigExtension account holds some additional authorities to manage TokenExtensions, especially TokenBadge accounts.
14
16
15
17
## FeeTier
18
+
16
19
FeeTier is an account that defines the fee rate, defined per WhirlpoolsConfig and tick spacing.
A Whirlpool is a concentrated liquidity pool between a token pair (A & B).
21
25
22
-
Each Whirlpool account hosts the necessary information to deal with the accounting of the pool. It also hosts the PDAs to the vaults. Only the Whirlpool program has authority to withdraw from the vault. No one, not even the program owner or WhirlpoolsConfig owner, has the authority to withdraw.
26
+
Each Whirlpool account hosts the necessary information to deal with the accounting of the pool. It also hosts the token accounts of the vaults. Only the Whirlpool program has authority to withdraw from the vault. No one, not even the program owner or WhirlpoolsConfig owner, has the authority to withdraw.
23
27
24
-
A Whirlpool account is hashed by the Config, Token pair mints and tick spacing, so there can be many pools for the same trading pair but with a different tick-spacing.
28
+
A Whirlpool account is hashed by the Config, Token pair mints and tick spacing, so there can be many pools for the same trading pair but with a different tick-spacing.
25
29
26
30
Users are able to perform position management and fee/reward collection operations against the Whirlpool.
27
31
28
32
## TickArray
33
+
29
34
To learn about TickArry, read [Understanding Tick Arrays](./03-Understanding%20Tick%20Arrays.md)
30
35
31
36
## Position
37
+
32
38
Positions represents a set of liquidity distributed on a price range within a single Whirlpool. To learn more, read [Tokenized Positions](./04-Tokenized%20Positions.md)
33
39
34
40
## PositionBundle
41
+
35
42
By creating a PositionBundle, up to 256 positions can be managed by a single NFT. Also, by closing a position, a new position can be created on the same PositionBundle account, so there is no rent overhead when rebalancing.
36
43
37
44
If you manage many positions and open and close them frequently, there is no reason not to use PositionBundle.
38
45
39
46
## TokenBadge
47
+
40
48
This account was introduced to support TokenExtensions.
41
49
42
50
While TokenExtensions provides useful extensions, there are extensions that pose a risk to the pool and pool users.
43
51
44
52
Therefore, tokens with some extensions can only be used for pool initialization if TokenBadge authority has issued a TokenBadge for that token.
45
53
46
54
## How are Whirlpool Accounts stored
47
-
Whirlpool program accounts are all [Program Derived Addresses](https://solana.com/docs/core/pda) (PDA) derivable from another Whirlpool account up the hierarchy.
55
+
56
+
Whirlpool program accounts are all [Program Derived Addresses](https://solana.com/docs/core/pda) (PDA) derivable from another Whirlpool account up the hierarchy.

11
+
12
+
Orca provides a range of SDKs that cater to different levels of development needs for interacting 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.
13
+
14
+
What follows is an overview of our SDK suite, distinguishing between the various layers of the SDKs, and explaining their intended purposes and relationships.
15
+
16
+
## 1. High-Level SDKs
17
+
18
+
The High-Level SDKs are our top recommendation for anyone who wants to integrate with the Whirlpool Program. These SDKs abstract 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.
- 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:
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`.
- Compatible with Solana Web3.js. Despite being called "Legacy", this class-based SDK remains a reliable choice for integrating with projects that use Solana Web3.js. It offers foundational tools for interacting with Orca's Whirlpool Program and includes utilities from @orca-so/common-sdk.
30
+
31
+
## 2. Core SDKs
32
+
33
+
The Core SDKs provide essential utilities for **math operations** and **quotes**, required for working with liquidity pools. These libraries focus 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.
- The Legacy SDK has has separate utility classes for certain math operations such as `PoolUtil`, `TickUtil`, `TickArrayUtil`, and `SwapUtils`. For quotes, there are separate functions exported, such as `decreaseLiquidityQuoteByLiquidity`, `increaseLiquidityQuoteByInputToken`, `swapQuoteByInputToken`, `collectFeesQuote`, `collectRewardsQuote`, and more. Check out the reference docs in the navbor for more details.
39
+
40
+
## 3. Low-Level SDKs
41
+
42
+
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.
- 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:
- 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:
- 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`.
0 commit comments