Pimp/PeakeCoin Trailing Bot
I was brainstorming something ferocious and trying to figure out how to help the platforms.... I came up with this and attempting to link the currencies on Hive Engine that actually have solid backing. This is just the first draft of the PeakeCoin trailing bot. I may add other currencies to it as well, I'm just not sure how resource credit-heavy this would actually be. With this being the rough draft we'll see.
Since I created @PeakeCoin, I have never made it staking, so you can earn more. I have always had the issue of some rough distribution to facilitate usage. So, what I started working on was a PeakeCoin following bot. So it's one that follows @pimp.token earnings and gives them a super small percentage of PEK.

I've been trying to get @enginewitty up to speed with all this coding stuff I'm working on, and hopefully this may expedite him to hop on this train, lol.
I worked on this on Sunday evening. I'm sorry, but I was working on the Sabbath.
If you want, you can definitely read over this, implement it, or improve it, just let me know because any help can be the greatest of help.
import requests
import time
import os
from nectar import Hive
hive = Hive()
def send_pek(username, amount):
# Replace these with your Hive account and private active key
HIVE_ACCOUNT = "your_hive_account"
ACTIVE_KEY = "your_private_active_key" # NEVER share or hardcode in public code!
# Prepare the custom_json payload for Hive Engine token transfer
json_data = [
"transfer",
{
"symbol": "PEK",
"to": username,
"quantity": f"{amount:.8f}",
"memo": "PIMP reward"
}
]
try:
tx = hive.broadcast_custom_json(
username=HIVE_ACCOUNT,
key=ACTIVE_KEY,
id="ssc-mainnet-hive",
json_data=json_data,
required_posting_auths=[],
required_active_auths=[HIVE_ACCOUNT]
)
print(f"Sent {amount} PEK to {username}. TX: {tx}")
except Exception as e:
print(f"Failed to send PEK to {username}: {e}")
REWARDED_TXIDS_FILE = "rewarded_txids.txt"
def load_rewarded_txids():
if not os.path.exists(REWARDED_TXIDS_FILE):
return set()
with open(REWARDED_TXIDS_FILE, "r") as f:
return set(line.strip() for line in f if line.strip())
def save_rewarded_txid(txid):
with open(REWARDED_TXIDS_FILE, "a") as f:
f.write(txid + "\n")
def main():
rewarded_txids = load_rewarded_txids()
while True:
try:
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "find",
"params": {
"contract": "tokens",
"table": "transfers",
"query": {"symbol": "PIMP"},
"limit": 100,
"sort": "desc"
}
}
r = requests.post("https://api.hive-engine.com/rpc/contracts", json=payload, timeout=10)
data = r.json()
for t in data.get("result", []):
txid = t.get("transactionId")
to_user = t.get("to")
pimp_amt = float(t.get("quantity", 0))
# Integer division: every 100 PIMP, reward 0.00000001 PEK
pek_amt = int(pimp_amt // 100) * 0.00000001
if pek_amt > 0 and txid not in rewarded_txids:
send_pek(to_user, pek_amt)
rewarded_txids.add(txid)
save_rewarded_txid(txid)
except Exception as e:
print(f"Error: {e}")
time.sleep(60) # Run every minute
if __name__ == "__main__":
main()
Appreciate all the looking around... big shout out to @ecoinstant for the helping hands of putting people together to improve the community.
Woop Woop! School is winding down and I can put more focus on Hive things here soon. If you can make it, should come to the !pimp chats Wednesday morning 9am EST.
I'm full time employed. Unless someone here can pay my salary? I'd be glad to quit working. I would love to join the conversation.
No rush my guy. I get it. I just need money....lol, kids are expensive.
Test !PAKX