Trait stp258_traits::stp258::SerpTes[][src]

pub trait SerpTes<BlockNumber> {
    type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize;
    type Balance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default;
    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;
fn adjustment_frequency(adjustment_frequency: BlockNumber) -> DispatchResult;
fn on_block_with_price(
        currency_id: Self::CurrencyId,
        block: BlockNumber,
        price: Self::Balance
    ) -> DispatchResult;
fn serp_elast(
        currency_id: Self::CurrencyId,
        price: Self::Balance
    ) -> DispatchResult;
fn supply_change(
        currency_id: Self::CurrencyId,
        price: Self::Balance
    ) -> Self::Balance; }

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.

Loading content...

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]

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]

Contracts or expands the currency supply based on conditions.

fn serp_elast(
    currency_id: Self::CurrencyId,
    price: Self::Balance
) -> 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,
    price: Self::Balance
) -> Self::Balance
[src]

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

Loading content...

Implementors

Loading content...