{"id":36258,"date":"2022-02-08T17:40:00","date_gmt":"2022-02-08T14:40:00","guid":{"rendered":"https:\/\/orbitsoft.com\/blog\/?p=36258"},"modified":"2024-03-06T14:49:33","modified_gmt":"2024-03-06T11:49:33","slug":"cryptocurrency-exchange-trading-bot","status":"publish","type":"post","link":"https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/","title":{"rendered":"How OrbitSoft automated cryptocurrency exchange trading with a bot"},"content":{"rendered":"<div class=\"wp-block-lazyblock-case lazyblock-case-CsCLX\"><div class=\"styled-block\">\n  <div class=\"styled-block__main\">\n        <ul class=\"case__list\">\n            \n                    <li class=\"case__item\">\n              \n          <span class=\"case__order\">01<\/span>\n          <div class=\"case__body\">\n            <div class=\"case__title\">\n              <span>Type of technology<\/span>\n            <\/div>\n            <p>Algorithm to automate work at an exchange<\/p>          <\/div>\n        <\/li>\n            \n                    <li class=\"case__item\">\n              \n          <span class=\"case__order\">02<\/span>\n          <div class=\"case__body\">\n            <div class=\"case__title\">\n              <span>Tasks it solves<\/span>\n            <\/div>\n            <p>Analyzes different currencies and exchanges<\/p>\n<p>Finds profitable differences in exchange rates<\/p>\n<p>Buy and sell cryptocurrencies<\/p>\n<p>Reports transactions in a convenient format, for example via Telegram chatbot<\/p>\n<p>Resolves problems in case of failures<\/p>\n<p>Reliably predicts currency price based on analytics<\/p>\n<p>Ensures data privacy and stability<\/p>          <\/div>\n        <\/li>\n            \n                    <li class=\"case__item\">\n              \n          <span class=\"case__order\">03<\/span>\n          <div class=\"case__body\">\n            <div class=\"case__title\">\n              <span>Companies it\u2019s intended for<\/span>\n            <\/div>\n            <p>Traders on cryptocurrency and currency exchanges<\/p>          <\/div>\n        <\/li>\n          <\/ul>\n  <\/div>\n  <\/div><\/div>\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-ZGPO81\"><h2 class=\"article__h\">Traders profit on exchanges from exchange rate difference <\/h2><\/div>\n\n\n<p>Traders are active participants on exchanges. They monitor exchange rates, and conduct buy and sell transactions to make a profit.<\/p>\n\n\n\n<p>Cryptocurrency exchanges work on a similar principle, only with bitcoin, Ethereum, and other digital currencies.<\/p>\n\n\n\n<p>Profit from transactions depends on a trader&#8217;s ability to analyze the market situation and on their quick reaction time. The more effective the transactions, the higher the player&#8217;s profit.<\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-1ozihw\"><h2 class=\"article__h\">Objective: to create an algorithm for trading on cryptocurrency exchanges <\/h2><\/div>\n\n\n<p>In 2017, an American company approached OrbitSoft to develop a bot for cryptocurrency transactions. The task was to automate the buying and selling of cryptocurrencies on an exchange for profit.<\/p>\n\n\n\n<p>They needed an algorithm that works like a trader: it would analyze cryptocurrency rates and make deals. The greater the difference (spread) between the buy and sell price, the higher the profit.<\/p>\n\n\n\n<p>To maximize customer revenue, the algorithm had to be able to:<\/p>\n\n\n\n<ul>\n<li>Constantly monitor the market to buy currency at a favorable price<\/li>\n\n\n\n<li>Submit orders to buy and sell<\/li>\n\n\n\n<li>Transfer money to different exchanges where the desired cryptocurrency is traded<\/li>\n\n\n\n<li>Collect analytics on transactions, and forecast price changes<\/li>\n\n\n\n<li>Send reports to the customer regarding transactions<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-xnLNF\"><h2 class=\"article__h\">Solution: development of an algorithm for transactions, data analysis, and reporting <\/h2><\/div>\n\n\n<p>OrbitSoft provided the customer with a complete solution that automatically buys and sells cryptocurrencies on different exchanges using an API. The system consists of 3 modules:<\/p>\n\n\n\n<p><strong>Data collection and analysis<\/strong><\/p>\n\n\n\n<p>Constantly collects data via API: rates of cryptocurrencies, transactions during the period, and last transactions. After analyzing the data, the program offers a solution according to the trader&#8217;s strategy.<\/p>\n\n\n\n<p><strong>Interaction with stock exchanges<\/strong><\/p>\n\n\n\n<p>Creates and cancels exchange orders, opens and closes positions on deals, updates deal status.<\/p>\n\n\n\n<p><strong>Statistics on transactions<\/strong><\/p>\n\n\n\n<p>Processes transaction data, calculates efficiency, and keeps detailed records.<\/p>\n\n\n\n<p>Let&#8217;s talk more about how the algorithm works and what it can do.<\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-ZaBVn\"><h2 class=\"article__h\">The system uses a strategy of arbitrage and triangulation <\/h2><\/div>\n\n\n<p><strong>Exchange arbitrage<\/strong> &#8211; consecutive trades that generate income from price differences on different exchanges.<\/p>\n\n\n\n<p>For example, the bot selects a bitcoin\/dollar (BTC\/USD) pair on exchanges A and B. It tracks when there is a difference in bitcoin prices on the two exchanges and makes successive steps: it buys on exchange A and sells on exchange B.<\/p>\n\n\n\n<p><strong>Triangulation strategy<\/strong> uses the divergence of three cryptocurrencies and identifies currency pairs with the highest profits. The algorithm simultaneously places three orders on the selected pairs: two to buy and one to sell. Profits appear due to the difference in rates.<\/p>\n\n\n\n<p>All transactions can take place within the framework of one exchange, or on several exchanges at once.<\/p>\n\n\n\n<p>For example, the bot buys the cryptocurrency DASH for U.S. dollars, then the cryptocurrency EMC for DASH and sells EMC for U.S. dollars.<\/p>\n\n\n\n<p><strong>USD \u2192 DASH \u2192 EMC \u2192 USD<\/strong><\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-2wKBn7\"><h2 class=\"article__h\">Compares not only exchange rates, but also exchange commissions for transactions <\/h2><\/div>\n\n\n<p>The exchange commission must be deducted from the profit on the trades. It can range from 1 to 15% of the profit. The bot takes into account the amount of these commissions when calculating the efficiency of a transaction.<\/p>\n\n\n<div class=\"wp-block-lazyblock-banner lazyblock-banner-L8veB\"><div \n  class=\"banner\n   \n  \" \n  >\n    <div class=\"banner__body\">\n        <h2 class=\"banner__h\">We\u00a0develop and implement:<\/h2>\n        <div class=\"banner__content\">\n            <ul>\n<li aria-level=\"1\">Solutions to\u00a0optimize work with Big Data: large databases, advertising platforms<\/li>\n<li aria-level=\"1\">Information systems using Artificial Intelligence and Machine Learning<\/li>\n<li aria-level=\"1\">Blockchain services, systems and applications, implementation of\u00a0smart contracts<\/li>\n<li aria-level=\"1\">Secure data exchange systems<\/li>\n<\/ul>        <\/div>\n                            <div \n              class=\"banner__button button js-form-modal\n               button_style_light-on-promo2\">\n              Get a free consultation                          <\/div>\n            <\/div>\n    <div class=\"banner__photo\">\n        <img decoding=\"async\" src=\"\" alt=\"\" class=\"banner__img\">\n    <\/div>\n<\/div><\/div>\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-ZTHDIM\"><h2 class=\"article__h\">Receives data and calculates spreads within and between exchanges <\/h2><\/div>\n\n\n<p>On a regular basis, the bot requests tables of orders from exchanges for specified pairs and then performs analysis. The results are stored in the database and are available for display on a chart.<\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-ZjdhUl\"><h2 class=\"article__h\">Receives data and calculates spreads within and between exchanges <\/h2><\/div>\n\n\n<p>On a regular basis, the bot requests tables of orders from exchanges for specified pairs and then performs analysis. The results are stored in the database and are available for display on a chart.<\/p>\n\n\n\n<p>The algorithm determines the likely time intervals in which the spread between exchanges will be at the required level. It finds the most profitable spread value for purchases, and when the maximum spread values are reached, it signals the system to place a buy or sell order.<\/p>\n\n\n\n<p>At the moment the following exchanges are integrated:<\/p>\n\n\n\n<ul>\n<li>kraken.com<\/li>\n\n\n\n<li>bittrex.com<\/li>\n\n\n\n<li>bitfinex.com<\/li>\n\n\n\n<li>binance.com<\/li>\n\n\n\n<li>poloniex.com<\/li>\n\n\n\n<li>hitbtc.com<\/li>\n\n\n\n<li>livecoin.net<\/li>\n\n\n\n<li>dsx.uk<\/li>\n\n\n\n<li>bitstamp.net<\/li>\n\n\n\n<li>gatecoin.com<\/li>\n\n\n\n<li>bitmex.com<\/li>\n\n\n\n<li>xbtce.com<\/li>\n\n\n\n<li>cryptopia.co.nz<\/li>\n<\/ul>\n\n\n\n<p>We did integration with all currency pairs represented on the exchanges.<\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-aLHx0\"><h2 class=\"article__h\">Predicts the likely price and analyzes available volumes of currency <\/h2><\/div>\n\n\n<p>To perform an arbitrage strategy, a trader determines the market prices for a given volume of cryptocurrency. The algorithm predicts the price based on order analysis. It takes into account hidden orders, and stop-loss and take-profit orders. It analyzes buy and sell offers in the order book, and the available volume of currency.<\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-Z6OVW4\"><h2 class=\"article__h\">Can simultaneously place, cancel, and check the status of orders on an exchange <\/h2><\/div>\n\n\n<p>The bot works with the following types of orders: market, limit, fill, or kill. The a priori order of the market type is used. If it is not found or not supported, the bot applies fill or kill or limit.<\/p>\n\n\n\n<p>Work with orders is carried out for the following exchanges:<\/p>\n\n\n\n<ul>\n<li>kraken.com<\/li>\n\n\n\n<li>bittrex.com<\/li>\n\n\n\n<li>poloniex.com<\/li>\n\n\n\n<li>hitbtc.com<\/li>\n\n\n\n<li>livecoin.net<\/li>\n\n\n\n<li>dsx.uk<\/li>\n\n\n\n<li>xbtce.com<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-1CGfNJ\"><h2 class=\"article__h\">Solves problems with cancellation, or failure to place an order <\/h2><\/div>\n\n\n<p>The following problems may arise during the bidding and execution process:<\/p>\n\n\n\n<p>\u2014 Price change after sending an order<\/p>\n\n\n\n<p>\u2014 Transaction cancellation<\/p>\n\n\n\n<p>\u2014 Incomplete bidding or incomplete transaction<\/p>\n\n\n\n<p>OrbitSoft ran a series of tests on the algorithm in case, for example, an order is placed on one exchange, and not placed, canceled, or reset on a second exchange.<\/p>\n\n\n\n<p>As a result, we have taken possible problems into account, and developed a protective mechanism that allows you to successfully place an order within the existing spread.<\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-1Mthkr\"><h2 class=\"article__h\">Presents analysis and reporting in a convenient, clear form <\/h2><\/div>\n\n\n<p>The bot shows spreads and order bases in the form of a clear graph.<\/p>\n\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-Z1Ck1B5\"><figure class=\"article__figure  article__figure_no-shadow\">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-02-08-\u0432-10.03.22.png\" alt=\"\">\n    <\/div>\n                <figcaption>The chart can show the spreads on exchanges, and between exchanges, as well as order books with analytics for the period, sorted by transaction volume<\/figcaption>\n    <\/figure><\/div>\n\n\n<p>A Telegram bot was developed to transmit data to the customer. It receives all delivery, cancellation, and execution notifications and sends them via Telegram.<\/p>\n\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-Z1Qd2Lr\"><figure class=\"article__figure  article__figure_no-shadow\">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-02-08-\u0432-10.06.32.png\" alt=\"\">\n    <\/div>\n        <\/figure><\/div>\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-Za2t6e\"><figure class=\"article__figure  article__figure_no-shadow\">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2022-02-08-\u0432-10.06.33.png\" alt=\"\">\n    <\/div>\n                <figcaption>Examples of reports on progress and execution of orders on an exchange<\/figcaption>\n    <\/figure><\/div>\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-Z1BSXDN\"><h2 class=\"article__h\">Conditions and restrictions of the algorithm <\/h2><\/div>\n\n\n<p>The proposed solution is effective under the following conditions:<\/p>\n\n\n\n<p>1) Sufficient spread and trade volumes.  <\/p>\n\n\n\n<p>For arbitrage between exchanges:<\/p>\n\n\n\n<ul>\n<li>Volume of the spread between exchanges as a percentage exceeds the total commission on transactions<\/li>\n\n\n\n<li>Convergence and divergence of spreads within an acceptable time frame<\/li>\n\n\n\n<li>Necessary volume of trading on exchanges to conduct transactions and execute orders at specified intervals of time<\/li>\n<\/ul>\n\n\n\n<p>To triangulate within a single exchange:<\/p>\n\n\n\n<ul>\n<li>Exchange rate difference between currency pairs exceeds the commission for transactions with orders on the exchange<\/li>\n\n\n\n<li>Required number of currency pairs on the exchange<\/li>\n\n\n\n<li>Necessary volume of trades on exchanges for carrying out operations of execution of orders in the given intervals of time<\/li>\n<\/ul>\n\n\n\n<p>2) Strong cryptocurrency market volatility for effective trading<\/p>\n\n\n\n<p>3) Ability to work with the exchange API to send requests and receive data<\/p>\n\n\n\n<p>4) The ability to work with exchanges on sockets to keep unbreakable connectivity and data exchange<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Traders are active participants on exchanges. They monitor exchange rates, and conduct buy and sell transactions to make a profit. Cryptocurrency exchanges work on a similar principle, only with bitcoin, Ethereum, and other digital currencies. Profit from transactions depends on a trader&#8217;s ability to analyze the market situation and on their quick reaction time. The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":36262,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[196],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How OrbitSoft automated cryptocurrency exchange trading with a bot - OrbitSoft Blog<\/title>\n<meta name=\"description\" content=\"The bot analyzes and predicts cryptocurrency exchange rates, finds profitable differences, buys and sells, and reports transactions\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How OrbitSoft automated cryptocurrency exchange trading with a bot - OrbitSoft Blog\" \/>\n<meta name=\"twitter:description\" content=\"The bot analyzes and predicts cryptocurrency exchange rates, finds profitable differences, buys and sells, and reports transactions\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/bc-\u043a\u0432\u0430\u0434\u0440\u0430\u0442.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@orbitsoft\" \/>\n<meta name=\"twitter:site\" content=\"@orbitsoft\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How OrbitSoft automated cryptocurrency exchange trading with a bot - OrbitSoft Blog","description":"The bot analyzes and predicts cryptocurrency exchange rates, finds profitable differences, buys and sells, and reports transactions","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/","twitter_card":"summary_large_image","twitter_title":"How OrbitSoft automated cryptocurrency exchange trading with a bot - OrbitSoft Blog","twitter_description":"The bot analyzes and predicts cryptocurrency exchange rates, finds profitable differences, buys and sells, and reports transactions","twitter_image":"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/bc-\u043a\u0432\u0430\u0434\u0440\u0430\u0442.jpg","twitter_creator":"@orbitsoft","twitter_site":"@orbitsoft","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/","url":"https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/","name":"How OrbitSoft automated cryptocurrency exchange trading with a bot - OrbitSoft Blog","isPartOf":{"@id":"https:\/\/orbitsoft.com\/blog\/#website"},"datePublished":"2022-02-08T14:40:00+00:00","dateModified":"2024-03-06T11:49:33+00:00","author":{"@id":"https:\/\/orbitsoft.com\/blog\/#\/schema\/person\/e515b3fa91e283750477594c4f028b7b"},"description":"The bot analyzes and predicts cryptocurrency exchange rates, finds profitable differences, buys and sells, and reports transactions","breadcrumb":{"@id":"https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/orbitsoft.com\/blog\/cryptocurrency-exchange-trading-bot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/orbitsoft.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How OrbitSoft automated cryptocurrency exchange trading with a bot"}]},{"@type":"WebSite","@id":"https:\/\/orbitsoft.com\/blog\/#website","url":"https:\/\/orbitsoft.com\/blog\/","name":"OrbitSoft Blog","description":"Discover the latest in news and resources for OrbitSoft","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/orbitsoft.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/orbitsoft.com\/blog\/#\/schema\/person\/e515b3fa91e283750477594c4f028b7b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/orbitsoft.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b1b269c579caf059f82b6d114c63fc49?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b1b269c579caf059f82b6d114c63fc49?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/orbitsoft.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts\/36258"}],"collection":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=36258"}],"version-history":[{"count":6,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts\/36258\/revisions"}],"predecessor-version":[{"id":36948,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts\/36258\/revisions\/36948"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/media\/36262"}],"wp:attachment":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=36258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=36258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=36258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}