PeakeCoin Bots - Resource Credit Logic

in Synergy Builders β€’ 22 hours ago (edited)

πŸš€ PeakeCoin Trading Bots Just Got Smarter with RC Awareness!

Update: December 19, 2025


πŸ”§ What's New?

All PeakeCoin trading bots β€” including uni_bnb.py, uni_matic.py, uni_steem.py, and others β€” now feature Resource Credits (RC) monitoring logic, making them network-aware and self-regulating.

πŸ‘ No more wasting RC on failed transactions
πŸ‘ Adaptive delay based on your Hive account’s current RC %
πŸ‘ Self-throttling behavior when RC is too low
πŸ‘ Automatic RC recovery tracking


πŸ’‘ What are Resource Credits (RC)?

Sorry if you know... but some don't so....
Hive is a RC-based blockchain. Every transaction consumes RC instead of gas fees.
If your RC runs out, transactions fail silently, or worse β€” bots crash or loop uselessly.

This can affect:

  • Custom JSON contract calls (placing/canceling orders)
  • Node interactions
  • Hive-Engine API calls

By integrating RC logic, your bots will now proactively check RC before placing any order.


🧠 New Logic Added

βœ… Step 1: RC Fetch Function

We added this function:

def get_resource_credits(account_name):
    url = "https://api.hive.blog"
    payload = {
        "jsonrpc": "2.0",
        "method": "rc_api.find_rc_accounts",
        "params": {"accounts": [account_name]},
        "id": 1
    }
    resp = requests.post(url, json=payload)
    if resp.status_code == 200:
        rc = resp.json()['result']['rc_accounts'][0]
        current = int(rc['rc_manabar']['current_mana'])
        max_rc = int(rc['max_rc'])
        return round(current / max_rc * 100, 2)
    return None

This safely fetches your account’s RC percent and returns it with 2 decimal precision.


βœ… Step 2: RC Logic Embedded in smart_trade()

In each bot:

rc_percent = get_resource_credits(account_name)
if rc_percent is not None:
    if rc_percent < 10.0:
        LOW_RC_CONSECUTIVE_COUNT += 1
        DYNAMIC_DELAY = BASE_DELAY + (LOW_RC_CONSECUTIVE_COUNT * 300)
        print(f"⚠️ RC too low ({rc_percent}%). Skipping trade.")
        return
    else:
        # If RC recovered, reset delay
        LOW_RC_CONSECUTIVE_COUNT = 0
        DYNAMIC_DELAY = BASE_DELAY

The bot skips all trading actions when RC < 10% and extends the wait time to let RC regenerate. This ensures it doesn’t burn out the wallet or get rate-limited by Hive nodes.


πŸ“Š Example Output from Bot

[MATIC BOT] Resource Credits: 8.74%
[MATIC BOT] WARNING: Resource Credits too low (8.74%). Skipping trade cycle.
[MATIC BOT] Low RC count: 2. Next delay: 2100s (35.0 min)

♻️ Adaptive Timing: DYNAMIC_DELAY

Instead of fixed DELAY = 1500 seconds:

  • If RC is low: Delay increases to 1800, 2100, 2400+ seconds, depending on how long the RC stays low.
  • If RC recovers: Delay resets to 1500 seconds (25 minutes)

πŸ”„ How Often Does It Check?

The RC is checked at the start of each smart trading cycle. If it's low, that entire cycle is skipped to conserve your wallet.


If you're running multiple bots from the same wallet, RC becomes your bottleneck.
This new logic guarantees:

  • Less Hive Engine errors
  • Less transaction spam
  • More consistent, long-term uptime
  • Faster troubleshooting (clear warnings)

πŸ§ͺ Want to Try It?

Contact me, and I can get you bots. I can also host them for you, minimal fee.


πŸ“£ Goals

This feature is part of a larger push toward self-healing, autonomous PeakeCoin bots that:

  • Trade multiple tokens
  • Refill their own gas
  • Avoid rate-limits
  • And eventually support multi-chain operations

πŸͺ™ PeakeCoin Ecosystem

πŸ’± PeakeCoin USDT Bridge (Hive ↔ Polygon/MATIC)
Bridge SWAP.USDT from Hive Engine to USDT on Polygon (MATIC).
Whitelist access, documentation, and bridge status updates:
πŸ‘‰ https://geocities.ws/peakecoin


βš™οΈ HiveP.I.M.P. β€” PeakeCoin Intelligent Market Protector
Operated by @hivepimp, P.I.M.P. stabilizes PEK markets and supports liquidity on Hive Engine.
Community liquidity participation strengthens long-term market health.
πŸ“ˆ Open-source code, bots, and documentation:
πŸ‘‰ https://github.com/paulmoon410


🎰 PeakeSino β€” The PeakeCoin Casino
Blockchain-powered games using PEK as the native in-game currency.
Built on Hive with a focus on provable fairness and community-driven growth.
πŸƒ Casino code, UI, and game logic:
πŸ‘‰ https://github.com/paulmoon410


πŸ™ Acknowledgements

Thanks to and please follow
@enginewitty @ecoinstant @neoxian @txracer @thecrazygm @holdonia @aggroed
for their continued support, guidance, and help expanding the PeakeCoin ecosystem.