Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta2 #312

Merged
merged 71 commits into from
Mar 8, 2020
Merged

Beta2 #312

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d421396
Initial Beta Changes
MaynardMiner Feb 24, 2020
a13dc13
Merge branch 'master' of https://github.com/MaynardMiner/SWARM into b…
MaynardMiner Feb 24, 2020
0465302
prevent divide by zero
MaynardMiner Feb 25, 2020
7bef136
beta2 update
MaynardMiner Feb 25, 2020
cd01f3d
beta2 stats
MaynardMiner Feb 25, 2020
2ebd9bb
beta2 update
MaynardMiner Feb 25, 2020
1f35f08
beta update
MaynardMiner Feb 25, 2020
dfa46c0
beta2 update
MaynardMiner Feb 25, 2020
e1587cd
update beta2
MaynardMiner Feb 25, 2020
dcc4467
beta2 update
MaynardMiner Feb 25, 2020
5582ee7
beta2
MaynardMiner Feb 27, 2020
4fc1028
beta2 update
MaynardMiner Feb 27, 2020
2cc8bd1
beta2 update
MaynardMiner Feb 27, 2020
0b49f35
beta2 update
MaynardMiner Feb 27, 2020
c7889a7
beta2 update
MaynardMiner Feb 27, 2020
55e1eaf
Merge branch 'master' of https://github.com/maynardminer/SWARM into b…
MaynardMiner Feb 27, 2020
043dc72
beta2 update
MaynardMiner Feb 28, 2020
8e08168
beta2 update
MaynardMiner Feb 29, 2020
6dd8831
beta2 update
MaynardMiner Feb 29, 2020
9d52a9f
beta2 update
MaynardMiner Feb 29, 2020
d9af659
beta2 update
MaynardMiner Mar 1, 2020
744944a
beta2 update
MaynardMiner Mar 1, 2020
89e8725
Merge branch 'beta2' of https://github.com/maynardminer/SWARM into beta2
MaynardMiner Mar 1, 2020
21b5760
beta2 update
MaynardMiner Mar 1, 2020
2025492
6th decimal place
MaynardMiner Mar 1, 2020
12c4e9e
beta2 update
MaynardMiner Mar 1, 2020
0f22383
beta2 update
MaynardMiner Mar 1, 2020
006bbb2
beta2 update
MaynardMiner Mar 1, 2020
0d74718
beta2 update
MaynardMiner Mar 1, 2020
66d7b62
beta2 update
MaynardMiner Mar 1, 2020
39d792c
beta2 update
MaynardMiner Mar 1, 2020
755a056
beta2 updated
MaynardMiner Mar 1, 2020
5aaf3f6
beta2 update
MaynardMiner Mar 1, 2020
16aabf1
beta2 update
MaynardMiner Mar 1, 2020
88e64fd
beta2 update
MaynardMiner Mar 1, 2020
01faa02
beta2 update
MaynardMiner Mar 1, 2020
0af35f1
beta2 update
MaynardMiner Mar 1, 2020
8c7ec3e
beta2 update
MaynardMiner Mar 1, 2020
f9db4c5
beta2 update
MaynardMiner Mar 1, 2020
1c9a9cb
beta2 update
MaynardMiner Mar 2, 2020
680de4f
fix startup beta2
MaynardMiner Mar 3, 2020
678ef85
beta2 update
MaynardMiner Mar 3, 2020
a01ae35
update bata2
MaynardMiner Mar 3, 2020
9a46695
Merge branch 'beta2' of https://github.com/maynardminer/SWARM into beta2
MaynardMiner Mar 3, 2020
b35c26f
beta2 update
MaynardMiner Mar 3, 2020
83a200a
beta2 update
MaynardMiner Mar 3, 2020
69ff7d9
Merge branch 'beta2' of https://github.com/maynardminer/SWARM into beta2
MaynardMiner Mar 3, 2020
2b52dbd
beta2 update
MaynardMiner Mar 3, 2020
b8e6aab
beta2 update
MaynardMiner Mar 3, 2020
5a9a10c
beta2
MaynardMiner Mar 3, 2020
fa5a2f4
Merge branch 'beta2' of https://github.com/maynardminer/SWARM into beta2
MaynardMiner Mar 3, 2020
f1ad4f3
beta2 update
MaynardMiner Mar 3, 2020
ebef0c8
Update SWARM_help.txt
MaynardMiner Mar 3, 2020
ae89e9c
Update SWARM_help.txt
MaynardMiner Mar 3, 2020
e4c13ae
beta2 update
MaynardMiner Mar 4, 2020
98830e4
beta2 update
MaynardMiner Mar 4, 2020
d3c524e
beta2 update
MaynardMiner Mar 4, 2020
618e568
beta2 update
MaynardMiner Mar 4, 2020
1ae8e73
Merge branch 'beta2' of https://github.com/MaynardMiner/SWARM into beta2
MaynardMiner Mar 4, 2020
792c8c1
beta2 update
MaynardMiner Mar 4, 2020
04f73d0
beta2 update
MaynardMiner Mar 4, 2020
ee8d64c
beta2 update
MaynardMiner Mar 4, 2020
2beed44
beta2 update
MaynardMiner Mar 4, 2020
ff726f8
beta2 update
MaynardMiner Mar 8, 2020
2c36997
Merge branch 'beta2' of https://github.com/MaynardMiner/SWARM into beta2
MaynardMiner Mar 8, 2020
9dabccd
beta2 update
MaynardMiner Mar 8, 2020
9d5e21f
beta2 miners update
MaynardMiner Mar 8, 2020
8e735ee
beta2update
MaynardMiner Mar 8, 2020
ae2f2af
beta2 update
MaynardMiner Mar 8, 2020
57f1c4a
bump version
MaynardMiner Mar 8, 2020
896f3a7
bump version
MaynardMiner Mar 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Help_Windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:: This will run through a guided setup to start SWARM.
:: When finished it will save your settings.

pwsh -executionpolicy Bypass -command ".\startup.ps1 -help"
pwsh-preview -executionpolicy Bypass -command ".\startup.ps1 -help"

:: Once you have first ran SWARM, you can run this guided help again
:: through command prompt with the commmand ``swarm_help``
Expand Down
2 changes: 1 addition & 1 deletion Hive_Windows_Reset.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
:: Run this script to reset all saved settings. This will ::ove newarguments.json (current user parameters)
:: as well.

pwsh -noexit -executionpolicy bypass -windowstyle maximized -command ".\build\powershell\scripts\reset.ps1"
pwsh-preview -noexit -executionpolicy bypass -windowstyle maximized -command ".\build\powershell\scripts\reset.ps1"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ SWARM is very customizable. At the base layer- It is easy to setup by simply inp

SWARM was designed to make SWARM bigger than itself. All commands can be executed via bash scripts/shell commands on the linux side, and we are slowly implementing the same features to the window's side. With the ``Lite`` mode, SWARM can be easily incorporated into any current miningOS available, and users can customize/create their own launch process, independent of SWARM. In Windows, you should be able to run cmd.exe and powershell actions through HiveOS dashboard. An example of this would be:

``get-process | Where-Object name -eq "pwsh"``
``get-process | Where-Object name -eq "pwsh-preview"``

Would give you a list of all powershell core processes.

Expand All @@ -77,7 +77,7 @@ I am a sole developer, and this is a large project. I prioritize workload by req
* HiveOS user account, your farm hash ready. Ideally a pre-made flight sheet for SWARM. See wiki on how to setup a flight sheet.
* https://hiveos.farm/
* Latest Powershell Core, along with it being set in your PATH environment variable (should be done during install of Powershell Core).
https://github.com/PowerShell/PowerShell/releases/tag/v6.2.3
https://github.com/PowerShell/PowerShell/releases/tag/v7.0.0-rc.3
* Latest .NET core runtime.
* https://dotnet.microsoft.com/download/dotnet-core/3.0
* Latest .NET runtime.
Expand Down
4 changes: 2 additions & 2 deletions SWARM.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ cd /D %~dp0
:: FOR ALL ARGUMENTS: SEE help folder. Explanation on how to use -Type NVIDIA1,NVIDIA2,NVIDIA3 is provided.
:: HERE is an example of basic arguments:
::
:: pwsh -executionpolicy Bypass -command ".\startup.ps1 -RigName1 SWARM -Location US -PoolName nlpool,blockmasters,zergpool,nicehash,fairpool,ahashpool,blazepool,hashrefinery,zpool -Type AMD1 -Wallet1 1RVNsdO6iuwEHfoiuwe123hsdfljk -Donate .5"
:: pwsh-preview -executionpolicy Bypass -command ".\startup.ps1 -RigName1 SWARM -Location US -PoolName nlpool,blockmasters,zergpool,nicehash,fairpool,ahashpool,blazepool,hashrefinery,zpool -Type AMD1 -Wallet1 1RVNsdO6iuwEHfoiuwe123hsdfljk -Donate .5"

pwsh -executionpolicy Bypass -command ".\startup.ps1"
pwsh-preview -executionpolicy Bypass -command ".\startup.ps1"
2 changes: 1 addition & 1 deletion Windows_10_Optimize.bat
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ cd %~dp0

REM DON'T RUN WITH SWARM RUNNING!

pwsh -executionpolicy Bypass -command ".\build\powershell\scripts\win_optimize.ps1"
pwsh-preview -executionpolicy Bypass -command ".\build\powershell\scripts\win_optimize.ps1"

REM REBOOT advised afterwards.
138 changes: 91 additions & 47 deletions algopools/ahashpool.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
$Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName
$Pool_Request = [PSCustomObject]@{ }

if ($(arg).xnsub -eq "Yes") { $X = "#xnsub" }
$X = ""
if ($(arg).xnsub -eq "Yes") { $X = "#xnsub" }

if ($Name -in $(arg).PoolName) {
try { $Pool_Request = Invoke-RestMethod "https://www.ahashpool.com/api/status" -UseBasicParsing -TimeoutSec 10 -ErrorAction Stop }
Expand All @@ -16,57 +17,92 @@ if ($Name -in $(arg).PoolName) {
$Algos = @()
$Algos += $(vars).Algorithm
$Algos += $(arg).ASIC_ALGO
$Algos = $Algos | ForEach-Object { if ($Bad_pools.$_ -notcontains $Name) { $_ } }


## Only get algos we need & convert name to universal schema
$Pool_Sorted = $Pool_Request.PSobject.Properties.Value | Where-Object { [Convert]::ToDouble($_.estimate_current) -gt 0 } | ForEach-Object {
$Pool_Algos = $global:Config.Pool_Algos;
$Ban_Hammer = $global:Config.vars.BanHammer;
$Pool_Sorted = $Pool_Request.PSobject.Properties.Value | ForEach-Object -Parallel {
$Pipe_Algos = $using:Pool_Algos;
$Pipe_Hammer = $using:Ban_Hammer;
$Algo_List = $using:Algos;
$Pipe_Name = $using:Name;
$N = $_.Name;
$_ | Add-Member "Original_Algo" $N
$_.Name = $global:Config.Pool_Algos.PSObject.Properties.Name | Where { $N -in $global:Config.Pool_Algos.$_.alt_names };
if ($_.Name) { if ($_.Name -in $Algos -and $Name -notin $global:Config.Pool_Algos.$($_.Name).exclusions -and $_.Name -notin $(vars).BanHammer) { $_ } }
}
$_ | Add-Member "Original_Algo" $N;
$_.Name = $Pipe_Algos.PSObject.Properties.Name | Where { $N -in $Pipe_Algos.$_.alt_names };
if ($_.Name) { if ($_.Name -in $Algo_List -and $Pipe_Name -notin $Pipe_Algos.$($_.Name).exclusions -and $_.Name -notin $Pipe_Hammer) { return $_ } }
} -ThrottleLimit $(arg).Throttle

$Pool_Sorted | ForEach-Object {
$Day_Estimate = [Convert]::ToDouble($_.estimate_last24h);
$Day_Return = [Convert]::ToDouble($_.actual_last24h);
if ($Day_Estimate -gt 0 -and $Day_Return -gt 0) {
$Raw = shuffle $Day_Estimate $Day_Return
}
## If either value is 0, deviation is 100% (either coin was not mined, or had no value)
else {
$Raw = -1
}
$_ | Add-Member "deviation" $Raw
## These are modified, then returned back to the original
## value below. This is so that threading can be done.
$DivisorTable = $Global:Config.vars.DivisorTable
$FeeTable = $Global:Config.vars.FeeTable
$Hashrate_Table = $Global:Config.vars.Pool_HashRates
$Get_Params = $Global:Config.params
$Get_Wallets = $Wallets


$Pool_Data = $Pool_Sorted | ForEach-Object -Parallel {
. .\build\powershell\global\classes.ps1
$D_Table = $using:DivisorTable
$F_Table = $using:FeeTable
$H_Table = $using:Hashrate_Table
$P_Name = $using:Name
$sub = $using:X
$Params = $using:Get_Params
$Wallets = $using:Get_Wallets
$StatAlgo = $_.Name -replace "`_", "`-"
$StatPath = "$($Name)_$($StatAlgo)_profit"
if (-not (test-Path ".\stats\$StatPath") ) { $Estimate = [Convert]::ToDouble($_.estimate_last24h) }
else { $Estimate = [Convert]::ToDouble($_.estimate_current) }

$Pool_Port = $_.port
$Pool_Host = "$($_.Original_Algo).mine.ahashpool.com$X"
$Divisor = 1000000 * $_.mbtc_mh_factor
$Pool_Port = $_.port
$Pool_Host = "$($_.Original_Algo).mine.ahashpool.com${sub}"
$StatName = "$($P_Name)_$($StatAlgo)"
$Get_Path = [IO.File]::Exists(".\stats\pool_$($StatName)_pricing.json")
$Hashrate = $_.hashrate
if ([Convert]::ToDouble($HashRate) -eq 0) { $Hashrate = 1 } ## Set to prevent volume dividebyzero error
$previous = [Math]::Max(([Convert]::ToDouble($_.actual_last24h) * 0.001) / $Divisor * (1 - ($_.fees / 100)), $SmallestValue)
$Estimate = $_.estimate_last24h
if ($Get_Path) { $Estimate = $_.estimate_current }

$Deviation = $_.Deviation
$Stat = Global:Set-Stat -Name $StatPath -HashRate $HashRate -Value ( $Estimate / $Divisor * (1 - ($_.fees / 100))) -Shuffle $Deviation
if (-not $(vars).Pool_Hashrates.$($_.Name)) { $(vars).Pool_Hashrates.Add("$($_.Name)", @{ }) }
if (-not $(vars).Pool_Hashrates.$($_.Name).$Name) { $(vars).Pool_Hashrates.$($_.Name).Add("$Name", @{HashRate = "$($Stat.HashRate)"; Percent = "" }) }

$Level = $Stat.$($(arg).Stat_Algo)
if ($(arg).Historical_Bias -gt 0) {
$new_estimate = [Convert]::ToDecimal($Estimate)
$current = [Convert]::ToDecimal($new_estimate / $Divisor * (1 - ($_.fees / 100)))
$new_actual = [Convert]::ToDecimal($_.actual_last24h)
$actual = [Convert]::ToDecimal(($new_actual * 0.001) / $Divisor * (1 - ($_.fees / 100)))

$Stat = [Pool_Stat]::New($StatName, $current, [Convert]::ToDecimal($Hashrate), $actual, $false)

if (-not $H_Table.$($_.Name)) {
$H_Table.Add("$($_.Name)", @{ })
}
elseif (-not $H_Table.$($_.Name).$P_Name) {
$H_Table.$($_.Name).Add("$P_Name", @{
Hashrate = "$Hashrate"
Percent = ""
})
}

$Level = $Stat.$($Params.Stat_Algo)

if ($Params.Historical_Bias) {
$SmallestValue = 1E-20
$Level = [Math]::Max($Level + ($Level * $Stat.Deviation), $SmallestValue)
$Values = $Params.Historical_Bias.Split("`:")
$Max_Penalty = $Values | Select -First 1
$Max_Bonus = $Values | Select -Last 1

## Penalize
if ($Stat.Historical_Bias -lt 0) {
$Deviation = [Math]::Max($Stat.Historical_Bias, ($Max_Penalty * -0.01))
}
## Bonus
else {
$Deviation = [Math]::Min($Stat.Historical_Bias, ($Max_Bonus * 0.01))
}
$Level = [Math]::Max($Level + ($Level * $Deviation), $SmallestValue)
}

$Pass1 = $global:Wallets.Wallet1.Keys
$User1 = $global:Wallets.Wallet1.$($(arg).Passwordcurrency1).address
$Pass2 = $global:Wallets.Wallet2.Keys
$User2 = $global:Wallets.Wallet2.$($(arg).Passwordcurrency2).address
$Pass3 = $global:Wallets.Wallet3.Keys
$User3 = $global:Wallets.Wallet3.$($(arg).Passwordcurrency3).address
$Pass1 = $Wallets.Wallet1.Keys
$User1 = $Wallets.Wallet1.$($Params.Passwordcurrency1).address
$Pass2 = $Wallets.Wallet2.Keys
$User2 = $Wallets.Wallet2.$($Params.Passwordcurrency2).address
$Pass3 = $Wallets.Wallet3.Keys
$User3 = $Wallets.Wallet3.$($Params.Passwordcurrency3).address

[Pool]::New(
## Symbol
"$($_.Name)-Algo",
Expand All @@ -87,13 +123,21 @@ if ($Name -in $(arg).PoolName) {
## User3
$User3,
## Pass1
"c=$Pass1,id=$($(arg).RigName1)",
"c=$Pass1,id=$($Params.RigName1)",
## Pass2
"c=$Pass2,id=$($(arg).RigName2)",
"c=$Pass2,id=$($Params.RigName2)",
## Pass3
"c=$Pass3,id=$($(arg).RigName3)",
"c=$Pass3,id=$($Params.RigName3)",
## Previous
$previous
$actual
)
}
} -ThrottleLimit $(arg).Throttle

$Global:Config.vars.DivisorTable = $DivisorTable
$Global:Config.vars.FeeTable = $FeeTable
$Global:Config.vars.Pool_HashRates = $Hashrate_Table
[GC]::Collect()
[GC]::WaitForPendingFinalizers()
[GC]::Collect()
$Pool_Data
}
138 changes: 90 additions & 48 deletions algopools/blazepool.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$Name = Get-Item $MyInvocation.MyCommand.Path | Select-Object -ExpandProperty BaseName
$Pool_Request = [PSCustomObject]@{ }

$X = ""
if ($(arg).xnsub -eq "Yes") { $X = "#xnsub" }

if ($Name -in $(arg).PoolName) {
Expand All @@ -12,61 +13,94 @@ if ($Name -in $(arg).PoolName) {
return
}

$PoolAlgos = @()
$PoolAlgos += $(vars).Algorithm
$PoolAlgos += $(arg).ASIC_ALGO
$Algos = $PoolAlgos | ForEach-Object { if ($Bad_pools.$_ -notcontains $Name) { $_ } }

$Algos = @()
$Algos += $(vars).Algorithm
$Algos += $(arg).ASIC_ALGO

## Only get algos we need & convert name to universal schema
$Pool_Sorted = $Pool_Request.PSobject.Properties.Value | Where-Object { [Convert]::ToDouble($_.estimate_current) -gt 0 } | ForEach-Object {
$Pool_Algos = $global:Config.Pool_Algos;
$Ban_Hammer = $global:Config.vars.BanHammer;
$Pool_Sorted = $Pool_Request.PSobject.Properties.Value | ForEach-Object -Parallel {
$Pipe_Algos = $using:Pool_Algos;
$Pipe_Hammer = $using:Ban_Hammer;
$Algo_List = $using:Algos;
$Pipe_Name = $using:Name;
$N = $_.Name;
$_ | Add-Member "Original_Algo" $N
$_.Name = $global:Config.Pool_Algos.PSObject.Properties.Name | Where { $N -in $global:Config.Pool_Algos.$_.alt_names };
if ($_.Name) { if ($_.Name -in $Algos -and $Name -notin $global:Config.Pool_Algos.$($_.Name).exclusions -and $_.Name -notin $(vars).BanHammer) { $_ } }
}
$_ | Add-Member "Original_Algo" $N;
$_.Name = $Pipe_Algos.PSObject.Properties.Name | Where { $N -in $Pipe_Algos.$_.alt_names };
if ($_.Name) { if ($_.Name -in $Algo_List -and $Pipe_Name -notin $Pipe_Algos.$($_.Name).exclusions -and $_.Name -notin $Pipe_Hammer) { return $_ } }
} -ThrottleLimit $(arg).Throttle

$Pool_Sorted | ForEach-Object {
## These are modified, then returned back to the original
## value below. This is so that threading can be done.
$DivisorTable = $Global:Config.vars.DivisorTable
$FeeTable = $Global:Config.vars.FeeTable
$Hashrate_Table = $Global:Config.vars.Pool_HashRates
$Get_Params = $Global:Config.params
$Get_Wallets = $Wallets

$Day_Estimate = [Convert]::ToDouble($_.estimate_last24h);
$Day_Return = [Convert]::ToDouble($_.actual_last24h);
if ($Day_Estimate -gt 0 -and $Day_Return -gt 0) {
$Raw = shuffle $Day_Estimate $Day_Return
}
## If either value is 0, deviation is 100% (either coin was not mined, or had no value)
else {
$Raw = -1
}
$_ | Add-Member "deviation" $Raw

$Pool_Data = $Pool_Sorted | ForEach-Object -Parallel {
. .\build\powershell\global\classes.ps1
$D_Table = $using:DivisorTable
$F_Table = $using:FeeTable
$H_Table = $using:Hashrate_Table
$P_Name = $using:Name
$sub = $using:X
$Params = $using:Get_Params
$Wallets = $using:Get_Wallets
$StatAlgo = $_.Name -replace "`_", "`-"
$StatPath = "$($Name)_$($StatAlgo)_profit"
if (-not (test-Path ".\stats\$StatPath") ) { $Estimate = [Convert]::ToDouble($_.estimate_last24h) }
else { $Estimate = [Convert]::ToDouble($_.estimate_current) }

$Pool_Port = $_.port
$Pool_Host = "$($_.Original_Algo).mine.blazepool.com$X"
$Divisor = 1000000 * $_.mbtc_mh_factor
$Pool_Port = $_.port
$Pool_Host = "$($_.Original_Algo).mine.blazepool.com${sub}"
$StatName = "$($P_Name)_$($StatAlgo)"
$Get_Path = [IO.File]::Exists(".\stats\pool_$($StatName)_pricing.json")
$Hashrate = $_.hashrate
if ([Convert]::ToDouble($HashRate) -eq 0) { $Hashrate = 1 } ## Set to prevent volume dividebyzero error
$previous = [Math]::Max(([Convert]::ToDouble($_.actual_last24h) * 0.001) / $Divisor * (1 - ($_.fees / 100)), $SmallestValue)
$Estimate = $_.estimate_last24h
if ($Get_Path) { $Estimate = $_.estimate_current }

$Deviation = $_.Deviation
$Stat = Global:Set-Stat -Name $StatPath -HashRate $HashRate -Value ( $Estimate / $Divisor * (1 - ($_.fees / 100))) -Shuffle $Deviation
if (-not $(vars).Pool_Hashrates.$($_.Name)) { $(vars).Pool_Hashrates.Add("$($_.Name)", @{ }) }
if (-not $(vars).Pool_Hashrates.$($_.Name).$Name) { $(vars).Pool_Hashrates.$($_.Name).Add("$Name", @{HashRate = "$($Stat.HashRate)"; Percent = "" }) }

$Level = $Stat.$($(arg).Stat_Algo)
if ($(arg).Historical_Bias -gt 0) {
$new_estimate = [Convert]::ToDecimal($Estimate)
$current = [Convert]::ToDecimal($new_estimate / $Divisor * (1 - ($_.fees / 100)))
$new_actual = [Convert]::ToDecimal($_.actual_last24h)
$actual = [Convert]::ToDecimal(($new_actual * 0.001) / $Divisor * (1 - ($_.fees / 100)))

$Stat = [Pool_Stat]::New($StatName, $current, [Convert]::ToDecimal($Hashrate), $actual, $false)

if(-not $H_Table.$($_.Name)) {
$H_Table.Add("$($_.Name)",@{})
}
elseif (-not $H_Table.$($_.Name).$P_Name) {
$H_Table.$($_.Name).Add("$P_Name", @{
Hashrate = "$Hashrate"
Percent = ""
})
}

$Level = $Stat.$($Params.Stat_Algo)

if ($Params.Historical_Bias) {
$SmallestValue = 1E-20
$Level = [Math]::Max($Level + ($Level * $Stat.Deviation), $SmallestValue)
$Values = $Params.Historical_Bias.Split("`:")
$Max_Penalty = $Values | Select -First 1
$Max_Bonus = $Values | Select -Last 1

## Penalize
if ($Stat.Historical_Bias -lt 0) {
$Deviation = [Math]::Max($Stat.Historical_Bias, ($Max_Penalty * -0.01))
}
## Bonus
else {
$Deviation = [Math]::Min($Stat.Historical_Bias, ($Max_Bonus * 0.01))
}
$Level = [Math]::Max($Level + ($Level * $Deviation), $SmallestValue)
}

$Pass1 = $global:Wallets.Wallet1.Keys
$User1 = $global:Wallets.Wallet1.$($(arg).Passwordcurrency1).address
$Pass2 = $global:Wallets.Wallet2.Keys
$User2 = $global:Wallets.Wallet2.$($(arg).Passwordcurrency2).address
$Pass3 = $global:Wallets.Wallet3.Keys
$User3 = $global:Wallets.Wallet3.$($(arg).Passwordcurrency3).address
$Pass1 = $Wallets.Wallet1.Keys
$User1 = $Wallets.Wallet1.$($Params.Passwordcurrency1).address
$Pass2 = $Wallets.Wallet2.Keys
$User2 = $Wallets.Wallet2.$($Params.Passwordcurrency2).address
$Pass3 = $Wallets.Wallet3.Keys
$User3 = $Wallets.Wallet3.$($Params.Passwordcurrency3).address

[Pool]::New(
## Symbol
Expand All @@ -88,13 +122,21 @@ if ($Name -in $(arg).PoolName) {
## User3
$User3,
## Pass1
"c=$Pass1,id=$($(arg).RigName1)",
"c=$Pass1,id=$($Params.RigName1)",
## Pass2
"c=$Pass2,id=$($(arg).RigName2)",
"c=$Pass2,id=$($Params.RigName2)",
## Pass3
"c=$Pass3,id=$($(arg).RigName3)",
"c=$Pass3,id=$($Params.RigName3)",
## Previous
$previous
$actual
)
}
} -ThrottleLimit $(arg).Throttle

$Global:Config.vars.DivisorTable = $DivisorTable
$Global:Config.vars.FeeTable = $FeeTable
$Global:Config.vars.Pool_HashRates = $Hashrate_Table
[GC]::Collect()
[GC]::WaitForPendingFinalizers()
[GC]::Collect()
$Pool_Data
}
Loading