Skip to content
Request an audit

Division by a variable, oracle-priced pools, and trading limits split into small swaps

We continued the Mento V3 contest on Cantina.

Lesson Summary:

  • Whenever you see a division by a variable, make sure it can never be zero;
  • The price of FPMM pools comes from the oracle, not from the ratio of the reserves;
  • Go through FPMM.sol line-by-line;
  • Work out what rateNumerator and rateDenominator are, and whether they can be manipulated;
  • How are the fees applied, and do they make sense? If the fee is set to 10%, is 10% actually charged, or more, or less?
  • Can the trading limits be bypassed? They exist to stop large swaps, so can several small swaps add up to one big one?
Watch the session on YouTube ↗
Message on Telegram All 62 posts