DBC
dynamic-bonding-curve-sdk
provides a convenient way to interact with the Dynamic Bonding Curve program.
Before you begin, here are some important resources:
quote_exact_in
pool
: A reference to the VirtualPool
state.config
: A reference to the PoolConfig
for the pool.swap_base_for_quote
: A boolean indicating the direction of the trade. true
for swapping base token for quote token, false
otherwise.current_timestamp
: The current Solana cluster timestamp.current_slot
: The current Solana cluster slot.in_amount
: The amount of input tokens for the swap, excluding any transfer fees.has_referral
: A boolean indicating if a referral fee should be considered.Result<SwapResult2>
, where SwapResult2
contains detailed information about the outcome of the swap, such as the amount in, fees, and the next sqrt price of the token.
quote_exact_out
pool
: A reference to the VirtualPool
state.config
: A reference to the PoolConfig
for the pool.swap_base_for_quote
: A boolean indicating the direction of the trade. true
for swapping base token for quote token, false
otherwise.current_timestamp
: The current Solana cluster timestamp.current_slot
: The current Solana cluster slot.out_amount
: The amount of output tokens for the swap, excluding any transfer fees.Result<SwapResult2>
, where SwapResult2
contains detailed information about the outcome of the swap, such as the amount in, fees, and the next sqrt price of the token.
quote_partial_fill
pool
: A reference to the VirtualPool
state.config
: A reference to the PoolConfig
for the pool.swap_base_for_quote
: A boolean indicating the direction of the trade. true
for swapping base token for quote token, false
otherwise.current_timestamp
: The current Solana cluster timestamp.current_slot
: The current Solana cluster slot.in_amount
: The amount of input tokens for the swap, excluding any transfer fees.has_referral
: A boolean indicating if a referral fee should be considered.Result<SwapResult2>
, where SwapResult2
contains detailed information about the outcome of the swap, such as the amount in, fees, and the next sqrt price of the token.