Velar SDK
Last updated
Was this helpful?
Last updated
Was this helpful?
The Velar SDK is a powerful toolkit that enables seamless integration with the Velar Protocol, allowing developers to implement token swaps, manage liquidity, and interact with the Velar DEX ecosystem. This SDK provides a robust set of tools for building decentralized applications on the Stacks blockchain.
The latest version introduces significant improvements and changes:
Added support for all VELAR DEX listed tokens
Direct token contract address support in SwapConfig
Enhanced AmountOutResponse with detailed path information
Simplified API with removal of SwapType requirement
Removed support for swapTokensForExactTokens
Stable release with core functionality:
Support for token swapping operations
Implementation of swapTokensForExactTokens
Includes bug fix for assetName
in swap operations
Uses SwapType enum for different swap operations
Token Swapping: Execute token swaps with optimal routing
Price Computation: Calculate swap amounts with slippage protection
Pair Management: Query available trading pairs
Multi-hop Routing: Support for complex swap paths
Contract Integration: Seamless integration with Stacks blockchain
The SDK is built around several key interfaces and classes:
The main entry point for interacting with the protocol:
Handles all swap-related operations:
Initialize the SDK:
Create a swap instance:
Execute operations:
The SDK supports a wide range of tokens on the Velar DEX, including:
Core tokens: STX, VELAR, aeUSDC, aBTC
Ecosystem tokens: SOME, ROCK, MICK, WELSH, LEO
Staked variants: stSTX, sODIN, sROO, sWELSH
And many more
For the latest list of supported tokens and their trading pairs, you can use the getPairs
method or check the official token list at: https://sdk-beta.velar.network/tokens/symbols
When upgrading from 0.6.9 to 0.7.0-beta:
Remove all SwapType
references
Update getComputedAmount
implementation to handle new response type
Remove any swapTokensForExactTokens
implementations
Update token inputs to optionally use contract addresses
Always implement proper error handling
Use slippage protection for better trade execution
Test with small amounts before large transactions
Keep the SDK updated to the latest stable version
Monitor transaction status using provided callbacks
For technical support, bug reports, or feature requests, please join our community on or . Our documentation is regularly updated to help you make the most of the Velar SDK.