Stable swap pools
Key data types
Config
Pool
struct Pool has key, store {
pool_addr: address, // resource account for the pool
n_coins: u64, // number of assets (2‒8)
rate_multipliers: vector<u256>,// decimals normalization factors
stored_balances: vector<u256>, // pool reserves
fee: u256, // trade fee
offpeg_fee_multiplier: u256, // extra fee when off the peg
initial_a: u256, // A parameter at start of ramp
future_a: u256, // target A parameter
initial_a_time: u64, // ramp start time
future_a_time: u64, // ramp end time
positions: BigOrderedMap<u64, Position>,
position_index: u64,
total_shares: u256,
}Position
Creating a pool
Adding liquidity
Removing liquidity
Swapping tokens
Pool operations
Math overview
Utility functions
Events
Security considerations
Last updated