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§
- Binary
Model - Provides a binary influence model that maps input to one of two fixed outputs.
- Binary
Model Config - Binary model configuration
- Capped
Linear Model - Provides a capped linear influence model with an upper bound.
- Capped
Linear Model Config - Configuration for the
CappedLinearModel - Exponential
Model - Provides an exponential influence model with rapid growth.
- Exponential
Model Config - Configuration for Exponential Model
- Linear
Model - Provides a linear influence model where output equals input.
- Logarithmic
Model - Provides a logarithmic influence model with diminishing returns.
- Quadratic
Model - Provides a quadratic (square-root) influence model that compresses large inputs.
- Sigmoid
Model - Provides a sigmoid (logistic) influence model with a configurable growth phase.
- Sigmoid
Model Config - Configuration for the SigmoidModel. Parameters define the maximum output and the growth phase range for the curve.
- Threshold
Model - Provides a threshold-based influence model that enforces minimum eligibility.
- Threshold
Model Config - Configuration: the threshold value to activate influence.