Skip to content

Commit b58e050

Browse files
committed
more accurate max grow profit #638
1 parent 835f680 commit b58e050

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Pools/MRR.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,9 @@ try {
366366
$Algo = $_
367367
$KnownTypes = $KnownAlgos.Keys | ForEach-Object { if ($KnownAlgos[$_].ContainsKey($Algo.Algorithm)) { $_ } }
368368
if ($KnownTypes.Length -gt 0) {
369-
$persprofit = ((($KnownAlgos.Keys | Where-Object { $KnownTypes -contains $_ } | ForEach-Object { $KnownAlgos[$_] }) |
370-
ForEach-Object { ($_.Values | Where-Object { $_ -and $_.Profit -gt 0 } | Measure-Object Profit -Maximum) }) | Measure-Object -Property Maximum -Sum).Sum *
371-
(100 + $Cfg.Target) / 100
369+
$rigproft = ((($KnownAlgos.Keys | Where-Object { $KnownTypes -contains $_ } | ForEach-Object { $KnownAlgos[$_] }) |
370+
ForEach-Object { ($_.Values | Where-Object { $_ -and $_.Profit -gt 0 } | Measure-Object Profit -Maximum) }) | Measure-Object -Property Maximum -Sum).Sum
371+
$persprofit = $rigproft * (100 + $Cfg.Target) / 100
372372
# Write-Host "$($Algo.Algorithm) Profit rig $([decimal]::Round($sumprofit, 8)), alg $([decimal]::Round($persprofit, 8))"
373373
$Speed = (($KnownAlgos.Values | ForEach-Object { $t = $_[$Algo.Algorithm]; if ($t) { $t } }) | Measure-Object Speed -Sum).Sum
374374
$Profit = $Speed * $Algo.Extra["price"]
@@ -410,6 +410,7 @@ try {
410410
if ($rig -and !$rig.status.rented -and $rig.available_status -match "available") {
411411
$SpeedAdv = [decimal]$rig.hashrate.advertised.hash * [MultipleUnit]::ToValueInvariant("1", $rig.hashrate.advertised.type.ToLower().TrimEnd("h"))
412412
$prft = $SpeedAdv * [decimal]$rig.price.BTC.price / [MultipleUnit]::ToValueInvariant("1", $rig.price.type.ToLower().TrimEnd("h"))
413+
$riggrowproft = $rigproft * (100 + $Cfg.Target * $Config.MaximumAllowedGrowth) / 100
413414
# Write-Host "MRR: Check profit $($Algo.Algorithm) ($(Get-Join ", " $KnownTypes)) $([decimal]::Round($prft, 8)) grater $([decimal]::Round($persprofit, 8))"
414415
if ($PrevRented -contains $rig.id -and !$rig.status.rented) {
415416
if ($prft -lt $persprofit) { $prft = $persprofit }
@@ -421,8 +422,8 @@ try {
421422
elseif ($prft -lt $persprofit) {
422423
$persprofit *= 1.01
423424
}
424-
elseif ($prft -gt ($persprofit * $Config.MaximumAllowedGrowth)) {
425-
$persprofit *= $Config.MaximumAllowedGrowth
425+
elseif ($prft -gt $riggrowproft) {
426+
$persprofit = $riggrowproft
426427
}
427428
else {
428429
$persprofit = 0

0 commit comments

Comments
 (0)