<!-- canonical: https://0xsimao.com/findings/ostium-000-infos-opening-fee -->

# utilizationThresholdP of 10_000 will make OstiumPairInfos::_getUtilizationOpeningFee() divide by 0

Medium · Three Sigma · RWA perpetuals DEX · 19th February, 2024

Finding 3S-OS-L04 of the Ostium security review.

- Protocol: https://www.ostium.com/
- Report: /reports/ostium
- Source: https://cdn.sanity.io/files/qoqld077/production/a95b9c69e0f65d1d6b0e649f0d62a362358ca8ce.pdf

---

### Description

[utilizationThresholdP](https://github.com/0xOstium/smart-contracts-threeSigma/blob/audit-feedback/src/OstiumPairInfos.sol#L125) should never be set to the max 10_000 or it will lead to division by 0
when calling [OstiumPairInfos::_getUtilizationOpeningFee()](https://github.com/0xOstium/smart-contracts-threeSigma/blob/audit-feedback/src/OstiumPairInfos.sol#L382-L390).

### Recommendation

Add an equality restriction to utilizationThresholdP:

```solidity
if ( ...
|| value.utilizationThresholdP >= MAX_USAGE_THRESHOLDP ... //@audit
note the = ) {
revert WrongParams();
}
```

### Status

Addressed in [#4c774b3](https://github.com/0xOstium/smart-contracts-threeSigma/pull/58/commits/4c774b30883612bf24d063238c667b65ad294579).
