Trait stp258_traits::stp258::SerpTes [−][src]
Abstraction over a fungible multi-stable-currency Token Elasticity of Supply system.
Associated Types
type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize
[src]
The currency identifier.
type Balance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default
[src]
The balance of an account.
Required methods
fn on_serp_initialize(
now: BlockNumber,
sett_price: Self::Balance,
sett_currency_id: Self::CurrencyId,
jusd_price: Self::Balance,
jusd_currency_id: Self::CurrencyId
) -> DispatchResult
[src]
now: BlockNumber,
sett_price: Self::Balance,
sett_currency_id: Self::CurrencyId,
jusd_price: Self::Balance,
jusd_currency_id: Self::CurrencyId
) -> DispatchResult
fn adjustment_frequency(adjustment_frequency: BlockNumber) -> DispatchResult
[src]
The time used to denote the frequency of price elasticity adjustment;
just a BlockNumber
.
fn on_block_with_price(
currency_id: Self::CurrencyId,
block: BlockNumber,
price: Self::Balance
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
block: BlockNumber,
price: Self::Balance
) -> DispatchResult
Contracts or expands the currency supply based on conditions.
fn serp_elast(
currency_id: Self::CurrencyId,
price: Self::Balance
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
price: Self::Balance
) -> DispatchResult
Expands (if the price is high) or contracts (if the price is low) the currency supply.
fn supply_change(
currency_id: Self::CurrencyId,
price: Self::Balance
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
price: Self::Balance
) -> Self::Balance
Calculate the amount of supply change from a fraction given as numerator
and denominator
.