Skip to content

Commit

Permalink
Fix plus price
Browse files Browse the repository at this point in the history
  • Loading branch information
UselessGuru committed Apr 18, 2023
1 parent 8d299bd commit 36bc4f0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Brains/HashCryptos.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Brains/MiningDutch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Brains/ProHashing.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 7 additions & 10 deletions Brains/ZPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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()

Expand Down
11 changes: 5 additions & 6 deletions Brains/ZergPool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Data/CoinNames.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"CURVE": "CurvehashCoin",
"CXC": "CryptroxCoin",
"CXT": "Coinonat",
"CY": "Cyberyen",
"D": "Denarius",
"DANE": "DaneCoin",
"DASH": "Dash",
Expand Down

0 comments on commit 36bc4f0

Please sign in to comment.