Skip to content

NikolaPantel/mmr_bid

Repository files navigation

MiningRigRentals Auto-Rent Script

Automatically rent mining rigs from MiningRigRentals.com based on your criteria using their API v2.

Features

  • ✅ Full MRR API v2 authentication (HMAC-SHA1 signing)
  • ✅ Search for rigs by algorithm, hashrate, price, RPI score
  • ✅ Automatically rent the best matching rigs
  • ✅ Support for all currencies (BTC, LTC, ETH, DOGE, BCH)
  • ✅ Dry-run mode for testing
  • ✅ Multi-rig rental support
  • ✅ Pool profile management

Requirements

  • Python 3.6+
  • requests library

Installation

  1. Install dependencies:
pip install -r requirements.txt
  1. Get your API credentials:

Configuration

Edit mrr_auto_rent.py and update the configuration section:

# API credentials
API_KEY = "your_api_key_here"
API_SECRET = "your_api_secret_here"

# Rental configuration
RENTAL_CONFIG = {
    'algo': 'scrypt',           # Algorithm: scrypt, sha256, x11, etc.
    'min_hashrate': 100,        # Minimum hashrate (in hash_type units)
    'max_price': 0.00001,       # Maximum price per unit per day
    'duration_hours': 3,         # Rental duration in hours
    'profile_id': profile_id,   # Pool profile ID (auto-detected)
    'min_rpi': 80,              # Minimum RPI score (0-100)
    'hash_type': 'mh',          # Hash units: hash, kh, mh, gh, th, ph, eh
    'price_type': 'mh',         # Price units (same as hash_type)
    'currency': 'BTC',          # BTC, LTC, ETH, DOGE, or BCH
    'max_rigs': 1,              # Maximum number of rigs to rent
    'dry_run': True             # Set False to actually rent
}

Usage

Basic Usage

Run the script with default configuration:

python mrr_auto_rent.py

Testing (Dry Run)

The script defaults to dry-run mode (dry_run: True), which will:

  • Search for matching rigs
  • Show what would be rented
  • NOT actually create rentals or spend funds

Live Rentals

To actually rent rigs, set dry_run: False in the configuration.

Custom Usage

You can also use the classes programmatically:

from mrr_auto_rent import MRRClient, AutoRenter

# Initialize
client = MRRClient("your_api_key", "your_api_secret")
auto_renter = AutoRenter(client)

# Search for rigs
rigs = auto_renter.find_best_rigs(
    algo='scrypt',
    min_hashrate=100,
    max_price=0.00001,
    min_rpi=80,
    hash_type='mh',
    price_type='mh',
    count=10
)

# Rent rigs
rentals = auto_renter.auto_rent(
    algo='scrypt',
    min_hashrate=100,
    max_price=0.00001,
    duration_hours=3,
    profile_id=12345,
    currency='BTC',
    max_rigs=1,
    dry_run=False  # Set to True for testing
)

API Methods

The MRRClient class provides access to all MRR API endpoints:

Account & Info

  • whoami() - Test connectivity and get account info
  • get_account_balance() - Get account balances
  • get_algos(currency) - Get available algorithms
  • get_pool_profiles(algo) - Get pool profiles

Rig Search & Details

  • search_rigs(algo, **filters) - Search for available rigs
  • get_rig_details(rig_ids) - Get detailed rig information

Rentals

  • rent_rig(rig_id, length_hours, profile_id, ...) - Rent a rig
  • get_rentals(rental_type, history, ...) - Get rental history

Low-level Methods

  • get(endpoint, params) - GET request
  • post(endpoint, data) - POST request
  • put(endpoint, data) - PUT request
  • delete(endpoint, data) - DELETE request

Search Filters

Available filters for search_rigs():

  • currency - Filter by currency (BTC, LTC, ETH, DOGE, BCH)
  • minhours_min/max - Filter minimum rental hours
  • maxhours_min/max - Filter maximum rental hours
  • rpi_min/max - Filter RPI score (0-100)
  • hash_min/max/type - Filter hashrate
  • price_min/max/type - Filter price
  • count - Number of results (max 100)
  • offset - Pagination offset
  • orderby - Sort field (price, hashrate, rpi, etc.)
  • orderdir - Sort direction (asc/desc)
  • rented - Show rented rigs (true/false)
  • offline - Show offline rigs (true/false)
  • region - Filter by region

Pool Profiles

Before renting, you need at least one pool profile configured:

  1. Go to https://www.miningrigrentals.com/account/pools
  2. Create a pool profile with your mining pool details
  3. The script will auto-detect your first profile, or specify profile_id

Algorithms

Common algorithms available:

  • scrypt - Litecoin, Dogecoin
  • sha256 - Bitcoin
  • x11 - Dash
  • equihash - Zcash
  • ethash - Ethereum Classic
  • randomx - Monero
  • And many more...

Get the full list with:

client.get_algos()

Example Output

Connected as: 123456789
Permissions: {'withdraw': 'yes', 'rent': 'yes', 'rigs': 'yes'}

Account balances:
  BTC: 0.00500000
  LTC: 0.00000000
  ETH: 0.00000000

Using pool profile ID: 40073

============================================================
AUTO-RENT CONFIGURATION
============================================================
algo                : scrypt
min_hashrate        : 100
max_price           : 0.00001
duration_hours      : 3
profile_id          : 40073
min_rpi             : 80
hash_type           : mh
price_type          : mh
currency            : BTC
max_rigs            : 1
dry_run             : True
============================================================

Searching for scrypt rigs...
  Min hashrate: 100 mh
  Max price: 0.00001 mh/day
  Min RPI: 80
Found 5 matching rigs

[DRY RUN] Renting rig 1/1:
  ID: 41784
  Name: Antminer L3+ 540MH/s
  Hashrate: 540.00M
  Price: 0.00000587 BTC/mh/day
  Duration: 3 hours
  [DRY RUN - Skipping actual rental]

============================================================
SUMMARY: DRY RUN - Rented 1 rig(s)
============================================================

Safety Features

  • Dry-run mode by default - Test before spending
  • Price filtering - Never pay more than your max price
  • RPI filtering - Only rent from reliable providers
  • Balance checking - Verify funds before renting

Troubleshooting

Authentication Errors

  • Verify your API key and secret are correct
  • Check API permissions include "rent" and "rigs"
  • Ensure nonce is working (system time is correct)

No Rigs Found

  • Adjust search criteria (lower min_hashrate, increase max_price)
  • Check if rigs are available for your algorithm
  • Try different RPI thresholds

Rental Failed

  • Verify sufficient balance in the specified currency
  • Check if rig is still available (may have been rented)
  • Ensure pool profile is configured correctly

API Rate Limits

Be mindful of API rate limits:

  • Don't make excessive requests
  • Use reasonable polling intervals
  • Cache results when possible

Security

⚠️ Keep your API credentials secure:

  • Never commit API keys to version control
  • Use environment variables for production
  • Set minimal required permissions
  • Rotate keys periodically

License

This script is provided as-is for educational purposes. Use at your own risk.

Support

Disclaimer

This is an unofficial script. The author is not affiliated with MiningRigRentals.com. Always test with small amounts first and verify rentals are working as expected.

About

mingingrigrentals.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages