pub struct ExitFeeHook { /* private fields */ }Expand description
Exit fee hook implementation This hook implements the ExitFeeHookExample found in mono-repo: https://github.com/balancer/balancer-v3-monorepo/blob/c848c849cb44dc35f05d15858e4fba9f17e92d5f/pkg/pool-hooks/contracts/ExitFeeHookExample.sol
Implementations§
Source§impl ExitFeeHook
impl ExitFeeHook
Trait Implementations§
Source§impl Default for ExitFeeHook
impl Default for ExitFeeHook
Source§impl HookBase for ExitFeeHook
impl HookBase for ExitFeeHook
Source§fn config(&self) -> &HookConfig
fn config(&self) -> &HookConfig
Get the hook configuration
Source§fn on_after_remove_liquidity(
&self,
kind: RemoveLiquidityKind,
_bpt_amount_in: &U256,
_amounts_out_scaled_18: &[U256],
amounts_out_raw: &[U256],
_balances_scaled_18: &[U256],
hook_state: &HookState,
) -> AfterRemoveLiquidityResult
fn on_after_remove_liquidity( &self, kind: RemoveLiquidityKind, _bpt_amount_in: &U256, _amounts_out_scaled_18: &[U256], amounts_out_raw: &[U256], _balances_scaled_18: &[U256], hook_state: &HookState, ) -> AfterRemoveLiquidityResult
Process after remove liquidity (matches Python on_after_remove_liquidity)
Source§fn on_before_add_liquidity(
&self,
kind: AddLiquidityKind,
max_amounts_in_scaled_18: &[U256],
min_bpt_amount_out: &U256,
balances_scaled_18: &[U256],
hook_state: &HookState,
) -> BeforeAddLiquidityResult
fn on_before_add_liquidity( &self, kind: AddLiquidityKind, max_amounts_in_scaled_18: &[U256], min_bpt_amount_out: &U256, balances_scaled_18: &[U256], 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: &[U256],
amounts_in_raw: &[U256],
bpt_amount_out: &U256,
balances_scaled_18: &[U256],
hook_state: &HookState,
) -> AfterAddLiquidityResult
fn on_after_add_liquidity( &self, kind: AddLiquidityKind, amounts_in_scaled_18: &[U256], amounts_in_raw: &[U256], bpt_amount_out: &U256, balances_scaled_18: &[U256], 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: &U256,
min_amounts_out_scaled_18: &[U256],
balances_scaled_18: &[U256],
hook_state: &HookState,
) -> BeforeRemoveLiquidityResult
fn on_before_remove_liquidity( &self, kind: RemoveLiquidityKind, max_bpt_amount_in: &U256, min_amounts_out_scaled_18: &[U256], balances_scaled_18: &[U256], hook_state: &HookState, ) -> BeforeRemoveLiquidityResult
Process before remove liquidity (matches Python on_before_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: &U256,
hook_state: &HookState,
) -> DynamicSwapFeeResult
fn on_compute_dynamic_swap_fee( &self, swap_params: &SwapParams, static_swap_fee_percentage: &U256, hook_state: &HookState, ) -> DynamicSwapFeeResult
Compute dynamic swap fee (matches Python on_compute_dynamic_swap_fee)
Auto Trait Implementations§
impl Freeze for ExitFeeHook
impl RefUnwindSafe for ExitFeeHook
impl Send for ExitFeeHook
impl Sync for ExitFeeHook
impl Unpin for ExitFeeHook
impl UnsafeUnpin for ExitFeeHook
impl UnwindSafe for ExitFeeHook
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