Venus - Two Kinks Interest Rate

CertiKFiles named in the report

Audit

Part of CertiK’s series

CertiK reviewed Venus Protocol (Venus - Two Kinks Interest Rate) on 31 Jul 2024: 5 findings, 0 critical; 4 marked fixed, 1 open.

No open critical findings
Open the reportOpen Venus Protocol’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings5

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium000
Low104
Low`_max()` InconsistenciesFixed

The function `_max()` takes two `int256` as input and returns the larger of the two numbers. However, if they are both negative, then it will cast the greater negative number to a `uint256` causing it to return a large value. This function is only used internally and one of the inputs is always zero, so that these cases are not relevant to the current contract. However, if this function is adapted to be used in the future, then these cases may need to be considered and handled.

LowMissing ChecksFixed

The `constructor()` does not perform the following checks: - It does not check that `kink1_<kink2_`. If `kink2_` is less than `kink1_` the curve will not have the desired shape. - It does not check that `kink1` is strictly greater than 0. This should be done if the intention is to always have three linear functions. If the intention is to allow two, we recommend considering creating a separate contract to handle this.

LowTypos And InconsistenciesFixed

The comment at the start of the `TwoKinksInterestRateModel` contracts state " An interest rate model with two different steep increase each after a certain utilization threshold called **kink** is reached." However, the implementation does not just allow for steep increases, in general the implementation allows for the slope to be increased or decreased when each kink is reached. --- The comment above `getBorrowRate()` states that the return value is "scaled by 1e18" when all other comments instead use "scaled by EXP_SCALE" --- The comment above `JUMP_MULTIPLIER_PER_BLOCK` is not consistent with the comments for the `MULTIPLIER_2_PER_BLOCK` or `MULTIPLIER_PER_BLOCK`. It could be reworded to be "The multiplier of utilization rate per block that gives the slope 3 of the interest rate". --- The comments for the inputs `multiplierPerYear_` and `multiplier2PerYear_` in the `constructor()` state "The rate of increase". However, with the current implementation these can be negative values so that it can be the rate of increase or decrease. --- The comment for the input `baseRate2PerYear_` in the `constructor` states "The approximate target base APR after hitting `KINK_1`, as a mantissa (scaled by EXP_SCALE)". However the `baseRate2PerYear_` value represents a discontinuous increase in APR, as the calculation of the rate adds the rate from the previous interval.

LowUnchecked Blocks Can Optimize ContractFixed

In the function `_getBorrowRate()` the calculations `util - KINK_1` and `util - KINK_2` can be placed in unchecked blocks to save gas. This is because `util` is the output of the call to `utilizationRate` so that it will always be in the interval [0,1e18]. Then `util - KINK_1` is only executed if `util >= KINK_1` so that it cannot underflow. Similarly `util - KINK_2` is only executed if `util >= KINK_2` so that it cannot underflow. If the suggested check is made to ensure that `KINK_1 < KINK_2`, then in addition `KINK_2 - KINK_1` can also be placed in an unchecked block.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (3)

  • contracts/TwoKinksInterestRateModel.sol
  • contracts/InterestRateModels/InterestRateModelV8.sol
  • contracts/InterestRateModels/TwoKinksInterestRateModel.sol

Part of Venus Protocol’s security record

Venus Protocol
Audits67 audits by 7 firmsLast audit Sep 2025, by Quantstamp.
Critical findingsNo open critical findingsAcross the 67 reports, 4 critical findings were reported. Each is marked fixed by the firm that reported it.
IncidentIncident 12 May 2022Source: De.Fi incident database.
Open Venus Protocol’s security record

Security firm

CertiK

1,045 projects reviewed · 1,376 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us