And So It Begins: Steem-Engine Trading Bot Incoming

in #steemengine5 years ago

steam power engine train.jpg

So, I was about to get really annoyed because I looked at the custom json used to create market orders on Steem-Engine and copied them. It didn't work, so I was thinking I was going to have to ask for help and figure out SteemConnect, and all other manner of annoyances.

steemengine-bot-error.png

Nope

Turns out I just made a mistake. I'm stripping down my @drugwars bot to make this one. Drugwars required your posting key while SteemEngine requires the active key.

steemengine-steemconnect.png

steemengine-bot-buy.png

This is all the code needed to start placing limit orders on Steem-Engine.
How easy is that.
Good ol' Steem making everything easy peasy.

The only variables that need to change are:

  • contractAction (buy/sell)
  • symbol (PAL/ENG/ETC)
  • quantity
  • price

Man, this sure is going to be easy.


This bot will be open source so anyone can create liquidity on the Steem-Engine markets.

steemengine-eng-liquidity.png

Take ENG coin for example. With my bot, you could fill those liquidity gaps with your orders, and get alerted when someone else undercuts you (if you like). You could set up auto-undercutting so you don't have to worry about it and stuff like that.

If there are enough people trading who don't want to wait for coins (most people) then you can make a little money by providing liquidity to the market. For example, if users are buying your ENG coins for 0.64 and you're buying coins at 0.58 that's just free money for you.

Liquidity bots provide a service to users (instant gratification for 'takers') and in return you extract a 'maker' fee for providing the liquidity. Seeing as Steem-Engine has no trading fees, this makes it theoretically extremely easy so make a few coins by providing desperately needed liquid limit orders.

Hopefully this little project gets me back into the swing of programming.
It's been too long.

Sort:  

Wow! I didn’t realize it was so easy to create a liquidity bot.

Posted using Partiko iOS

One of the issues with market making is directional moves. In equity markets the makers handle this with derivatives to keep their overall exposure market neutral.

In steem-engine, we don't have that option.

So if I want to make a market in BTCP, I have issues both in tracking the change in price and in the change in demand.

We've seen the past few days how much the market price itself can move. But then if the maker gets a sustained demand in one direction, the cash balances on one side of the trade dwindle. For example, if people keep selling STEEMP to buy BTCP, then STEEMP balances go up and the BTCP balances go down. Eventually, the maker needs to unwind that position and sell the BTCP.

The most basic way to handle this is to widen the spread as directionality increases. I was talking about this with aggy the other day. He mentioned increasing the spread with each trade in one direction. But that doesn't go far enough. The spread needs to adjust dynamically based on direction and size. So if tradeA is to buy 0.002 BTCP for 50 STEEMP, that has a much different impact on the liquidity of the market compared to tradeB to buy 1 BTCP for 30000 STEEMP.

My first thought of how to handle this is to widen based on the percentage impact on the remaining cash balance. So if the maker has 100 BTCP, the 1 BTCP order reduces the cash balance by 1% and the normal spread is 2% then the spread widens by 1% to 3%. And then the reverse is true for bringing the maker back into neutral.

But that still doesn't solve the issue of a sustained trend. If people just end up selling STEEMP for BTCP, then the maker needs to rectify that periodically. And that means sending STEEMP to an outside exchange, selling for BTC, and depositing it back into steem-engine as BTCP. Along the way, there are steem-engine fees, exchange fees, network fees, and slippage on the trading price. A lot of exchanges will refund fees to market makers as payment for providing liquidity, so maybe you could get those waived, but those other fees remain. That might be a 1% cost on the total amount needed to be exchanged. And that needs to be incorporated into the spread on steem-engine.

I'm following your project with interest. Hopefully, some of these ideas will be useful to you.

I can't wait to try it out. It will be awesome for traders lover on steem engine

@swayzilla here’s some good coding info for you on Steem! He posts these occasionally but I like them, food for thought.

Posted using Partiko iOS

I like how simple and straight to the point this is. It would be cool to play around with else if statements on this to buy other coins based on lower rates.
I'm at a basic level with JavaScript and so I'm always trying to learn more. In this script, since I'm a little unfamiliar with JSON, what are you printing out to the console? Is the result class grabbing the block_num from the client? What is the block_num and what would this print out?

Looks like I have to learn JSON now lol.

Great stuff, I could learn a lot from you from following your blog.

Thanks @cmplxty for sending me over. This guy definitely deserves a follow.

Posted using Partiko Android

console-question.png

The console is just logging a copy of the data I sent to the blockchain.
Just so I can make sure it's correct and whatnot.

Oh!! Makes sense! Thank you for the clarification!

Awesome! Looking forward to this :]

Is there a drugwars/steemmonsters/nextcolony bot? Open source? 😈😱😱😱😱😱 shit I do those things manually all the time.

Posted using Partiko Android

A bit over my head and out of my element but I'm challenging myself to keep up and grow with steem..

My issue is on a mobile steem engine just makes me wanna run away so I don't get a headache...

Posted using Partiko Android

Volume growth will be crucial for the growth of SEG. (Steem Engine)

Posted using Partiko Android

Sounds great and looking 👀 forward to putting it to work!

Posted using Partiko iOS

Coin Marketplace

STEEM 0.21
TRX 0.20
JST 0.033
BTC 92484.28
ETH 3110.06
USDT 1.00
SBD 3.04