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

Mentorship Series #12 · 17 December 2025 · [@0xfirefist](https://x.com/0xFireFist) · Mento V3 · Cantina

Mentorship Series · [The Contest Academy](https://0xsimao.com/the-contest-academy) · 0xSimao

---

We continued the Mento V3 [contest](https://cantina.xyz/competitions/fe8e03b1-f8db-4698-8a21-44b3a862e434) 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?

https://youtu.be/11MpWn9ZDbc

Session video: https://youtu.be/11MpWn9ZDbc

---

Newer: [Which side of a swap the fee is taken on, and whether it gets taken twice](https://0xsimao.com/the-contest-academy/mentorship-series-13) · Older: [Exhausting a flow before moving on, and who profits when the median moves](https://0xsimao.com/the-contest-academy/mentorship-series-11)
