referrerpolicy=no-referrer-when-downgrade
pallet_broker

Trait AdaptPrice

Source
pub trait AdaptPrice<Balance> {
    // Required methods
    fn leadin_factor_at(when: FixedU64) -> FixedU64;
    fn adapt_price(
        performance: SalePerformance<Balance>,
    ) -> AdaptedPrices<Balance>;
}
Expand description

Type for determining how to set price.

Required Methods§

Source

fn leadin_factor_at(when: FixedU64) -> FixedU64

Return the factor by which the regular price must be multiplied during the leadin period.

  • when: The amount through the leadin period; between zero and one.
Source

fn adapt_price(performance: SalePerformance<Balance>) -> AdaptedPrices<Balance>

Return adapted prices for next sale.

Based on the previous sale’s performance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<Balance: Copy> AdaptPrice<Balance> for ()

Source§

fn leadin_factor_at(_: FixedU64) -> FixedU64

Source§

fn adapt_price(performance: SalePerformance<Balance>) -> AdaptedPrices<Balance>

Implementors§

Source§

impl<Balance: FixedPointOperand> AdaptPrice<Balance> for CenterTargetPrice<Balance>