diff --git a/Brains/HashCryptos.ps1 b/Brains/HashCryptos.ps1 index c8081379b9..01824e0166 100644 --- a/Brains/HashCryptos.ps1 +++ b/Brains/HashCryptos.ps1 @@ -100,8 +100,8 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $GroupMedSampleSizeNoPercent = $AlgoObject | Where-Object { $_.Date -ge ($CurDate - $SampleSizets) } | Group-Object Name | Select-Object Name, Count, @{Name = "Avg"; Expression = { ($_.group.Last24DriftPercent | Measure-Object -Average).Average } }, @{Name = "Median"; Expression = { Get-Median $_.group.Last24Drift } } ForEach ($Name in ($AlgoObject.Name | Select-Object -Unique)) { - $PenaltySampleSizeHalf = (($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) - $PenaltySampleSizeNoPercent = (($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) $Penalty = ($PenaltySampleSizeHalf * $BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($BrainConfig.SampleHalfPower + 1) $Price = [math]::max(0, [Double]($Penalty + ($CurAlgoObject | Where-Object { $_.Name -eq $Name }).actual_last24h)) $AlgoData.$Name | Add-Member @{ Plus_Price = $Price } -Force diff --git a/Brains/MiningDutch.ps1 b/Brains/MiningDutch.ps1 index b1f84c9623..d4d5d50ec2 100644 --- a/Brains/MiningDutch.ps1 +++ b/Brains/MiningDutch.ps1 @@ -105,8 +105,8 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $GroupMedSampleSizeNoPercent = $AlgoObject | Where-Object { $_.Date -ge ($CurDate - $SampleSizets) } | Group-Object Name | Select-Object Name, Count, @{Name = "Avg"; Expression = { ($_.group.Last24DriftPercent | Measure-Object -Average).Average } }, @{Name = "Median"; Expression = { Get-Median $_.group.Last24Drift } } ForEach ($Name in ($AlgoObject.Name | Select-Object -Unique)) { - $PenaltySampleSizeHalf = (($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) - $PenaltySampleSizeNoPercent = (($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) $Penalty = ($PenaltySampleSizeHalf * $BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($BrainConfig.SampleHalfPower + 1) $Price = [math]::max(0, [Double]($Penalty + ($CurAlgoObject | Where-Object { $_.Name -eq $Name }).actual_last24h)) $AlgoData.$Name | Add-Member @{ Plus_Price = $Price } -Force diff --git a/Brains/ProHashing.ps1 b/Brains/ProHashing.ps1 index e1ac6feabd..7b247ecb73 100644 --- a/Brains/ProHashing.ps1 +++ b/Brains/ProHashing.ps1 @@ -113,8 +113,8 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $GroupMedSampleSizeNoPercent = $AlgoObject | Where-Object { $_.Date -ge ($CurDate - $SampleSizets) } | Group-Object Name | Select-Object Name, Count, @{Name = "Avg"; Expression = { ($_.group.Last24DriftPercent | Measure-Object -Average).Average } }, @{Name = "Median"; Expression = { Get-Median $_.group.Last24Drift } } ForEach ($Name in ($AlgoObject.Name | Select-Object -Unique)) { - $PenaltySampleSizeHalf = (($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) - $PenaltySampleSizeNoPercent = (($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) $Penalty = ($PenaltySampleSizeHalf * $BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($BrainConfig.SampleHalfPower + 1) $Price = [math]::max(0, [Double]($Penalty + ($CurAlgoObject | Where-Object { $_.Name -eq $Name }).actual_last24h)) $AlgoData.$Name | Add-Member @{ Plus_Price = $Price } -Force diff --git a/Brains/ZPool.ps1 b/Brains/ZPool.ps1 index 14182d24d4..230f6eec48 100644 --- a/Brains/ZPool.ps1 +++ b/Brains/ZPool.ps1 @@ -88,13 +88,10 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { ForEach ($Algo in $AlgoData.PSObject.Properties.Name) { $Currency = $AlgoData.$Algo.Currency If ($Currency) { - # Add coin name and keep data data up to date - If ($AlgoData.$Algo.CoinName) { - Add-CoinName -Algorithm $Algo -Currency $Currency -CoinName $AlgoData.$Algo.CoinName - If ($Variables.DagData.Algorithm.$Algo -and $AlgoData.$Algo.height -gt ($Variables.DAGData.Currency.$Currency.BlockHeight)) { - $Variables.DAGData.Currency.$Currency = (Get-DAGData -Blockheight $AlgoData.$Algo.height -Currency $Currency -EpochReserve 2) - $Variables.DAGData.Updated."$BrainName Brain" = (Get-Date).ToUniversalTime() - } + # Keep DAG data data up to date + If ($Variables.DagData.Algorithm.$Algo -and $AlgoData.$Algo.height -gt ($Variables.DAGData.Currency.$Currency.BlockHeight)) { + $Variables.DAGData.Currency.$Currency = (Get-DAGData -Blockheight $AlgoData.$Algo.height -Currency $Currency -EpochReserve 2) + $Variables.DAGData.Updated."$BrainName Brain" = (Get-Date).ToUniversalTime() } $AlgoData.$Algo | Add-Member @{ conversion_disabled = $CurrenciesData.$Currency.conversion_disabled } -Force If ($CurrenciesData.$Currency.error) { @@ -143,8 +140,8 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $GroupMedSampleSizeNoPercent = $AlgoObject | Where-Object { $_.Date -ge ($CurDate - $SampleSizets) } | Group-Object Name | Select-Object Name, Count, @{Name = "Avg"; Expression = { ($_.group.Last24DriftPercent | Measure-Object -Average).Average } }, @{Name = "Median"; Expression = { Get-Median $_.group.Last24Drift } } ForEach ($Name in ($AlgoObject.Name | Select-Object -Unique)) { - $PenaltySampleSizeHalf = (($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) - $PenaltySampleSizeNoPercent = (($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) $Penalty = ($PenaltySampleSizeHalf * $BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($BrainConfig.SampleHalfPower + 1) $Price = [math]::max(0, [Double]($Penalty + ($CurAlgoObject | Where-Object { $_.Name -eq $Name }).actual_last24h)) $AlgoData.$Name | Add-Member @{ Plus_Price = $Price } -Force @@ -170,7 +167,7 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $Durations.Add($Duration.TotalSeconds) $Durations = [System.Collections.Generic.List[Double]]@($Durations | Select-Object -Last 100) - Remove-Variable Algo, AlgoData, Name -ErrorAction Ignore + Remove-Variable Algo, AlgoData, CurrenciesArray, CurrenciesData, Name -ErrorAction Ignore $Error.Clear() diff --git a/Brains/ZergPool.ps1 b/Brains/ZergPool.ps1 index 1be37c7fb6..59bd2a9a1c 100644 --- a/Brains/ZergPool.ps1 +++ b/Brains/ZergPool.ps1 @@ -92,9 +92,8 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $Currency = If ($Currencies.Currency) { (($Currencies | Sort-Object Estimate)[-1].Currency).Trim() } Else { "" } } - # Add coin name and keep data data up to date - If ($AlgoData.$Algo.CoinName -and $Currency) { - Add-CoinName -Algorithm $Algo -Currency $Currency -CoinName $AlgoData.$Algo.CoinName + If ($Currency) { + # Keep dag data data up to date If ($Variables.DagData.Algorithm.$Algo -and $AlgoData.$Algo.height -gt ($Variables.DAGData.Currency.$Currency.BlockHeight)) { $Variables.DAGData.Currency.$Currency = (Get-DAGData -Blockheight $AlgoData.$Algo.height -Currency $Currency -EpochReserve 2) $Variables.DAGData.Updated."$BrainName Brain" = (Get-Date).ToUniversalTime() @@ -137,8 +136,8 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $GroupMedSampleSizeNoPercent = $AlgoObject | Where-Object { $_.Date -ge ($CurDate - $SampleSizets) } | Group-Object Name | Select-Object Name, Count, @{Name = "Avg"; Expression = { ($_.group.Last24DriftPercent | Measure-Object -Average).Average } }, @{Name = "Median"; Expression = { Get-Median $_.group.Last24Drift } } ForEach ($Name in ($AlgoObject.Name | Select-Object -Unique)) { - $PenaltySampleSizeHalf = (($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) - $PenaltySampleSizeNoPercent = (($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count / ($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeHalf = ((($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSizeHalf | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeHalf | Where-Object { $_.Name -eq $Name }).Median) + $PenaltySampleSizeNoPercent = ((($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Up" }).Count - ($GroupAvgSampleSize | Where-Object { $_.Name -eq $Name + ", Down" }).Count) / (($GroupMedSampleSize | Where-Object { $_.Name -eq $Name }).Count)) * [math]::abs(($GroupMedSampleSizeNoPercent | Where-Object { $_.Name -eq $Name }).Median) $Penalty = ($PenaltySampleSizeHalf * $BrainConfig.SampleHalfPower + $PenaltySampleSizeNoPercent) / ($BrainConfig.SampleHalfPower + 1) $Price = [math]::max(0, [Double]($Penalty + ($CurAlgoObject | Where-Object { $_.Name -eq $Name }).actual_last24h)) $AlgoData.$Name | Add-Member @{ Plus_Price = $Price } -Force @@ -166,7 +165,7 @@ While ($BrainConfig = $Config.PoolsConfig.$BrainName.BrainConfig) { $Durations.Add($Duration.TotalSeconds) $Durations = [System.Collections.Generic.List[Double]]@($Durations | Select-Object -Last 100) - Remove-Variable Algo, AlgoData, CurrenciesData, Name -ErrorAction Ignore + Remove-Variable Algo, AlgoData, CurrenciesArray, CurrenciesData, Name -ErrorAction Ignore $Error.Clear() diff --git a/ChangeLog.txt b/ChangeLog.txt index 997f74dc39..d51b360c5b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -18,6 +18,7 @@ ChangeLog NemosMiner 4.3.4.2 18.04.2023 Fixes: - Brains / ZergPool: Change sort order to select best paying currency - Brains / ZergPool: Default pool fee not set (Regression from 4.3.4.1) +- Brains: Invalid Plus price calculation (Regression from v4.3.4.1) - Core / Includes.psm1: Add-CoinName not updating data files Miner updates: diff --git a/Data/CoinNames.json b/Data/CoinNames.json index 40fda61d49..8739c11496 100644 --- a/Data/CoinNames.json +++ b/Data/CoinNames.json @@ -128,6 +128,7 @@ "CURVE": "CurvehashCoin", "CXC": "CryptroxCoin", "CXT": "Coinonat", + "CY": "Cyberyen", "D": "Denarius", "DANE": "DaneCoin", "DASH": "Dash",