Trait stp258_traits::serp_tes::SerpTes[][src]

pub trait SerpTes<AccountId, BlockNumber, CurrencyId, Price> {
    type CurrencyId: Parameter + Member + Copy + MaybeSerializeDeserialize;
    type Balance: AtLeast32BitUnsigned + FullCodec + Copy + MaybeSerializeDeserialize + Debug + Default;
    fn adjustment_frequency(adjustment_frequency: BlockNumber) -> DispatchResult;
fn total_issuance(currency_id: Self::CurrencyId) -> Self::Balance;
fn contract_supply(
        currency_id: Self::CurrencyId,
        total_issuance: Self::Balance,
        amount: Self::Balance,
        to: &AccountId
    ) -> DispatchResult;
fn expand_supply(
        currency_id: Self::CurrencyId,
        total_issuance: Self::Balance,
        amount: Self::Balance,
        to: &AccountId
    ) -> DispatchResult;
fn on_block_with_price(
        block: BlockNumber,
        currency_id: Self::CurrencyId,
        price: Price
    ) -> DispatchResult;
fn serp_elast(currency_id: Self::CurrencyId, price: Price) -> DispatchResult;
fn supply_change(
        currency_id: Self::CurrencyId,
        numerator: u64,
        denominator: u64,
        supply: u64
    ) -> u64; }

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 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]

Contract the currency supply.

fn expand_supply(
    currency_id: Self::CurrencyId,
    total_issuance: Self::Balance,
    amount: Self::Balance,
    to: &AccountId
) -> DispatchResult
[src]

Expand the currency supply.

fn on_block_with_price(
    block: BlockNumber,
    currency_id: Self::CurrencyId,
    price: Price
) -> DispatchResult
[src]

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]

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

Loading content...

Implementors

Loading content...