diff --git a/docs/rust/README.md b/docs/rust/README.md index 5aefaed8..a1947ab8 100644 --- a/docs/rust/README.md +++ b/docs/rust/README.md @@ -1 +1,14 @@ -Rust +# Orca Whirlpools SDKs + +![Overview of Orca Whirlpools SDK suite](/../whirlpools/img/01-Welcome/orca-sdks-overview-rustdocs.png) + +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 (in development, requires Solana SDK v1.18) +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 (requires Solana SDK \ -## Introduction to Solana. +## Overview of Orca Whirlpools SDK suite -On Solana, all data is stored in accounts, which operate like a key-value store. Each account has an address (the key) and holds specific data (the value). Some accounts store only data, like token accounts for holding tokens. Other accounts store programs that define the logic for interacting with the network. For example, the Token Program manages token accounts and facilitates transfers, so each time you send a token, you're actually sending a transaction to the Token Program, which then updates the balances involved. +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. -Similarly, the Whirlpools Program is a program that enables more advanced features like concentrated liquidity pools and swapping. It creates specific data accounts on your behalf, such as Whirlpool and Position accounts, which are essential for managing liquidity. While the Whirlpools Program "owns" these accounts, meaning it controls the logic governing them, you still have authority over specific aspects, like managing liquidity in a position through a corresponding Position NFT. +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. -With the Whirlpools SDK, you can interact with these accounts, perform swaps, and manage positions with ease. And since Solana network transaction costs are low, you can execute these operations efficiently. +### Whirlpools SDKs -## Whirlpools SDK +![Overview of Orca Whirlpools SDK suite](../static/img/01-Welcome/orca-sdks-overview.png) -The Whirlpools SDK is an open-source library that allows developers to interact with the Whirlpools Program and is intended to be used in conjunction with the Solana SDK. Simply put, you use the Whirlpools SDK to create instructions, and the Solana SDK to send them to the network. +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: -Some of the main features are: -- Create instructions to set up a new pool, open positions, add or remove liquidity, and swap tokens. -- Get quotes for swaps. -- Query the state of pools to retrieve information about asset prices, liquidity, and fees. +#### 1. High-Level SDK +- **TypeScript**: [@orca-so/whirlpools](https://www.npmjs.com/package/@orca-so/whirlpools) (Requires Solana Web3.js SDK ≥v2.0) +- **Rust**: orca_whirlpools (in development, requires Solana SDK v1.18) +- **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. -## How to use this documentation +#### 2. Core SDK +- **TypeScript**: [@orca-so/whirlpools-core](https://www.npmjs.com/package/@orca-so/whirlpools-core) +- **Rust**: [orca_whirlpools_core](https://crates.io/crates/orca_whirlpools_core) +- **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. + +#### 3. Low-Level SDK +- **TypeScript**: [@orca-so/whirlpools-client](https://www.npmjs.com/package/@orca-so/whirlpools-client) (Requires Solana Web3.js SDK ≥v2.0) +- **Rust**: [orca_whirlpools_client](https://crates.io/crates/orca_whirlpools_client) (Requires Solana SDK \