Skip to content

Apply credibility ramp linearly, not cubed#359

Merged
anderdc merged 1 commit into
testfrom
fix/credibility-ramp-not-cubed
May 21, 2026
Merged

Apply credibility ramp linearly, not cubed#359
anderdc merged 1 commit into
testfrom
fix/credibility-ramp-not-cubed

Conversation

@LandynDev
Copy link
Copy Markdown
Collaborator

Problem

The credibility ramp was being cubed along with the raw success rate in the emission formula. success_rate() returned the product raw_rate × ramp, and calculate_miner_rewards then raised that whole value to SUCCESS_EXPONENT (3) — so the effective term was raw_rate³ × ramp³ instead of raw_rate³ × ramp.

Impact (perfect raw rate, 6/10 closed swaps → ramp 0.6):

  • Before: (1.0 × 0.6)³ = 0.216 → 21.6% of pool
  • After: 1.0³ × 0.6 = 0.6 → 60% of pool

Worst for new miners: 1/1 completed earned 0.1³ = 0.001 (≈0) instead of 0.1. The intended linear on-ramp had become a near-cliff.

Fix

  • success_rate() now returns the raw completed / closed ratio (cubed in the reward).
  • New credibility_ramp() returns the linear ramp multiplier, applied once, uncubed.
  • Reward: pool × crown_share × raw_rate³ × ramp × capacity × volume_factor.

Tests

  • Split TestSuccessRateHelper into raw-rate and ramp helper tests.
  • Updated end-to-end ramp expectations (1/1 → 0.1×pool, 5/5 → 0.5×pool, recycle remainder). Full-ramp and timeout cases are numerically unchanged.
  • Full suite: 528 passed.

@anderdc anderdc merged commit 0fa2ac3 into test May 21, 2026
3 checks passed
@anderdc anderdc deleted the fix/credibility-ramp-not-cubed branch May 21, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants