ComFox Docs
  • 👋Welcome
  • ☀️Introduction
  • 😭market dilemma
  • 🔨ComFox's Solution
  • 💥Core Philosoph
  • Technology
    • Terminology
    • Daily Mandatory Reward Release
    • On-Chain Automatic Dividend Algorithm
  • Triple token buyback for price increase
  • Three-Dimensional Ecosystem
  • Investor Income Matrix
  • Empowerment System For Projects
  • Value Symbiosis Engine
  • Zero-Knowledge Proof for Referral Rewards Distribution
  • FairMint Protocol
  • PowerSwap Engine
  • BurnDAO Mechanism
  • Economics
    • Token Model
    • LPH Mining Rewards
    • TH Mining Rewards
    • TS Ranking
    • Selling Mechanism
  • Advantages
    • 👀Advantages
    • ⏰Triple-Win Ecosystem
    • 📊Strengths of project issuers:
  • Tutorials & Links
    • 📗Tutorials
    • 🔗Links
Powered by GitBook
On this page
  • Cause
  • Implementation
  • 3 Advantages
Export as PDF
  1. Technology

On-Chain Automatic Dividend Algorithm

Cause

The traditional dividend calculation formula is: MyDividend = MyHashrate * (DividendAmount / TotalHashrate).

At dividend time, the dividend amount must be calculated for each user. When the number of users is large, on-chain calculations consume significant gas, sometimes even causing the smart contract method to fail due to excessive gas consumption. As a result, many opt for centralized dividend calculations, which cannot guarantee fairness and transparency. If the centralized server stops running, dividend rewards cannot be claimed.

To solve this problem, ComFox's LPH mining reward distribution adopts a 100% decentralized on-chain automatic dividend algorithm.

Implementation

  • totalLPH: The total LPH of the entire network. Increases when users purchase LPH.

  • usersUnitAcc: The cumulative unit hashrate reward value.

  • myLPH: My LPH hashrate value.

  • myDebt: My debt value. Updated after claiming rewards.

  1. Reward Release

When releasing rewards, only the usersUnitAcc value needs to be updated:

usersUnitAcc = usersUnitAcc + (ReleasedAmount / totalLPH)

Real-Time Reward Calculation

MyPendingRewards = myLPH * usersUnitAcc - myDebt

Claiming Rewards

CurrentClaimableRewards = myLPH * usersUnitAcc - myDebt

Update My Debt: myDebt = usersUnitAcc * myLPH

3 Advantages

  • Efficiency: Dividend calculation does not increase with the number of users, saving significant gas fees.

  • Fairness: 100% on-chain execution ensures openness and fairness.

  • Real-Time: Once rewards are released, users can immediately view and claim their earnings.

  • Security: Unclaimed rewards accumulate daily. Your rewards will never be lost.

PreviousDaily Mandatory Reward ReleaseNextTriple token buyback for price increase

Last updated 10 days ago