Base Jump Rate Model V 2

Compound (modified by Dharma Labs, refactored by Arr00)

Logic for Compound's JumpRateModel Contract V2.

Version 2 modifies Version 1 by enabling updateable parameters.

Methods

baseRatePerBlock

function baseRatePerBlock() external view returns (uint256)

The base interest rate which is the y-intercept when utilization rate is 0

Returns

Name
Type
Description

_0

uint256

undefined

blocksPerYear

function blocksPerYear() external view returns (uint256)

The approximate number of blocks per year that is assumed by the interest rate model

Returns

Name
Type
Description

_0

uint256

undefined

getSupplyRate

Calculates the current supply rate per block

Parameters

Name
Type
Description

cash

uint256

The amount of cash in the market

borrows

uint256

The amount of borrows in the market

reserves

uint256

The amount of reserves in the market

reserveFactorMantissa

uint256

The current reserve factor for the market

Returns

Name
Type
Description

_0

uint256

The supply rate percentage per block as a mantissa (scaled by 1e18)

jumpMultiplierPerBlock

The multiplierPerBlock after hitting a specified utilization point

Returns

Name
Type
Description

_0

uint256

undefined

kink

The utilization point at which the jump multiplier is applied

Returns

Name
Type
Description

_0

uint256

undefined

multiplierPerBlock

The multiplier of utilization rate that gives the slope of the interest rate

Returns

Name
Type
Description

_0

uint256

undefined

owner

The address of the owner, i.e. the Timelock contract, which can update parameters directly

Returns

Name
Type
Description

_0

address

undefined

updateJumpRateModel

Update the parameters of the interest rate model (only callable by owner, i.e. Timelock)

Parameters

Name
Type
Description

baseRatePerYear

uint256

The approximate target base APR, as a mantissa (scaled by 1e18)

multiplierPerYear

uint256

The rate of increase in interest rate wrt utilization (scaled by 1e18)

jumpMultiplierPerYear

uint256

The multiplierPerBlock after hitting a specified utilization point

kink_

uint256

The utilization point at which the jump multiplier is applied

utilizationRate

Calculates the utilization rate of the market: borrows / (cash + borrows - reserves)

Parameters

Name
Type
Description

cash

uint256

The amount of cash in the market

borrows

uint256

The amount of borrows in the market

reserves

uint256

The amount of reserves in the market (currently unused)

Returns

Name
Type
Description

_0

uint256

The utilization rate as a mantissa between [0, 1e18]

Events

NewInterestParams

Parameters

Name
Type
Description

baseRatePerBlock

uint256

undefined

multiplierPerBlock

uint256

undefined

jumpMultiplierPerBlock

uint256

undefined

kink

uint256

undefined

Last updated