Enum tg4_mixer::msg::PoEFunctionType
source · pub enum PoEFunctionType {
GeometricMean {},
Sigmoid {
max_points: Uint64,
p: StdDecimal,
s: StdDecimal,
},
SigmoidSqrt {
max_points: Uint64,
s: StdDecimal,
},
AlgebraicSigmoid {
max_points: Uint64,
a: StdDecimal,
p: StdDecimal,
s: StdDecimal,
},
}
Variants§
GeometricMean
Fields
GeometricMean returns the geometric mean of staked amount and engagement points
Sigmoid
Sigmoid returns a sigmoid-like value of staked amount times engagement points. See the Proof-of-Engagement white-paper for details.
SigmoidSqrt
SigmoidSqrt returns a sigmoid-like value of the geometric mean of staked amount and
engagement points.
It is equal to Sigmoid
with p = 0.5
, but implemented using integer sqrt instead of
fixed-point fractional power.
AlgebraicSigmoid
AlgebraicSigmoid
returns a sigmoid-like value of staked amount times engagement points.
It is similar to Sigmoid
, but uses integer sqrt instead of a fixed-point exponential.
Implementations§
source§impl PoEFunctionType
impl PoEFunctionType
pub fn to_poe_fn(&self) -> Result<Box<dyn PoEFunction>, ContractError>
Trait Implementations§
source§impl Clone for PoEFunctionType
impl Clone for PoEFunctionType
source§fn clone(&self) -> PoEFunctionType
fn clone(&self) -> PoEFunctionType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PoEFunctionType
impl Debug for PoEFunctionType
source§impl<'de> Deserialize<'de> for PoEFunctionType
impl<'de> Deserialize<'de> for PoEFunctionType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl JsonSchema for PoEFunctionType
impl JsonSchema for PoEFunctionType
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq<PoEFunctionType> for PoEFunctionType
impl PartialEq<PoEFunctionType> for PoEFunctionType
source§fn eq(&self, other: &PoEFunctionType) -> bool
fn eq(&self, other: &PoEFunctionType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.