pub struct DefaultHook { /* private fields */ }
Expand description
Default hook implementation (matches Python DefaultHook)
Implementations§
Source§impl DefaultHook
impl DefaultHook
Trait Implementations§
Source§impl Default for DefaultHook
impl Default for DefaultHook
Source§impl HookBase for DefaultHook
impl HookBase for DefaultHook
Source§fn config(&self) -> &HookConfig
fn config(&self) -> &HookConfig
Get the hook configuration
Source§fn on_before_add_liquidity(
&self,
_kind: AddLiquidityKind,
_max_amounts_in_scaled_18: &[BigInt],
_min_bpt_amount_out: &BigInt,
balances_scaled_18: &[BigInt],
_hook_state: &HookState,
) -> BeforeAddLiquidityResult
fn on_before_add_liquidity( &self, _kind: AddLiquidityKind, _max_amounts_in_scaled_18: &[BigInt], _min_bpt_amount_out: &BigInt, balances_scaled_18: &[BigInt], _hook_state: &HookState, ) -> BeforeAddLiquidityResult
Process before add liquidity (matches Python on_before_add_liquidity)
Source§fn on_after_add_liquidity(
&self,
_kind: AddLiquidityKind,
_amounts_in_scaled_18: &[BigInt],
amounts_in_raw: &[BigInt],
_bpt_amount_out: &BigInt,
_balances_scaled_18: &[BigInt],
_hook_state: &HookState,
) -> AfterAddLiquidityResult
fn on_after_add_liquidity( &self, _kind: AddLiquidityKind, _amounts_in_scaled_18: &[BigInt], amounts_in_raw: &[BigInt], _bpt_amount_out: &BigInt, _balances_scaled_18: &[BigInt], _hook_state: &HookState, ) -> AfterAddLiquidityResult
Process after add liquidity (matches Python on_after_add_liquidity)
Source§fn on_before_remove_liquidity(
&self,
_kind: RemoveLiquidityKind,
_max_bpt_amount_in: &BigInt,
_min_amounts_out_scaled_18: &[BigInt],
balances_scaled_18: &[BigInt],
_hook_state: &HookState,
) -> BeforeRemoveLiquidityResult
fn on_before_remove_liquidity( &self, _kind: RemoveLiquidityKind, _max_bpt_amount_in: &BigInt, _min_amounts_out_scaled_18: &[BigInt], balances_scaled_18: &[BigInt], _hook_state: &HookState, ) -> BeforeRemoveLiquidityResult
Process before remove liquidity (matches Python on_before_remove_liquidity)
Source§fn on_after_remove_liquidity(
&self,
_kind: RemoveLiquidityKind,
_bpt_amount_in: &BigInt,
_amounts_out_scaled_18: &[BigInt],
amounts_out_raw: &[BigInt],
_balances_scaled_18: &[BigInt],
_hook_state: &HookState,
) -> AfterRemoveLiquidityResult
fn on_after_remove_liquidity( &self, _kind: RemoveLiquidityKind, _bpt_amount_in: &BigInt, _amounts_out_scaled_18: &[BigInt], amounts_out_raw: &[BigInt], _balances_scaled_18: &[BigInt], _hook_state: &HookState, ) -> AfterRemoveLiquidityResult
Process after remove liquidity (matches Python on_after_remove_liquidity)
Source§fn on_before_swap(
&self,
_swap_params: &SwapParams,
_hook_state: &HookState,
) -> BeforeSwapResult
fn on_before_swap( &self, _swap_params: &SwapParams, _hook_state: &HookState, ) -> BeforeSwapResult
Process before swap (matches Python on_before_swap)
Source§fn on_after_swap(
&self,
_after_swap_params: &AfterSwapParams,
_hook_state: &HookState,
) -> AfterSwapResult
fn on_after_swap( &self, _after_swap_params: &AfterSwapParams, _hook_state: &HookState, ) -> AfterSwapResult
Process after swap (matches Python on_after_swap)
Source§fn on_compute_dynamic_swap_fee(
&self,
_swap_params: &SwapParams,
static_swap_fee_percentage: &BigInt,
_hook_state: &HookState,
) -> DynamicSwapFeeResult
fn on_compute_dynamic_swap_fee( &self, _swap_params: &SwapParams, static_swap_fee_percentage: &BigInt, _hook_state: &HookState, ) -> DynamicSwapFeeResult
Compute dynamic swap fee (matches Python on_compute_dynamic_swap_fee)
Auto Trait Implementations§
impl Freeze for DefaultHook
impl RefUnwindSafe for DefaultHook
impl Send for DefaultHook
impl Sync for DefaultHook
impl Unpin for DefaultHook
impl UnwindSafe for DefaultHook
Blanket Implementations§
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
Mutably borrows from an owned value. Read more