Skip to content

Commit

Permalink
v6.3.19
Browse files Browse the repository at this point in the history
Enhancements:
- Added configuration item 'PoolAllow0Price'

Fixes:
- Brains: Brain price got reset on each loop
- Core: Error creating miners when more than one pool with same algorithm (mark pools as 'Second best algorithm')

Improvements:
- WebGUI / All miners: Also show hourglass
- Update 7-Zip to version 24.09

Miner changes:
- Wildrig-v0.41.5
  • Loading branch information
UselessGuru committed Dec 4, 2024
1 parent 756b5c6 commit 57c85fb
Show file tree
Hide file tree
Showing 129 changed files with 767 additions and 484 deletions.
4 changes: 2 additions & 2 deletions Balances/HashCryptos.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\HashCryptos.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/HiveON.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\Hiveon.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/MiningDutch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\MiningDutch.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/NiceHash.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\NiceHash.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

If ($Config.NiceHashWallet) {
Expand Down
4 changes: 2 additions & 2 deletions Balances/ProHashing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\ProHashing.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/ZergPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\ZergPool.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
4 changes: 2 additions & 2 deletions Balances/Zpool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Balances\Zpool.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

$Name = [String](Get-Item $MyInvocation.MyCommand.Path).BaseName
Expand Down
24 changes: 14 additions & 10 deletions Brains/HashCryptos.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\MiningDutch.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

using module ..\Includes\Include.psm1
Expand All @@ -36,6 +36,8 @@ $BrainName = (Get-Item $MyInvocation.MyCommand.Path).BaseName
$PoolObjects = @()
$APICallFails = 0
$Durations = [TimeSpan[]]@()
$PoolConfig = $Variables.PoolsConfig.$BrainName

$BrainDataFile = "$PWD\Data\BrainData_$BrainName.json"

$Headers = @{ "Accept"="text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";"Cache-Control"="no-cache" }
Expand Down Expand Up @@ -75,10 +77,11 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {

$AlgoData.$Algo | Add-Member Updated $Timestamp -Force

If ($PoolVariant) {
# Reset history when stat file got removed
$StatName = "$($PoolVariant)_$($AlgorithmNorm)_Profit"
If (-not (Get-Stat -Name $StatName)) {
# Reset history when stat file got removed
If ($PoolVariant -like "*Plus") {
$StatName = If ($Currency) { "$($PoolVariant)_$(Get-Algorithm $Algo)-$($Currency)_Profit" } Else { "$($PoolVariant)_$(Get-Algorithm $Algo)_Profit" }
If (-not ($Stat = Get-Stat -Name $StatName) -and $PoolObjects.Where({ $_.Name -eq $PoolName })) {
# Reset history when stat file got removed
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $PoolName })
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit')"
}
Expand Down Expand Up @@ -108,8 +111,8 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
$GroupMedSampleSizeNoPercent = $PoolObjects.Where({ $_.Date -ge ($Timestamp - $SampleSizets) }) | Group-Object Name | Select-Object Name, Count, @{ Name = "Avg"; Expression = { ($_.Group.Last24hDriftPercent | Measure-Object -Average).Average } }, @{ Name = "Median"; Expression = { Get-Median $_.Group.Last24hDrift } }

ForEach ($Algo in ($PoolObjects.Name | Select-Object -Unique).Where({ $AlgoData.PSObject.Properties.Name -contains $_ })) {
$PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Name + ", Down" })).Count) / (($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSize.Where({ $_.Name -eq $Name + ", Down" })).Count) / (($GroupMedSampleSize.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeNoPercent.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Down" })).Count) / (($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Down" })).Count) / (($GroupMedSampleSize.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeNoPercent.Where({ $_.Name -eq $Algo })).Median)
$Penalty = ($PenaltySampleSizeHalf * $PoolConfig.BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($PoolConfig.BrainConfig.SampleHalfPower + 1)
$CurPoolObject = $CurrentPoolObjects.Where({ $_.Name -eq $Algo })
$Currency = $CurPoolObject.currency
Expand All @@ -119,11 +122,12 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
$StatName = If ($Currency) { "$($PoolVariant)_$(Get-Algorithm $Algo)-$($Currency)_Profit" } Else { "$($PoolVariant)_$(Get-Algorithm $Algo)_Profit" }
# Reset history if current estimate is not within +/- 1000% of 24hr stat price
If ($Stat = Get-Stat -Name $StatName) {
If ($LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current -gt $Stat.Day * 10)) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor-gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for '$Algo' (LastPrice: $LastPrice vs. PlusPrice: $PlusPrice)"
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
}
}
$AlgoData.$Algo | Add-Member PlusPrice $PlusPrice -Force
Expand Down
23 changes: 13 additions & 10 deletions Brains/MiningDutch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\MiningDutch.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

using module ..\Includes\Include.psm1
Expand All @@ -36,6 +36,8 @@ $BrainName = (Get-Item $MyInvocation.MyCommand.Path).BaseName
$PoolObjects = @()
$APICallFails = 0
$Durations = [TimeSpan[]]@()
$PoolConfig = $Variables.PoolsConfig.$BrainName

$BrainDataFile = "$PWD\Data\BrainData_$BrainName.json"

$Headers = @{ "Accept"="text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";"Cache-Control"="no-cache" }
Expand Down Expand Up @@ -87,10 +89,10 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
}
Remove-Variable AlgoStats

If ($PoolVariant) {
# Reset history when stat file got removed
# Reset history when stat file got removed
If ($PoolVariant -like "*Plus") {
$StatName = "$($PoolVariant)_$($AlgorithmNorm)_Profit"
If (-not (Get-Stat -Name $StatName)) {
If (-not ($Stat = Get-Stat -Name $StatName) -and $PoolObjects.Where({ $_.Name -eq $PoolName })) {
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $PoolName })
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit')"
}
Expand Down Expand Up @@ -119,20 +121,21 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
$GroupMedSampleSizeNoPercent = $PoolObjects.Where({ $_.Date -ge ($Timestamp - $SampleSizets) }) | Group-Object Name | Select-Object Name, Count, @{ Name = "Avg"; Expression = { ($_.Group.Last24hDriftPercent | Measure-Object -Average).Average } }, @{ Name = "Median"; Expression = { Get-Median $_.Group.Last24hDrift } }

ForEach ($Algo in ($PoolObjects.Name | Select-Object -Unique).Where({ $AlgoData.PSObject.Properties.Name -contains $_ })) {
$PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Name + ", Down" })).Count) / (($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSize.Where({ $_.Name -eq $Name + ", Down" })).Count) / (($GroupMedSampleSize.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeNoPercent.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Down" })).Count) / (($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Down" })).Count) / (($GroupMedSampleSize.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeNoPercent.Where({ $_.Name -eq $Algo })).Median)
$Penalty = ($PenaltySampleSizeHalf * $PoolConfig.BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($PoolConfig.BrainConfig.SampleHalfPower + 1)
$LastPrice = [Double]$CurrentPoolObjects.Where({ $_.Name -eq $Algo }).estimate_current
$PlusPrice = [Math]::max(0, [Double]($LastPrice + $Penalty))

$StatName = If ($Currency) { "$($PoolVariant)_$(Get-Algorithm $Algo)-$($Currency)_Profit" } Else { "$($PoolVariant)_$(Get-Algorithm $Algo)_Profit" }
# Reset history if PlusPrice is not within +/- 1000% of 24hr stat price
# Reset history if current estimate is not within +/- 1000% of 24hr stat price
If ($Stat = Get-Stat -Name $StatName) {
If ($LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current -gt $Stat.Day * 10)) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor-gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for '$Algo' (LastPrice: $LastPrice vs. PlusPrice: $PlusPrice)"
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
}
}
$AlgoData.$Algo | Add-Member PlusPrice $PlusPrice -Force
Expand Down
23 changes: 13 additions & 10 deletions Brains/ProHashing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<#
Product: UG-Miner
File: \Brains\ProHashing.ps1
Version: 6.3.18
Version date: 2024/11/30
Version: 6.3.19
Version date: 2024/12/04
#>

using module ..\Includes\Include.psm1
Expand All @@ -36,6 +36,8 @@ $BrainName = (Get-Item $MyInvocation.MyCommand.Path).BaseName
$PoolObjects = @()
$APICallFails = 0
$Durations = [TimeSpan[]]@()
$PoolConfig = $Variables.PoolsConfig.$BrainName

$BrainDataFile = "$PWD\Data\BrainData_$BrainName.json"

$Headers = @{ "Accept"="text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";"Cache-Control"="no-cache" }
Expand Down Expand Up @@ -83,10 +85,10 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
$AlgoData.$Algo | Add-Member Currency $Currency
$AlgoData.$Algo | Add-Member Updated $Timestamp

If ($PoolVariant) {
# Reset history when stat file got removed
# Reset history when stat file got removed
If ($PoolVariant -like "*Plus") {
$StatName = If ($Currency) { "$($PoolVariant)_$($AlgorithmNorm)-$($Currency)_Profit" } Else { "$($PoolVariant)_$($AlgorithmNorm)_Profit" }
If (-not (Get-Stat -Name $StatName)) {
If (-not ($Stat = Get-Stat -Name $StatName) -and $PoolObjects.Where({ $_.Name -eq $PoolName })) {
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $PoolName })
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit')"
}
Expand Down Expand Up @@ -116,20 +118,21 @@ While ($PoolConfig = $Config.PoolsConfig.$BrainName) {
$GroupMedSampleSizeNoPercent = $PoolObjects.Where({ $_.Date -ge ($Timestamp - $SampleSizets) }) | Group-Object Name | Select-Object Name, Count, @{ Name = "Avg"; Expression = { ($_.Group.Last24hDriftPercent | Measure-Object -Average).Average } }, @{ Name = "Median"; Expression = { Get-Median $_.Group.Last24hDrift } }

ForEach ($Algo in ($PoolObjects.Name | Select-Object -Unique).Where({ $AlgoData.PSObject.Properties.Name -contains $_ })) {
$PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Name + ", Down" })).Count) / (($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSize.Where({ $_.Name -eq $Name + ", Down" })).Count) / (($GroupMedSampleSize.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeNoPercent.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSizeHalf.Where({ $_.Name -eq $Algo + ", Down" })).Count) / (($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeHalf.Where({ $_.Name -eq $Algo })).Median)
$PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Up" })).Count - ($GroupAvgSampleSize.Where({ $_.Name -eq $Algo + ", Down" })).Count) / (($GroupMedSampleSize.Where({ $_.Name -eq $Algo })).Count)) * [Math]::abs(($GroupMedSampleSizeNoPercent.Where({ $_.Name -eq $Algo })).Median)
$Penalty = ($PenaltySampleSizeHalf * $PoolConfig.BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($PoolConfig.BrainConfig.SampleHalfPower + 1)
$LastPrice = [Double]$CurrentPoolObjects.Where({ $_.Name -eq $Algo }).estimate_current
$PlusPrice = [Math]::max(0, [Double]($LastPrice + $Penalty))

$StatName = If ($Currency) { "$($PoolVariant)_$(Get-Algorithm $Algo)-$($Currency)_Profit" } Else { "$($PoolVariant)_$(Get-Algorithm $Algo)_Profit" }
# Reset history if PlusPrice is not within +/- 1000% of 24hr stat price
# Reset history if current estimate is not within +/- 1000% of 24hr stat price
If ($Stat = Get-Stat -Name $StatName) {
If ($LastPrice -gt 0 -and ($PlusPrice -lt $Stat.Day / 10 -or $PlusPrice -gt $Stat.Day * 10)) {
$Divisor = $PoolConfig.Variant."$PoolVariant".DivisorMultiplier * $AlgoData.$Algo.mbtc_mh_factor
If ($Stat.Day -and $LastPrice -gt 0 -and ($AlgoData.$Algo.estimate_current / $Divisor -lt $Stat.Day / 10 -or $AlgoData.$Algo.estimate_current / $Divisor-gt $Stat.Day * 10)) {
Remove-Stat -Name $StatName
$PoolObjects = $PoolObjects.Where({ $_.Name -ne $Algo })
$PlusPrice = $LastPrice
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for '$Algo' (LastPrice: $LastPrice vs. PlusPrice: $PlusPrice)"
Write-Message -Level Debug "Pool brain '$BrainName': PlusPrice history cleared for $($StatName -replace '_Profit') (stat day price: $($Stat.Day) vs. estimate current price: $($AlgoData.$Algo.estimate_current / $Divisor))"
}
}
$AlgoData.$Algo | Add-Member PlusPrice $PlusPrice -Force
Expand Down
Loading

0 comments on commit 57c85fb

Please sign in to comment.