Meteora DBC Rust SDK
A Rust SDK for interacting with the Meteora Dynamic Bonding Curve (DBC) program on Solana.
Installation
Add to your Cargo.toml:
[]
= "0.1.0"
# For RPC operations (fetching pools, etc.)
= { = "0.1.0", = ["fetch"] }
Features
fetch- Enables RPC client functions for fetching pool dataserde- Enables serialization supportanchor- Enables Anchor compatibility
Usage
use *;
use RpcClient;
use Pubkey;
use FromStr;
Available Functions
RPC Functions (requires fetch feature)
find_pool_by_token_mint- Find pool address by token mintfetch_virtual_pool- Fetch pool statefetch_pool_config- Fetch pool configuration
Instruction Builders
build_buy_instruction- Build swap instruction for buyingbuild_sell_instruction- Build swap instruction for sellingbuild_buy_with_wrap- Complete buy with WSOL wrappingbuild_sell_with_unwrap- Complete sell with WSOL unwrapping
WSOL Helpers
wrap_sol_instructions- Instructions to wrap SOL to WSOLclose_wsol_instruction- Close WSOL account
Price Calculations
calculate_tokens_out_dbc- Estimate tokens for a buycalculate_sol_out_dbc- Estimate SOL for a sellget_price_from_sqrt_price- Get price from sqrt_price
License
MIT