pub struct DynamicInterestRateModelParams {
pub min_borrow_rate: Decimal,
pub max_borrow_rate: Decimal,
pub optimal_utilization_rate: Decimal,
pub kp_1: Decimal,
pub kp_2: Decimal,
pub kp_augmentation_threshold: Decimal,
pub update_threshold_txs: u32,
pub update_threshold_seconds: u64,
}
Fields§
§min_borrow_rate: Decimal
Minimum borrow rate
max_borrow_rate: Decimal
Maximum borrow rate
optimal_utilization_rate: Decimal
Optimal utilization rate targeted by the PID controller. Interest rate will decrease when lower and increase when higher
kp_1: Decimal
Proportional parameter for the PID controller
kp_2: Decimal
Kp value when error threshold is exceeded
kp_augmentation_threshold: Decimal
Min error that triggers Kp augmentation
update_threshold_txs: u32
Amount of transactions involving the market’s interest update since last borrow rate update that will trigger the next borrow rate update
update_threshold_seconds: u64
Amount of seconds since last borrow rate update that will trigger the next borrow rate update when the next transaction involving the market’s interest update happens
Implementations§
Source§impl DynamicInterestRateModelParams
impl DynamicInterestRateModelParams
pub fn validate(&self) -> Result<(), InterestRateModelError>
Trait Implementations§
Source§impl Clone for DynamicInterestRateModelParams
impl Clone for DynamicInterestRateModelParams
Source§fn clone(&self) -> DynamicInterestRateModelParams
fn clone(&self) -> DynamicInterestRateModelParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de> Deserialize<'de> for DynamicInterestRateModelParams
impl<'de> Deserialize<'de> for DynamicInterestRateModelParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for DynamicInterestRateModelParams
impl JsonSchema for DynamicInterestRateModelParams
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl PartialEq for DynamicInterestRateModelParams
impl PartialEq for DynamicInterestRateModelParams
Source§fn eq(&self, other: &DynamicInterestRateModelParams) -> bool
fn eq(&self, other: &DynamicInterestRateModelParams) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for DynamicInterestRateModelParams
Auto Trait Implementations§
impl Freeze for DynamicInterestRateModelParams
impl RefUnwindSafe for DynamicInterestRateModelParams
impl Send for DynamicInterestRateModelParams
impl Sync for DynamicInterestRateModelParams
impl Unpin for DynamicInterestRateModelParams
impl UnwindSafe for DynamicInterestRateModelParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more