The contract assumes all tokens have the same decimal precision as LP_TOKEN_DECIMALS = 9
, but doesn't normalize token amounts based on their actual decimals.
The AMM should calculate liquidity provisions and swap amounts accurately, accounting for token decimals to maintain the constant product formula (x * y = k) and proportional LP token minting.
The codebases assumes all tokens use the same decimals as LP_TOKEN_DECIMALS = 9 (defined in constants.rs), without normalizing amounts based on token-specific decimals (e.g., USDC at 6, SOL at 8). This leads to incorrect LP token minting in liquidity_operations.rs and swap outputs in swap_operations.rs, causing financial losses or pool imbalances.
Likelihood:Medium
Reason 1: Tokens like USDC (6 decimals) or SOL (8 decimals) are commonly paired in AMMs, leading to frequent mismatches with LP_TOKEN_DECIMALS = 9.
Reason 2: Users interact with pools without explicit decimal checks, making this issue prevalent in diverse token pairs.
Impact: High
Users receive fewer LP tokens or swap outputs than expected, resulting in direct financial losses.
Pool imbalances disrupt the x * y = k invariant, enabling arbitrage attacks or further losses.Impact:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.