<!-- canonical: https://0xsimao.com/findings/maple-finance-iv-suffers-rounding-approximately-1e12 -->

# MapleSkyStrategy:: _gemForUsds() suffers a rounding error up to approximately 1e12 Usds

Low/Info · Three Sigma · Institutional lending · 26th November, 2024

Finding 3S-Maple-L01 of the Maple Cash Strategies security review.

- Protocol: https://maple.finance/
- Report: /reports/maple-finance-iv
- Source: https://cdn.sanity.io/files/qoqld077/staging/a68d604be9eca467b1f656c2ca775e1cebc2a468.pdf

---

### Description

MapleSkyStrategy:: _gemForUsds() computes gemAmount_ = (usdsAmount_ * WAD) /
(to18ConversionFactor * (WAD + tout));. As can be seen, to18ConversionFactor is
1e12 for a Usdc gem, which leads to a rounding up to 1e12 Usds.

### Recommendation

As the rounding [error](https://github.com/aave-dao/aave-v3-origin/blob/main/src/contracts/protocol/libraries/helpers/Errors.sol#L40) corresponds to only 1e-6 USD and the operation is not called
frequently, it's safe to ignore it.

### Status

Acknowledged

---

Related findings:

- [Significant rounding error in whitelist discount that could be avoided](https://0xsimao.com/findings/1inch-rounding-whitelist-discount-avoided): 1inch Fee Extension
- [Rounding error in Aave Lending Pool](https://0xsimao.com/findings/gaib-rounding-error-aave-lending): GAIB Pre-Vaults
- [Unhandled rounding error in DistributionVault.getClaimable leads to locked dust](https://0xsimao.com/findings/m-0-rounding-claimable-locked-dust): M^0 Minter Gateway
- [`GoodDollarExchangeProvider::mintFromExpansion()` will change the price due to a rounding error in the new ratio](https://0xsimao.com/findings/mento-provider-mint-price-rounding): Mento
