The tolerance value, which is used as the smallest difference in deposit that the pool cares about, is constant (500).
Impact: For small pools or pools with a large imbalance between tokens, this tolerance may lead to a large percentage of error in deposit amounts.
Recommendation: While we recommend rewriting this function entirely (see V-PHX-VUL-006), if the tolerance logic is kept, we recommend making it either configurable or based on the size of the underlying balances in the liquidity pool.
File: contracts/pool/src/contract.rs Location: split_deposit_based_on_pool_ratio
The
tolerance
value, which is used as the smallest difference in deposit that the pool cares about, is constant (500).Impact: For small pools or pools with a large imbalance between tokens, this tolerance may lead to a large percentage of error in deposit amounts.
Recommendation: While we recommend rewriting this function entirely (see V-PHX-VUL-006), if the tolerance logic is kept, we recommend making it either configurable or based on the size of the underlying balances in the liquidity pool.