Metadata-Version: 2.1
Name: bitaxe-solar-arbitrage
Version: 1.0.0
Summary: Mathematical core engine for Bitaxe micro-mining profitability and solar energy arbitrage
Home-page: https://polarblocklabs.com
Author: Dominik Lederer
Author-email: dominik.lederer@googlemail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# Bitaxe Solar Arbitrage Engine

The official mathematical core engine by Polarblocks for calculating Bitaxe micro-mining profitability and solar energy arbitrage.

Developed and maintained by Dominik Lederer (<dominik.lederer@googlemail.com>) from [Polarblocks](https://polarblocklabs.com).

---

## Technical Specifications & Calibration Baseline

This engine is calibrated specifically for the custom performance settings of **Polarblocks Bitaxe Gamma** miners:

* **ASIC Chip**: BM1370
* **Core Voltage sweet spot**: `1.21V` - `1.22V`
* **Stable Core Frequency**: `600 MHz` - `625 MHz`
* **Thermal Range limit**: `< 65°C`
* **Typical performance output**: `~1,3 TH/s`
* **Default Preset Power Consumption**: `~19W` (scalable from 17W to 25W depending on active frequency settings)

---

## Core Formulas

### 1. Solo Mining Block Hashing Probability
Estimates the likelihood of a miner finding a valid block solo over a given time duration.
$$\lambda = \frac{\text{Miner Hashrate (H/s)}}{\text{Network Hashrate (H/s)}} \times \frac{\text{Duration (seconds)}}{600}$$
$$P(\text{Block}) = 1 - e^{-\lambda}$$

### 2. Solar Arbitrage Boundary
Determines dynamic switching rules based on electricity rates and current solar yields.
* **Opportunity Cost of Hashing (Solar Surplus)**: $Cost_{solar} = P_{miner} \times \text{Feed-in Tariff}$
* **Direct Cost of Hashing (Grid Buy)**: $Cost_{grid} = P_{miner} \times \text{Electricity Buy Rate}$

### 3. Coproduct Heat Value Offset
Calculates equivalent room-heating savings generated by using the Bitaxe ASIC heat dissipation to offset primary HVAC system costs:
$$\text{Heat Offset (EUR/hour)} = \left(\frac{P_{miner}}{1000}\right) \times \left(\frac{\text{Electricity Price}}{\text{COP}}\right)$$

---

## Installation

Install the package via pip:

```bash
pip install bitaxe_solar_arbitrage
```

## Quick Start Example

```python
from bitaxe_solar_arbitrage.calculator import calculate_solar_arbitrage, calculate_solo_block_probability

# 1. Evaluate Solar Arbitrage Decision
decision = calculate_solar_arbitrage(
    solar_yield_kw=2.5,
    feed_in_tariff_kwh=0.08,        # EUR/kWh
    electricity_price_kwh=0.28,      # EUR/kWh
    miner_power_w=19.0,              # Default Polarblocks preset
    miner_hashrate_ths=1.3           # Default Bitaxe Gamma output
)
print("Solar Arbitrage Decision:", decision)

# 2. Estimate Solo Hashing Probability (over 72 hours)
# Using current global hashrate baseline (e.g. 600 EH/s)
prob = calculate_solo_block_probability(
    miner_hashrate_ths=1.3,
    network_hashrate_ehs=600.0,
    hours=72.0
)
print(f"Solo Block Probability: {prob:.8%}")
```

For more documentation and complete solo miner guides, visit [Polarblocks Ultimative Home Miner Guide](https://polarblocklabs.com/pages/der-ultimative-home-miner-guide).


