The Pump Science protocols swap functionality, implemented in the Swap instruction, validates the minimum input amount but lacks validation for maximum input amounts. In the validate() function, we only see:
While there is a check for minimum input, theres no upper bound validation. This could lead to unnecessary transaction failures in two scenarios:
The issue is especially relevant because the bonding curves available liquidity changes over time, and users might not be aware of the current limits when submitting transactions.
Users may experience unnecessary transaction failures and gas wastage when submitting swap transactions with amounts that exceed available liquidity or their balance.
Add maximum amount validations in the validate() function:
