-
Notifications
You must be signed in to change notification settings - Fork 2
/
prop.rb
executable file
·36 lines (29 loc) · 954 Bytes
/
prop.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'pool_sim'
class Prop < PoolSim
attr_reader :lowest_percentage
plot :lowest_percentage
def initialize opts={}
super opts
end
def pay_out
mp = miner_percent / 100.0
hp = hopper_percent / 100.0
pp = ppshopper_percent / 100.0
@honest_earnings += reward * mp
@hopper_earnings += reward * hp
@ppshopper_earnings += reward * pp
@honest_shares += shares * mp
@hopper_shares += shares * hp
@ppshopper_shares += shares * pp
@honest_payout_percentage = 100.0 * @honest_earnings / @honest_shares / pps_price
@hopper_payout_percentage = 100.0 * @hopper_earnings / @hopper_shares / pps_price
@ppshopper_payout_percentage = 100.0 * @ppshopper_earnings / @ppshopper_shares / pps_price
if honest_payout_percentage < lowest_percentage
@lowest_percentage = honest_payout_percentage
end
end
def clear
@buffer = 0.000000001
@lowest_percentage = 100.0
end
end