AkronHook

Struct AkronHook 

Source
pub struct AkronHook { /* private fields */ }
Expand description

Akron hook implementation This hook implements Loss-Versus-Rebalancing (LVR) fee calculation for weighted pools

Implementations§

Source§

impl AkronHook

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Default for AkronHook

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl HookBase for AkronHook

Source§

fn hook_type(&self) -> &str

Get the hook type
Source§

fn config(&self) -> &HookConfig

Get the hook configuration
Source§

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)
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

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

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

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

Process after remove liquidity (matches Python on_after_remove_liquidity)
Source§

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

Process after swap (matches Python on_after_swap)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.