def sell_token(symbol, amount, price, account):
he_market = Market(blockchain_instance=hive)
market_trans = he_market.sell(account, amount, symbol, price)
c = Comment(loaded_post, steem_instance=hive)
c.reply(str(market_trans), "market_tx", account)
##sell_token("LEO", 70.3, 1.999, "archon-gov")
time.sleep(30)
sell_token("SIM", 1250, 0.00495, "archon-gov")
time.sleep(30)
sell_token("GAMER", 204353, 0.000128, "archon-gov")
!end
First, it defines a function, within that function, it loads the Hive-Engine market, and posts a sell order based on the inputted variables. The details of that sell order are then placed in the local variable "market_trans", and finally the governance account is called to reply to this post with the details of the transaction.
Under the function, we can then call it, and set the variables needed for each call. For the first one we are calling a sell function, we set the symbol to "LEO", set 70.3 as the amount to sell, 1.99 HIVE was set as the price, and lastly we provided the "archon-gov" account as the source of the sales.
Between each call, we added a 30-second sleep, to account for transaction and reply limits.
We could have made a more complicated function to example what we are working on, but for the first go I figured it would be best to keep it simple.
Well, I haven't gotten that far yet. ATM it's using a wide open python 3, hopefully before New Years, we can call it a full launch, with definitions, and many layers of safety nets.
I also need to setup read access to the Archon governance DB, allowing these functions to call on the DB for user info like Governance Power.
In summary, vote "Yes" to move forward with code snippet testing, and use this code snippet to sell off some of our unused tokens for SWAP.HIVE. We can decide what to do with that SWAP.HIVE later.