Skip to main content

HashGuard

DIY Python auto-optimizer for the Braiins Hashpower marketplace. Monitors the order book, detects stalled bids, and automatically adjusts pricing to maintain hashrate flow while minimizing overpayment.

Features

FeatureDescription
Stall detectionIf hashrate drops to 0 TH/s, automatically overbids the lowest matching ask by 1 tick (1,000 sats) to restore flow
Trim-downIf delivering but overbidding by >4%, trims back to optimal price to save sats
Auto-topupPre-places a new bid when any active order drops below 20% remaining balance
Profitability ceilingNever bids above hash value + 10% (calculated from live difficulty)
Signal alertsSends a notification on every action (stall boost, trim, topup)
State loggingTracks actions and daily price lows for trend analysis
Secrets managementAPI keys stored in Bitwarden, decrypted only at runtime

Architecture

  • Runs as a daemon or cron job on a local machine
  • Queries Braiins Hashpower API for order book depth and active order status
  • Compares delivered hashrate against bid price vs market ask
  • Executes bid adjustments via authenticated API calls
  • Logs all state transitions to local file for audit

Relationship to Other Entities

References

  • Meetup demo script ^[raw/mining-like-the-big-players-2026-05-14.md]
  • Presentation outline ^[presentations/mining-like-the-big-players-2026-05-14.md]