Coder Social home page Coder Social logo

amandris / arbitrage-trading-bot Goto Github PK

View Code? Open in Web Editor NEW
42.0 11.0 34.0 14.63 MB

Bot to automate trading orders between Bitcoin exchanges to make some profit.

License: MIT License

PHP 18.27% HTML 16.41% JavaScript 27.68% Makefile 0.02% Shell 0.06% CSS 37.44% Ruby 0.08% PowerShell 0.04%
bitcoin arbitrage symfony trading-bot bot php cryptocurrency

arbitrage-trading-bot's Introduction

Arbitrage Bitcoin Trading Bot

Using the tiny diferences in bitcoin value among several exchanges, this bot places buy and sell orders so some profit is made.

Example:

Once you are running the web interface, you spot a 352.48$ difference between sell price in QuadrigaCX and buy price in Bitstamp.

Exchange Sell Exchange Buy Ask Bid Difference
QuadrigaCX Bitstamp 3648.52 4001.00 352.48
  1. Deposit 3648.52$ in Bitstamp.
  2. Deposit 1 BTC in QuadrigaCX.
  3. In the Order value (BTC) field set the desired order value (between 0.001BTC and 1 BTC)
  4. Press ▶️ button on the QuadrigaCX-Bitstamp difference (where the 352.48$ difference in value is shown) several times until you spent all your BTC balance on QuadrigaCX. You can also start the automate trading.
  5. You now have 4001$ in QuadrigaCX and 1 BTC in Bitstamp.
  6. Withdraw balances on both exchanges. The profit before fees is 352.48$.
  7. Repeat.

Web interface

Supported exchanges

  • Bitstamp
  • OkCoin
  • Kraken
  • ItBit
  • QuadrigaCX
  • Cexio
  • Bittrex
  • Binance

Prerequisites

  • PHP 7.1
  • Composer
  • Some RDBS (Mysql, Postgres, Sqlite, ...)
  • Node.js (Known issues with versions higher than 10. Try with 10 or lower)
  • Gulp

Installation

  • git clone https://github.com/amandris/arbitrage-trading-bot.git

  • cd arbitrage-trading-bot

  • composer install

  • Set the database parameters in app/config/parameters.yml file

  • Create database with php bin/console doctrine:database:create

  • Create schema with bin/console doctrine:schema:update --force

  • npm install

  • gulp

  • Set the api keys of the exchanges you want to use in app/config/parameters.yml. At least two exchange api keys should be setted.

  • Enable or disable exchanges on app/config/config.yml file

  • bin/console server:run localhost:8000

  • bin/console bot:trade on a new console

  • Open http://localhost:8000 on your browser

Donations

Bitcoin: 35JBxSyefxmVj34obKC2od3r98MuaJ34am

Bitcoin Cash: 3NrTmv4f1752D9vtYTMh8EaqtHQE1ZXdbR

Litecoin: MM1p5NRCPqa5EUaU5PNjDqy1FXHQmxsiUF

Disclaimer

This software project has only educational purposes. Arbitrage trading is a complex and dangerous game. Use this tool at your own risk.

arbitrage-trading-bot's People

Contributors

amandris avatar z13gcarb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arbitrage-trading-bot's Issues

error when execute php bin/console doctrine:database:create

PHP Warning: require(/home/pi/arbitrage-trading-bot/bin/../vendor/autoload.php): Failed to open stream: No such file or directory in /home/pi/arbitrage-trading-bot/bin/console on line 15
PHP Fatal error: Uncaught Error: Failed opening required '/home/pi/arbitrage-trading-bot/bin/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/pi/arbitrage-trading-bot/bin/console:15
Stack trace:
#0 {main}
thrown in /home/pi/arbitrage-trading-bot/bin/console on line 15

Cannot use object of type stdClass as array" In ItbitService.php line 148:

Hi Amandris,

I was successful in getting the "bin/console bot:trade" command to work, and while the "Ticker" now populates in the app, I'm receiving the following error once the command is inserted into the command line. Do you have any recommendations on how to resolve?

"app@XXXXXX:~/directory/app$ bin/console bot:trade
05/02/2019 07:29:59
bitstamp Ask:3,418.07 Bid:3,418.06
okcoin Ask:3,416.03 Bid:3,417.72
binance Ask:3,465.98 Bid:3,465.95

In ItbitService.php line 148:

Cannot use object of type stdClass as array"

Thank you in advance for your help on this!

Originally posted by @NH603 in #1 (comment)

The balances are not loading.

I am using the Bitstamp and Kraken APIs, with the correct keys, but the balance is not loading. Just get reset.

Follows the images of the program running on my local server.

print1

print2

print3

Short/Long order

Hello,
Do you plan to add short/long orders ?
You can benefit from that and there will be no need
to move money between exchanges.

Invalid datetime format

Might be related to #4

`test1@test1-VirtualBox:~/arbitrage-trading-bot$ bin/console bot:trade
30/04/2019 02:59:24
bitstamp Ask:5,148.31 Bid:5,148.30
cexio Ask:5,264.50 Bid:5,257.70
30/04/2019 02:59:30
bitstamp Ask:5,148.31 Bid:5,148.30
cexio Ask:5,264.90 Bid:5,257.60
30/04/2019 02:59:36
bitstamp Ask:5,148.31 Bid:5,148.30
cexio Ask:5,264.90 Bid:5,259.50

In AbstractMySQLDriver.php line 106:

An exception occurred while executing 'INSERT INTO order_pair (buy_order_id, sell_order_id, buy_order_exchange, sell_order
exchange, sell_order_open, buy_order_open, buy_order_amount_btc, sell_order_amount_btc, buy_order_amount_usd, sell_order
amount_usd, buy_order_price, sell_order_price, buy_order_created, sell_order_created) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?
, ?, ?, ?, ?)' with params ["3202411249", "8756065699", "bitstamp", "cexio", 1, 1, 0.003, 0.003, 15.453930000000001, 15.76
95, 5151.31, 5256.5, "2019-04-30 00:59:35", "51296-03-30 10:16:50"]:

SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '51296-03-30 10:16:50' for column 'sell_order_cre
ated' at row 1

In PDOStatement.php line 119:

SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '51296-03-30 10:16:50' for column 'sell_order_cre
ated' at row 1
`

Error reading css and js files

When running bin/console server: run localhost: 8000 I am experiencing these errors

[OK] Server listening on http://localhost:8000

 // Quit the server with CONTROL-C.

[Fri Oct 25 01:14:51 2019] ::1:53931 [200]: /
[Fri Oct 25 01:14:53 2019] ::1:53936 [404]: /build/css/dashboard.min.css
[Fri Oct 25 01:14:54 2019] ::1:53932 [404]: /build/css/base.min.css
[Fri Oct 25 01:14:55 2019] ::1:53937 [404]: /build/js/base.min.js
[Fri Oct 25 01:14:56 2019] ::1:53938 [404]: /build/js/dashboard.min.js
[Fri Oct 25 01:14:56 2019] ::1:53939 [200]: /bundles/fosjsrouting/js/router.js
[Fri Oct 25 01:14:57 2019] ::1:53940 [200]: /js/routing?callback=fos.Router.setData
[Fri Oct 25 01:14:58 2019] ::1:53946 [404]: /build/js/base.min.js
[Fri Oct 25 01:14:59 2019] ::1:53948 [404]: /build/js/dashboard.min.js
[Fri Oct 25 01:15:00 2019] ::1:53950 [200]: /_wdt/d38eda

Build issue

Hello, there appears to be a build issue. Based on your knowledge of the code, would you be willing to create a docker-compose.yml/Dockerfile to help build on VM? If not, give me 24 hours to learn code and I’ll submit a PR for us. Thank you in advance for your willingness to help.

  • NH603

OKCOIN response Gone

Hello, when I enter the command "bin / console bot: trade" in the console, I get the following error message,

"Client error: `GET https://www.okcoin.com/api/v1/ticker.do?symbol=btc_usd`   
  resulted in a `410 Gone` response:                                           
  Gone   
"

, can you help me?

No key/secret/client_id

Hi
When i execute the comand bin/console bot:trade it result in No key/secret/client_id

In config i see bitstamp had client_id but i set enable: false on that. Why he wants load?

Bitstamp error

Anyone can help with this error:

In BitstampService.php line 147:

[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: Illegal string offset 'datetime'

This is the line in code:

    $timestamp = new \DateTime('now', new \DateTimeZone('Europe/Madrid'));

I am using php 7.3.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.