Valiant Vortex Core SDK
This package provides developers with advanced functionalities for interacting with the Vortex Program on Solana. The Core SDK offers convenient methods for math calculations, quotes, and other utilities, making it easier to manage complex liquidity and swap operations within Rust projects. It serves as the foundation for the High-Level SDK, providing key building blocks that enable developers to perform sophisticated actions while maintaining control over core details.
Key Features
- Math Library: Contains a variety of functions for math operations related to bundles, positions, prices, ticks, and tokens, including calculations such as determining position status or price conversions.
- Quote Library: Provides utility functions for generating quotes, such as increasing liquidity, collecting fees or rewards, and swapping, enabling precise and optimized decision-making in liquidity management.
Installation
Usage
Here are some basic examples of how to use the package:
Math Example
The following example demonstrates how to use the is_position_in_range function to determine whether a position is currently in range.
use is_position_in_range;
Expected output:
Position in range? true
Adjust Liquidity Quote Example
The following example demonstrates how to use the increase_liquidity_quote_a function to calculate a quote for increasing liquidity given a token A amount.
use increase_liquidity_quote_a;
use TransferFee;
Expected output:
IncreaseLiquidityQuote {
liquidity_delta: 16011047470,
token_est_a: 1000000000,
token_est_b: 127889169,
token_max_a: 1010000000,
token_max_b: 129168061,
}