Skip to content
Request an audit

‹ Findings database

Swapping amounts that would send the price below/above the bounds of the amm underflows without a reason

Low/InfoNftperp Exchange audit·Three Sigma·NFT perpetuals·2nd January, 20243S-NFTPerp-N02

Description

For example, _getBaseValue() calculates the base amount according to the k using the virtual reserves; however, some amounts will return a base amount bigger than the real reserves, silently underflowing when updating the reserves in swapOpen().

Recommendation

Add a revert message if the base/quote amount calculated is bigger than the real base/quote reserves.

Status

Addressed in the AMMRouter