Skip to content

Commit

Permalink
CU-1m98wce lending docs and fixes (#441)
Browse files Browse the repository at this point in the history
* refactoring interest rate models to be more clear

* refactoring rate models

* made rates plots resonable

* fixing bugs

* fixed polynomial

* back some formulas

* rebase

Signed-off-by: Dzmitry Lahoda <dzmitry@lahoda.pro>
  • Loading branch information
dzmitry-lahoda committed Jan 6, 2022
1 parent 3efcada commit cdbdd0f
Show file tree
Hide file tree
Showing 13 changed files with 831 additions and 19 deletions.
7 changes: 6 additions & 1 deletion frame/composable-traits/src/defi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use frame_support::{pallet_prelude::MaybeSerializeDeserialize, Parameter};
use scale_info::TypeInfo;
use sp_runtime::{
traits::{CheckedAdd, CheckedMul, CheckedSub, Zero},
ArithmeticError, DispatchError, FixedPointOperand,
ArithmeticError, DispatchError, FixedPointOperand, FixedU128,
};

use crate::{
Expand Down Expand Up @@ -190,3 +190,8 @@ pub trait DeFiComposableConfig: frame_system::Config {
+ Into<u128>; // cannot do From<u128>, until LiftedFixedBalance integer part is larger than 128
// bit
}

/// The fixed point number from 0..to max.
/// Unlike `Ratio` it can be more than 1.
/// And unlike `NormalizedCollateralFactor`, it can be less than one.
pub type Rate = FixedU128;

0 comments on commit cdbdd0f

Please sign in to comment.