PHPackages                             openclerk/mining-pools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. openclerk/mining-pools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

openclerk/mining-pools
======================

Definitions and implementations of mining pools in Openclerk

0.1.0(8y ago)31458[1 PRs](https://github.com/openclerk/mining-pools/pulls)PHP

Since Sep 11Pushed 8y ago3 watchersCompare

[ Source](https://github.com/openclerk/mining-pools)[ Packagist](https://packagist.org/packages/openclerk/mining-pools)[ RSS](/packages/openclerk-mining-pools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

openclerk/mining-pools
======================

[](#openclerkmining-pools)

A library for accessing live balances and hashrate data for accounts on many different mining pools, used by [Openclerk](http://openclerk.org) and live on [CryptFolio](https://cryptfolio.com).

This extends on the abstract currency definitions provided by [openclerk/currencies](https://github.com/openclerk/currencies)and the abstract account definitions provided by [openclerk/accounts](https://github.com/openclerk/accounts).

Installing
----------

[](#installing)

Include `openclerk/mining-pools` as a requirement in your project `composer.json`, and run `composer update` to install it into your project:

```
{
  "require": {
    "openclerk/mining-pools": "dev-master"
  }
}
```

- [Mining pools supported](https://github.com/openclerk/mining-pools/tree/master/src)

Using
-----

[](#using)

First, define a way to load Currency instances from three-character codes, according to [openclerk/currencies](https://github.com/openclerk/currencies):

```
use \DiscoveredComponents\Currencies;
use \Openclerk\Currencies\Currency;
use \Openclerk\Currencies\CurrencyFactory;

class DiscoveredCurrencyFactory implements CurrencyFactory {

  /**
   * @return a {@link Currency} for the given currency code, or {@code null}
   *   if none could be found
   */
  public function loadCurrency($cur) {
    if (Currencies::hasKey($cur)) {
      return Currencies::getInstance($cur);
    }
    return null;
  }

}
```

Get the currencies supported by a mining pool:

```
use \Monolog\Logger;

$logger = new Logger("log");
$factory = new DiscoveredCurrencyFactory();

$instance = new Account\MiningPool\Slush();
print_r($instance->fetchSupportedCurrencies($factory, $logger));
// returns ['btc', 'nmc']
```

Get the current balances (confirmed, unconfirmed, estimated) and hashrates for a mining pool account:

```
use \Monolog\Logger;

$logger = new Logger("log");
$factory = new DiscoveredCurrencyFactory();

$instance = new Account\MiningPool\Slush();

$account = array(
  'api_token' => '270245-e26365e4ca8f97ddde8c76a23ec18758',
);

$balances = $instance->fetchBalances($account, $factory, $logger);
echo $balances['btc']['confirmed'];     // in BTC
echo $balances['btc']['unconfirmed'];
echo $balances['btc']['estimated'];
echo $balances['btc']['hashrate'];      // in MH/s
echo $balances['nmc']['confirmed'];     // in NMC
echo $balances['nmc']['unconfirmed'];
echo $balances['nmc']['estimated'];
echo $balances['nmc']['hashrate'];      // in MH/s
```

Tests
-----

[](#tests)

Each mining pool comes with a suite of tests to check each associated service.

```
composer install
vendor/bin/phpunit

```

To run the tests for a single mining pool:

```
vendor/bin/phpunit --bootstrap "vendor/autoload.php" test/SlushTest

```

To get debug output for the tests (such as CURL requests and decoded output), add the `--debug` switch to your `vendor/bin/phpunit` command.

Donate
------

[](#donate)

[Donations are appreciated](https://code.google.com/p/openclerk/wiki/Donating).

Contributing
------------

[](#contributing)

Pull requests that contribute new mining pools are welcome.

Make sure that you also provide an associated Test suite so that the mining pool is automatically testable.

TODO
----

[](#todo)

1. Generate README list of mining pools automatically
2. Link to live APIs on CryptFolio
3. CI build server and link to test results

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3171d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ebbec5ccc867054461adebb7c5b6312f8256f989ef96b124892e6e89724afdb?d=identicon)[soundasleep](/maintainers/soundasleep)

---

Top Contributors

[![soundasleep](https://avatars.githubusercontent.com/u/3889656?v=4)](https://github.com/soundasleep "soundasleep (56 commits)")

### Embed Badge

![Health badge](/badges/openclerk-mining-pools/health.svg)

```
[![Health](https://phpackages.com/badges/openclerk-mining-pools/health.svg)](https://phpackages.com/packages/openclerk-mining-pools)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
