Module influence

Source
Expand description

Provides a suite of pluggable influence models to transform raw input values (e.g., stake, contribution, vote weight, or score) into computed influence metrics used by election systems, reputation engines, and governance mechanisms.

§Why Influence, Not Raw Values

Raw values (e.g., total stake, number of votes, or token balances) alone often do not capture the relative importance, fairness, or risk-adjusted weight of participants. Influence allows the system to:

  • Normalize inputs so that extreme values do not dominate outcomes.
  • Apply non-linear scaling to reward incremental contributions more fairly.
  • Implement thresholds, caps, or decay functions to manage governance risk.
  • Adjust voting power or rewards dynamically without changing the underlying raw assets.

By computing influence, the system abstracts raw contributions into comparable metrics that can be safely and consistently used in elections, scoring systems, and reward distribution.

§Purpose

Influence models enable flexible, runtime-configurable strategies for calculating how much “power” or “weight” an input carries. By swapping models or adjusting their parameters, the system can adapt to different fairness, risk, or proportionality requirements.

§Key Concepts

  • Input (x): Typically represents the resource, stake, vote, or contribution that is being converted to influence.
  • Output (f(x)): The computed influence value used by election or scoring algorithms.
  • Context: Optional runtime parameters or configurations that guide how the model behaves.

§Usage

Each model is implemented as a plugin_model! and can be applied dynamically in elections, staking, reputation, or governance systems. Context parameters allow fine-tuning without changing the underlying logic.

Example usage scenarios:

  • Flat election systems: compute influence from author stake or backers.
  • Reputation systems: convert contributions to normalized influence scores.
  • Governance voting: implement thresholds, caps, or diminishing returns to improve fairness.

Structs§

BinaryModel
Provides a binary influence model that maps input to one of two fixed outputs.
BinaryModelConfig
Binary model configuration
CappedLinearModel
Provides a capped linear influence model with an upper bound.
CappedLinearModelConfig
Configuration for the CappedLinearModel
ExponentialModel
Provides an exponential influence model with rapid growth.
ExponentialModelConfig
Configuration for Exponential Model
LinearModel
Provides a linear influence model where output equals input.
LogarithmicModel
Provides a logarithmic influence model with diminishing returns.
QuadraticModel
Provides a quadratic (square-root) influence model that compresses large inputs.
SigmoidModel
Provides a sigmoid (logistic) influence model with a configurable growth phase.
SigmoidModelConfig
Configuration for the SigmoidModel. Parameters define the maximum output and the growth phase range for the curve.
ThresholdModel
Provides a threshold-based influence model that enforces minimum eligibility.
ThresholdModelConfig
Configuration: the threshold value to activate influence.