Skip to main content

Module amm

Module amm 

Source

Modules§

__packing_pool
__packing_pool_key

Structs§

Pool
AMM pool reserves for a user-token / validator-token pair.
PoolHandler
Type-safe handler for accessing #struct_name in storage.
PoolKey
Identifies a directional token pair in the fee AMM.
PoolKeyHandler
Type-safe handler for accessing #struct_name in storage.

Enums§

FeeRoute
AMM path TipFeeManager will take to swap user_token into validator_token for fee collection.

Constants§

M
Fee multiplier for fee swaps: 0.9970 scaled by 10000 (30 bps fee).
MIN_LIQUIDITY
Minimum liquidity locked permanently when initializing a pool.
N
Fee multiplier for rebalance swaps: 0.9985 scaled by 10000.
SCALE
Scale factor for fixed-point AMM arithmetic (10000).

Functions§

compute_amount_out
Computes the output amount for a fee swap: amount_in * M / SCALE.

Type Aliases§

PoolData
Pools read during planning, paired with their observed validator-token reserve.