Trait serp_traits::stp258::SerpTes[][src]

pub trait SerpTes<AccountId>: Stp258Currency<AccountId> {
    type BlockNumber: Decode + Encode + EncodeLike + Clone + Default;
    fn on_serp_block(
        now: Self::BlockNumber,
        stable_currency_id: Self::CurrencyId,
        stable_currency_price: Self::Balance,
        native_currency_id: Self::CurrencyId,
        native_currency_price: Self::Balance
    ) -> DispatchResult;
fn supply_change(
        currency_id: Self::CurrencyId,
        new_price: Self::Balance
    ) -> Self::Balance;
fn serp_elast(
        stable_currency_id: Self::CurrencyId,
        stable_currency_price: Self::Balance,
        native_currency_id: Self::CurrencyId,
        native_currency_price: Self::Balance
    ) -> DispatchResult; }

Abstraction over a fungible multi-stable-currency Token Elasticity of Supply system.

Associated Types

Loading content...

Required methods

fn on_serp_block(
    now: Self::BlockNumber,
    stable_currency_id: Self::CurrencyId,
    stable_currency_price: Self::Balance,
    native_currency_id: Self::CurrencyId,
    native_currency_price: Self::Balance
) -> DispatchResult
[src]

Contracts or expands the currency supply based on conditions. Filters through the conditions to see whether it’s time to adjust supply or not.

fn supply_change(
    currency_id: Self::CurrencyId,
    new_price: Self::Balance
) -> Self::Balance
[src]

Calculate the amount of supply change from a fraction given as numerator and denominator.

fn serp_elast(
    stable_currency_id: Self::CurrencyId,
    stable_currency_price: Self::Balance,
    native_currency_id: Self::CurrencyId,
    native_currency_price: Self::Balance
) -> DispatchResult
[src]

Loading content...

Implementors

Loading content...