Leno Lend — How it works P.2
Health Factor
Users can borrow against their supplied assets. All positions must be over-collateralized. The risk of a position can be understood through the Health Factor, which represents the combined collateral ratios of the borrowed assets.
Computation
The Health Factor (HF) is computed per account instead of per asset.
Each asset on Leno has a configuration value collateral factor
which indicates the expected price stability factor.
The higher the factor, the higher expectation of the stability of the price of the corresponding asset.
To compute the current health factor for the account, we need to know the current prices of all collateral and borrowed assets.
If the health factor is higher than 100%, it means the account is in a good state and can’t be liquidated.
If the health factor is more than 100%, it means the account can be partially liquidated and can’t borrow more without repaying some amount of the existing assets or providing more collateral assets.
Interest Rate Model
Leno Network uses a compounding interest model similar to Aave.
Based on these values we define 3 points of utilization: 0%, target utilization and 100%. For each of these points we have the r
constant: 1.0
, target utilization APR
and max utilization APR
respectively.
where MS PER YEAR is the number of milliseconds in a year equal to 31536000000
.
Based on the current supplied, reserved and borrowed balances, the current utilization is defined using the following formula:
To compute the current APR, we need to find the current r
constant based on the linear interpolation between utilization points:
Note: TU APR = Target Utilization APR.
To calculate the amount of interest acquired for the duration of t
milliseconds, we can use the following formula:
You can refer to the picture below to better understand the mechanism as well as how to calculate the interest rate.
Liquidations
Introduction
A liquidation is triggered when an account’s Health Factor goes below 100%, due to its collateral value not being sufficient to cover the debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value.
Leno’s liquidation mechanism is designed to make liquidators compete for the profit that they make during liquidations to minimize the loss taken by unhealthy accounts. This is achieved by introducing a variable discount with variable liquidation size, Instead of offering a fixed profit that is used in other protocols.
Liquidation rules
he first rule only allows liquidating accounts in an unhealthy state. The second rule prevents from taking more collateral than the repaid sum (after discount). The third rule prevents the liquidator from repaying too much of the borrowed assets, only enough to bring closer to the 100%.
A liquidation action consists of the following:
address
- the address that is being liquidated.in assets
- the assets and corresponding amounts to repay form borrowed assets.out assets
- the assets and corresponding amounts to take from collateral assets.
Once the action is completed, we can compute the final values and verify the liquidation rules:
This is how LenoLend works. Thank you for reading, if you have any ideas or suggestions, let us know.
About LENO
Website: https://lenonetwork.io
Twitter: https://twitter.com/LenoNetwork
Discord: https://discord.gg/RCFnsSAC9h
Github: https://github.com/LenoNetwork