4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Scripts for Steem Bot Delegators Part 1

You have probably heard there are plenty of bots on Steemit. most of them give you upvote in return for payment in ether STEEM or SBD. Most bots rent their Steem Power (SP) from service like @minnowbooster or they get SP from users who delegate power to them. in return these users get paid for renting their SP. I wrote about delegating SP to bot called @boomerang in previous article https://steemit.com/steemit/@jaka87/best-way-to-earn-steem-by-delegating-sp.
Due to Steem and SBD price increase gain is quite nice these days. For around 2400 SP i get about 20worthperday.Notbadrightfor2000worth per day. Not bad right for 2000 investment right.

programming.jpg
Now what you can do as SP delegator is make your life even easier and create some script to do some work for you. In this series of post I will explain how you can for example transfer all you gains from SBD to STEEM, how to transfer STEEM to SP and how to increase your delegation to bot automatically by using scripts.

It this post I will explain my script to transfer SBD that I get from @boomerang to STEEM. It written in python and require steem for python. If you don't have it you can install it by using command pip install -U steem.

import datetime
import time
import os
from steem import Steem
from steem.commit import Commit
from steem.account import Account
from steem.transactionbuilder import TransactionBuilder
from steembase import operations

from datetime import datetime, timedelta
cas = datetime.utcnow() + timedelta(hours=2)  #check what is the time and ads two hours for when to cancel market order if not executed
cas2=format(cas, '%Y-%m-%dT%H:%M:%S')

s = Steem(keys=["YOUR WIF"])
username = 'YOUR USERNAME'

account = Account(username,s)
balance = account.balances
my_steem= balance['available']['SBD']

if my_steem > 0:    #checks your balance, if there is dome SBD on you account if will be changed to STEEM
	order=s.get_order_book(limit=3)
	last= order['bids'][1]['real_price'] #second bid order from market

	get_steem=str( format(float(my_steem)/float(last)+0.001, '.3f')) #calculation for how much STEEM you should get for your SBD. +0.001 coul'd be changed

	print (last)

	limit_order_create = operations.LimitOrderCreate(
		owner=username,
		orderid=0,
		amount_to_sell=str(my_steem)+" SBD",
		min_to_receive=get_steem+" STEEM",
		fill_or_kill=False,
		expiration=cas2,
	)

	tb = TransactionBuilder() #transaction gets build and send
	tb.appendOps([limit_order_create,])
	tb.appendSigner(username, "active")
	tb.sign()
	resp = tb.broadcast()
	print ('order for: '+get_steem)

Then you can use cron job to execute this script every 2-3 hours and that's it.

18 upvotes $5.89

Replies (5)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: