A constant-product market maker tracks the relationship:
x * y = kWhere:
x is token A reservey is token B reservek is the pool invariantImplement constant_product.
u64 reserves.u128.u64 math.On Solana, token math often starts with u64 amounts but intermediate math must use wider types.
(x_reserve as u128) * (y_reserve as u128)