Skip to main content

GhoDiscountRateStrategy

This contract implements the calculation of the discount rate depending on the current strategy.

The GhoDiscountRateStrategy contract inherits the IGhoDiscountRateStrategy interface.

This page shows the public constant state variables, and external pure methods within the GhoDiscountRateStrategy contract. The source code is available on GitHub.

Constant State Variables

GHO_DISCOUNTED_PER_DISCOUNT_TOKEN

uint256 public constant GHO_DISCOUNTED_PER_DISCOUNT_TOKEN = 100e18

The amount of debt that is entitled to get a discount per unit of discount token (stkAAVE).

Expressed with the number of decimals of the discounted token (GHO).

DISCOUNT_RATE

uint256 public constant DISCOUNT_RATE = 0.3e4

The percentage of discount to apply to the part of the debt that is entitled to get a discount.

Expressed in bps. For example, a value of 3000 results in 30.00%.

MIN_DISCOUNT_TOKEN_BALANCE

uint256 public constant MIN_DISCOUNT_TOKEN_BALANCE = 1e15

The minimum balance amount of discount token (stkAAVE) a user must hold to be entitled to a discount.

Expressed with the number of decimals of the discount token (stkAAVE).

MIN_DEBT_TOKEN_BALANCE

uint256 public constant MIN_DEBT_TOKEN_BALANCE = 1e18

Minimum balance amount of debt token (variableEthDebtGHO) to be entitled to a discount.

Expressed with the number of decimals of the debt token (GHO).

Pure Methods

calculateDiscountRate

function calculateDiscountRate(
uint256 debtBalance,
uint256 discountTokenBalance
) external pure override returns (uint256)

Calculates the discount rate depending on the debt token (GHO) and discount token (stkAAVE) balances.

The debtBalance and discountTokenBalance must be above the MIN_DEBT_TOKEN_BALANCE and MIN_DISCOUNT_TOKEN_BALANCE` respectively, to receive a discount.

Please see the Discount Rate page for more information and examples of the discount rate implementation.

Input Parameters:

NameTypeDescription
debtBalanceuint256The debt balance of the user
discountTokenBalanceuint256The discount token (stkAAVE) balance of the user

Return Values:

TypeDescription
uint256The discount rate, as a percentage - the maximum can be 10000bps = 100.00%