06

Aug

How to create a cryptocurrency trading bot for Binance

Published April 08, 2020 07:04 PM EST
Updated May 12, 2020 11:05 PM EST
How to create a cryptocurrency trading bot for Binance

In this article, I will divulge all the information on how to create a cryptocurrency trading bot that earns USDT on a daily basis, 365 days per year. Winterwind has created a simple trading bot that arbitrages the Bitcoin-USDT order books on Binance and Exchange B (contact Anthony for exchange name). This code is proprietary to our company however just email Anthony if you have an interest in purchasing it. Winterwind can also help you develop your own custom trading bot with its own custom rules if you so desire that. Our trading bot has been running for the last three years and is earning an average of 96% ROI per year, after trading fees and withdrawal fees. We initially put $20,000 into it has turned into about $151K at the time of this writing. It has incurred over $100K in trading fees and over $20K in withdrawal fees in that time but as you can see it is still a respectable return.

The Strategy


          The secret to its workings is maintaining balances of both BTC and USDT in both exchanges. The reason you need to maintain balances of both (and not just USDT) is because withdrawing BTC (or any crypto) from Binance to exchange B, or the inverse, is simply far too slow. This takes minutes at best and that is just too slow. The difference in price between top, reputable exchanges is usually no more than 2-3%. (Exchange B is a major exchange)

The Strategy

          You can however execute instant arbitrage if you maintain both BTC and USDT balances in both exchanges prior to every trade. The arbitrage strategy here is to churn out USDT profit, with a 100 or more trades per day. The amount of trades will depend on the amount of times the bot script's conditions are met and the price divergence between the two different exchanges. Obviously we cannot control when these conditions are met, but the script will execute on them when they are met.

Order Book Example Snapshot

The BTC price is set around $1000 in this example.

action1.png Action 1: (API request to Exchange B)

Sell 1 BTC using limit order at $1,019. The limit is a bit lower than the top bid because we want to liquidate the entire 1 BTC. It will probably all fill at $1,020 but just in case those bids dry up we sell the rest at $1,019.XX. The 1 BTC has now been cashed out.


action2.png Action 2: (API request to Binance. Fires immediately when the BTC sell is filled on Exchange B)

Because we have lost 1 BTC on Exchange B, we must get it replenished immediately on the other exchange. The lowest ask on Binance is $1,000 so we will submit a limit buy order of $1,001 to ensure it gets filled. After this is filled, we have now gotten back our 1 BTC we sold on Exchange B.


Fees but we still earn

          We have a pre-commission profit of around $20 in this example. The profit margin is around 2% here. Subtract then the trading fee of 0.1% on both exchanges so a real profit of $18.

          Withdrawals need to happen after the transaction to balance out the two accounts. Withdrawal fees are relatively low though and won't affect profitability too much. We're seeing withdrawal fees between 65 cents and $3 for USDT depending on which version of USDT it is (USDT is on several different blockchains). The larger the withdrawal amount, the lower the overall percentage is.

          So now we have a trading engine that can maintain the BTC balance between the two exchanges and churn out a USDT profit every day. The amount of profit will depend on how many times the price diverges in a day, and we further need to have balances in both USDT and BTC in both exchanges to be able to execute this strategy. So you can see that while a withdrawal is being processed, the trading engine won't run. Withdrawals however usually complete within a few minutes so the bot still has hundreds of opportunities to execute in a day.

Dealing with Bitcoin price fluctuation

Dealing with Bitcoin price fluctuation

          This strategy requires holding a certain amount of BTC in both accounts at all times. If you are nervous about holding BTC there, what I would suggest is that you let Winterwind add a switch to your bot so you can control when the bot runs and when it doesn't. In this way, you can simply not run the bot when you feel BTC is overpriced. However, when you think BTC is undervalued and will go up over the next few weeks, or few months, you can turn it on then. Then when you feel the BTC price is too high, you can then sell all your BTC to Tether (and likely for a big profit). When you think the BTC price is low again, you can use your Tether to purchase the BTC you need for your trading engine to run again. Then simply turn it back on and continue earning USDT.

          This trading engine combines a combination of churning out USDT profit as well as doing some speculation on BTC. If you would like to purchase the trading bot described here, or develop your own custom trading bot, please get in touch with Anthony using the email below.

         Of note, Winterwind offers blockchain development services. Examples are wallet development, automated withdrawals, securing hot wallets and more.

Talk to us about your project today!

Get in touch by sending an email to anthony@winterwind.com

YOU MAY ALSO LIKE

A Recap of Tron's Development Update for this Year's Quarter
A Recap of Tron's Development Update for this Year's Quarter
May 13, 2020 by Haizel Lien

Most in the crypto news today is bombarded with Bitcoin halving and the sudden crash of the Bitcoin price. The halving event is mu...

Read more...
Vitalik Buterin believes that the nation needs Ethereum
Vitalik Buterin believes that the nation needs Ethereum
May 09, 2020 by Haizel Lien

The pandemic issue Coronavirus, which is also known as COVID-19, occurred last February 2020 and caused a global health crisis. Wi...

Read more...

Talk to us about your project today

Fill out the form below and receive a reply within 24 hours.