Saturday, 31 October 2015

OKCoin.cn under DDoS Attack, Use WeChat for alternative order management if webserver for futures market gets disrupted

OKCoin.cn has been under attack during this bitcoin price bull-run. As the weekend rolls around and we know volatility can get heavy, the possibility of an attack on OKCoin.com servers which would disrupt the Futures market seems ever higher. Luckily, you can access the trading engine directly using OKCoin's WeChat account.

The guys at OKCoin have recently taken the effort to translate and explain in English how their WeChat order system works. However, I feel like it is lacking a bit in walking through how to execute the orders, so this is for those who are still struggling to get going with OKCoin WeChat order execution.

Background

This system was put into place because OKCoin has had problems with DDoS attacks in the past, which has left their webservers unable to process orders, either through RESTAPI/WebSocket, or the website, leaving users stranded in positions they cant get out of, or missing opportunities they would have gotten into.

WeChat is China's biggest messaging service. Their servers' capacity massive, and the resources it would take to attack WeChat for the purpose of disturbing OKCoin are prohibitive in magnitude, making disruption of this unlikely. So OKCoin set up an order execution system for their Futures Exchange using WeChat to link to their trading engine. This allows users to smoothly execute orders even if okcoin.com webservers are totally smashed, as long as their trading engine is still intact and communicating with WeChat.

Enable WeChat Trading in OKCoin Account Security

The OKCoin blog link above does a decent job of explaining how to ENABLE WeChat trading. However, the execution explanation is lacking and has typos which make it unreliable.

Install WeChat on your mobile phone

WeChat is a mobile app connected to your mobile number, which is connected to your OKCoin account. So when the OKCoin WeChat receives messages from you in a particular format, it will know your WeChat id is connected to your account and process them as order requests as long as you have enabled WeChat Trading under “Security” in the account.

Start trading through WeChat

Once you have added the user “okcoin” in your WeChat app (which, by the way, can be accessed through the web on your computer if you dont feel like typing into your phone), you're ready to execute orders. It may be intimidating that the OKCoin account in WeChat is in Chinese, but don't worry, all code is in English underneath, so the execution is using English as well.

The commands are sent just as if you were sending a normal message to someone on WeChat, except you'll be sending it to OKCoin and in a particular format so it knows you're issuing commands.

The indicative format is as such (dont use this format, its only descriptive):

<Bitcoin/Litecoin>,<Weekly/Biweekly/Quarterly>,<Open/Close>,<Long/Short>,<Price>,<Number Contracts>,<Leverage Amount>(Optional, only if Fixed Margin) 

In parametric form -- remember the order of the command is very important, and this is how you will be sending the commands:

<B/L>,<W/N/Q>,<O/C>,<L/S>,<Order Price>,<Integer>,<10x/20x>(only if in fixed margin) 

When you send, it will be without the <>'s brackets. The different options for each parameter are separated by the slashes, and the commas separate the arguments and must be included in the command

EXAMPLES

Let's look at a couple of examples so you can get the idea:

Say I'm in fixed margin and I want to go long 1 contract of Bitcoin futures at 20x with a price of 275 on the BiWeekly contracts, then all you have to do is send a message to the OKCoin WeChat account with:

B,N,O,L,275,1,20x 

And you will get executed and see a message similar to this.

Try a small example for yourself as a test, just 1 contract, while your web client is open so you can see just how fast the order executes.

Now let's look at an example of closing the position. Very simple, just click the keyboard, in the message with okcoin, enter the format for execution, and send the message to complete, just like in this image:

B,N,C,L,300,1,20x 

So the B indicates Bitcoin, the N indicates Biweekly Futures, C is for close, L is for long, 300 is the price, 1 is the contract, and 20x is the leverage you used to open the contract in first place.

One final example now, let's mix it up and say you're using Cross Margin and trading Litecoin futures instead, on Quarterlies, and you want to open a short at 3.5 for 100 contracts, then just send:

L,Q,O,S,3.5,100 

L = Litecoin, Q = Quarterly, O = open, S = short, 3.5 = price, 100 = # contracts.

Note since it's cross-margin it is not necessary to include 10x or 20x.

And after sending you you will be executed on the trade.

Additional commands

In addition to the order execution commands, you can also check Price by just sending “P” to OKCoin. You can also cancel all your orders by sending “C”.

Concluding remarks

The responses to your commands will be in Chinese. But you can actually translate them on the fly within WeChat. Also, you will get used to what responses are errors and which are success. So as long as you have the account balance to cover it and you dont make a typo, it will execute correctly.

You will likely only use WeChat execution in times of stress (i.e., you can't execute in Web UI or over API and use WeChat as last resort). Thus I highly recommend you practice using this system so that when the time comes you are not scrambling to figure out the format. It's simple enough that it just takes a half hour or so of your time to get acquainted with, and could save you lots of money in the future.

I hope this clarifies what is confusing for some people who could not quite get into doing it just based on OKCoin's blog post. Feel free to leave questions or if anything needs clarifying or if something I have written here is wrong.

Thanks to /u/BTCVIX for suggesting I put this into words and post it.

If you found this useful and feel like tipping, send here: 3JESQuguHF983aLRRLzFtfNPPn3ZK4fMBd

This guide is copyright of author and may not be reposted or reused by anyone without express permission.



Submitted October 31, 2015 at 02:10PM by theswapman http://bit.ly/1OeIgfq

No comments :

Post a Comment