pub struct MeteoraDbc {Show 14 fields
pub pool: Pool,
pub config: Pubkey,
pub sqrt_price: u128,
pub base_reserve: u64,
pub quote_reserve: u64,
pub cliff_fee_numerator: u64,
pub base_fee_mode: BaseFeeMode,
pub activation_point: u64,
pub volatility_accumulator: u128,
pub variable_fee_control: u32,
pub activation_type: ActivationType,
pub base_fee_reduction_factor: u64,
pub base_fee_period_frequency: u64,
pub base_fee_number_of_periods: u16,
}Expand description
Struct to hold data and PoolTrait implementation for Meteora Dynamic Bonding Curve pools.
Fields§
§pool: Pool§config: Pubkey§sqrt_price: u128§base_reserve: u64The actual amount of base token (token A) in the pool
quote_reserve: u64The actual amount of quote token (token B) in the pool
cliff_fee_numerator: u64The initial fee numerator at the start of the curve.
base_fee_mode: BaseFeeModeThe mode for calculating the base fee (Linear or Exponential).
activation_point: u64The slot or timestamp when the pool becomes active and fees start decaying.
volatility_accumulator: u128Accumulator for price volatility, used in dynamic fee calculation.
variable_fee_control: u32A control factor for adjusting the impact of volatility on the dynamic fee.
activation_type: ActivationTypeThe method of time kept to track
base_fee_reduction_factor: u64§base_fee_period_frequency: u64§base_fee_number_of_periods: u16Implementations§
Source§impl MeteoraDbc
impl MeteoraDbc
pub fn from_account_info( pubkey: Pubkey, account_buffer: &[u8], dbc_pool_config: &DbcPoolConfig, config_address: Pubkey, ) -> Self
Trait Implementations§
Source§impl PoolTrait for MeteoraDbc
impl PoolTrait for MeteoraDbc
Source§fn total_swap_fee_lp(&self, central_context: &Arc<CentralContext>) -> u64
fn total_swap_fee_lp(&self, central_context: &Arc<CentralContext>) -> u64
Calculates the total trading fee numerator. This combines the base fee (scheduled) and the dynamic fee (volatility-based). Returns just the numerator as the denomiator is 10^9 whcih is lamports.
Source§fn price_a_over_b_lp(&self) -> u128
fn price_a_over_b_lp(&self) -> u128
The reciprocal of the price_b_over_a_lp.
Source§fn price_b_over_a_lp(&self) -> u128
fn price_b_over_a_lp(&self) -> u128
The sqrt price of the protocol will be in terms of quote over base which for us is b over a.
Source§fn pool_address(&self) -> &Pubkey
fn pool_address(&self) -> &Pubkey
Source§fn token_a_address(&self) -> &Pubkey
fn token_a_address(&self) -> &Pubkey
Source§fn token_b_address(&self) -> &Pubkey
fn token_b_address(&self) -> &Pubkey
Source§fn token_a_vault_address(&self) -> &Pubkey
fn token_a_vault_address(&self) -> &Pubkey
Source§fn token_b_vault_address(&self) -> &Pubkey
fn token_b_vault_address(&self) -> &Pubkey
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Any for type downcastingSource§fn fetch_market_state_from_rpc(&mut self, central_context: &Arc<CentralContext>)
fn fetch_market_state_from_rpc(&mut self, central_context: &Arc<CentralContext>)
Source§fn token_a_amount_units(&self) -> u64
fn token_a_amount_units(&self) -> u64
Source§fn token_b_amount_units(&self) -> u64
fn token_b_amount_units(&self) -> u64
token_a_amount_units
for details on why this is calculated dynamically.Source§fn directional_fees(
&self,
_: SwapDirection,
__: &Arc<CentralContext>,
) -> (f64, f64)
fn directional_fees( &self, _: SwapDirection, __: &Arc<CentralContext>, ) -> (f64, f64)
Auto Trait Implementations§
impl Freeze for MeteoraDbc
impl RefUnwindSafe for MeteoraDbc
impl Send for MeteoraDbc
impl Sync for MeteoraDbc
impl Unpin for MeteoraDbc
impl UnwindSafe for MeteoraDbc
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more