mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
## Summary This PR replaces the percentage-based compounding inflation model with a **linear (non-compounding) inflation model** where a fixed amount of tokens is minted annually, regardless of current total supply. ### Key Changes - **`ExternalRewardsEraInflationProvider`** now calculates per-era inflation from a fixed annual amount instead of a percentage of current total issuance - New **`InflationAnnualAmount`** runtime parameter using the formula: `5_000_000 * HAVE * SUPPLY_FACTOR` - Consistent configuration across all runtimes using `SUPPLY_FACTOR` ### Inflation Configuration | Runtime | SUPPLY_FACTOR | Genesis Supply | Annual Inflation | Per-Era Inflation | |---------|---------------|----------------|------------------|-------------------| | **Mainnet** | 100 | 10B HAVE | 500M HAVE (5%) | ~342,231 HAVE | | **Stagenet** | 1 | 100M HAVE | 5M HAVE (5%) | ~3,422 HAVE | | **Testnet** | 1 | 100M HAVE | 5M HAVE (5%) | ~3,422 HAVE | ### Benefits - **Predictable rewards**: Validators and stakers receive consistent emissions - **Publicly auditable**: All emissions recorded on-chain - **Non-compounding**: Same absolute amount minted each year (not percentage of growing supply) - **Governance-upgradeable**: `InflationAnnualAmount` can be changed via runtime parameters ### Comparison: Before vs After | Aspect | Before (Compounding) | After (Linear) | |--------|---------------------|----------------| | Formula | 5% × current_supply | Fixed 500M HAVE | | Year 1 (10B supply) | 500M HAVE | 500M HAVE | | Year 2 (10.5B supply) | 525M HAVE | 500M HAVE | | Year 10 | ~814M HAVE | 500M HAVE | ## ⚠️ Breaking Changes ⚠️ - **Runtime parameter renamed**: `InflationTargetedAnnualRate` (Perbill) → `InflationAnnualAmount` (Balance) - Old: percentage-based rate applied to current total issuance - New: fixed annual amount in base units (wei) - **`ExternalRewardsEraInflationProvider` type parameters changed**: - Removed: `Balances` (fungible::Inspect) and `AnnualRate` (Get<Perbill>) - Added: `AnnualAmount` (Get<u128>) - **Inflation behavior change**: Inflation is now linear (fixed amount) instead of compounding (percentage of supply) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Gonza Montiel <gonzamontiel@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| build.rs | ||
| Cargo.toml | ||