pub struct PoolData {
pub core_avaiable: Uint128,
pub core_locked: Uint128,
pub collateral_avaiable: Uint128,
pub collateral_locked: Uint128,
pub global_index: Decimal,
pub last_update: u64,
pub factory: Addr,
pub loan_counter: u64,
}Fields§
§core_avaiable: Uint128§core_locked: Uint128§collateral_avaiable: Uint128§collateral_locked: Uint128§global_index: Decimal§last_update: u64§factory: Addr§loan_counter: u64Implementations§
Source§impl PoolData
impl PoolData
pub fn new(current_timestamp: Timestamp, factory: Addr) -> PoolData
pub fn total_value_in_core(&self, price_collateral_in_core: Decimal) -> Uint128
pub fn utilization_ratio(&self) -> Decimal
pub fn update_global_index( &mut self, current_timestamp: &Timestamp, config: &PoolConfig, )
pub fn current_interest(&self, config: &PoolConfig) -> Decimal
Trait Implementations§
Source§impl AssertOwner for PoolData
impl AssertOwner for PoolData
Source§impl<'de> Deserialize<'de> for PoolData
impl<'de> Deserialize<'de> for PoolData
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 PoolData
impl JsonSchema for PoolData
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 moreimpl StructuralPartialEq for PoolData
Auto Trait Implementations§
impl Freeze for PoolData
impl RefUnwindSafe for PoolData
impl Send for PoolData
impl Sync for PoolData
impl Unpin for PoolData
impl UnsafeUnpin for PoolData
impl UnwindSafe for PoolData
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