Counter Random Payment
I was thinking about my previous conception https://ness-main-dev.medium.com/random-payment-e438874f458b and realized, that it does not suit our needs.
1. It’s unfair (the user can be payed twice a month)
2. It’s not understandable to user.
So I invented another conception CRP — counter random payment
Each user has a counter.
The Counter starts from 0 and counts every hour +1 if user is active.
The user is active if he has enough balance to pay for the counted hours.
Every Random days (month+/- Delta) the user gets payed from his balance for counted hours and the Counter RESETS to 0.
Get Aleksej Sokolov’s stories in your inbox
Join Medium for free to get updates from this writer.
RH — Random Hours
C — Counter
B — Balance (Coin Hours — Fee %)
T — Tariff (Coin Hours per hour)
D — delta hours for randomness
if (B > C*T) { // If user is active
C++;if (C ≥ RH) {
if (PAY()) {
C = 0;
RH = 7200 — D + RANDOM(D*2);
}
}
}
Benefits:
1. It’s fair (all hours gets counted and payed)
2. It’s understandable for user
3. It’s simple








