Trait stp258_traits::serp_tes::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 adjustment_frequency(adjustment_frequency: BlockNumber) -> DispatchResult
[src]
fn total_issuance(currency_id: Self::CurrencyId) -> Self::Balance
[src]
The total amount of issuance of currency_id
.
fn contract_supply(
currency_id: Self::CurrencyId,
total_issuance: Self::Balance,
amount: Self::Balance,
to: &AccountId
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
total_issuance: Self::Balance,
amount: Self::Balance,
to: &AccountId
) -> DispatchResult
Contract the currency supply.
fn expand_supply(
currency_id: Self::CurrencyId,
total_issuance: Self::Balance,
amount: Self::Balance,
to: &AccountId
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
total_issuance: Self::Balance,
amount: Self::Balance,
to: &AccountId
) -> DispatchResult
Expand the currency supply.
fn on_block_with_price(
block: BlockNumber,
currency_id: Self::CurrencyId,
price: Price
) -> DispatchResult
[src]
block: BlockNumber,
currency_id: Self::CurrencyId,
price: Price
) -> DispatchResult
Contracts or expands the currency supply based on conditions.
fn serp_elast(currency_id: Self::CurrencyId, price: Price) -> DispatchResult
[src]
Expands (if the price is high) or contracts (if the price is low) the currency supply.
fn supply_change(
currency_id: Self::CurrencyId,
numerator: u64,
denominator: u64,
supply: u64
) -> u64
[src]
currency_id: Self::CurrencyId,
numerator: u64,
denominator: u64,
supply: u64
) -> u64
Calculate the amount of supply change from a fraction given as numerator
and denominator
.