GithubHelp home page GithubHelp logo

kelvinau / crypto-arbitrage Goto Github PK

View Code? Open in Web Editor NEW
693.0 87.0 191.0 4.96 MB

Automatic Cryptocurrency Trading Bot using Triangular or Exchange Arbitrages

License: MIT License

Python 100.00%
cryptocurrency arbitrage exchange bitcoin ethereum litecoin trading-bot cryptocurrency-arbitrage

crypto-arbitrage's Introduction

Crypto Arbitrage

Updated on Sep 16, 2023:

I have moved on to develop other trading bots besides arbitrage. The best bot, Realistic Trading Bot (RTB), achieved a +2056% return using an aggressive model, while using the conservative model yielded a +418% return. The bots were backtested with data from 2019 to 2022. I have created a subscription service that provides trading signals for popular pairs. I will continue to add support for new pairs when there are enough requests.

Currently the subscription service supports:

  • BTCUSD
  • ETHUSD
  • EURUSD
  • GBPJPY
  • XAUUSD

Link to RTB Trading Signal subscription: https://kelvinausoftware.com/rtb-trading-signal/

Link to RTB details and backtesting report: https://kelvinausoftware.com/realistic-trading-bot-rbt/

Link to FREE Introduction of Professional Trader Course: https://www.youtube.com/live/HmM4rWT49M8?si=146J_eTFFX6YnctI (Beginner-friendly and no experience required. Content enough to get you start trading.)

Link to full details of Professional Trader Course: https://kelvinausoftware.com/professional-trader-course/ (I will expain RTB algorithm in this course.)

+2056% backtest return on EURUSD in 2022 image


Introduction

This is an automatic trading bot using Triangular or Exchange Arbitrages. It reguarly checks and detects arbitrage opportunities, and place orders when a profit can be made. This works on any cryptocurrency pairs with minor configuration.
Started with $1000 in October 2017, there were some times that this made about $40/day for a few weeks with Triangular Arbitrage on Bittrex, but as the market is getting very unstable, the profit is hard to outrun the high price fluctuation.

Exchanges

Bittrex, Bitfinex, Bitstamp, Kraken, Gatecoin (Not maintained anymore due to its extremely low volume)

Setup

  1. Install Python 2 at here https://www.python.org/downloads/ if necessary. This bot will not work with Python 3.
  2. pip install grequests
  3. Rename or copy .key_sample files under keys to .key file, and add the APIs. E.g. Create a file bittrex.key. Make sure not to push any API keys or this .key file.
  4. Modify arbitrage_config.json for any other ticker pairs or exchanges

Usage

Triangular: python main.py -m triangular
Exchange: python main.py -m exchange
Mock mode is enabled by default, which does not place any order and just check and show any arbitrage opportunities. To turn off mock mode and run in production, add the argument -p.

Difficulties

  1. The trading fee is the largest obstacle. Most of the exchanges have a 0.25% fee. The profit will be larger if the fee can be lower.
  2. Sometimes not all the placed orders are executed, so there will be some manual work to rebalance. The bot should be able to deal with this situation, such as placing a market order, instead of just cancelling the open orders.

Further Improvement

  1. Implement exchange rebalancing
  2. Handle open orders strategically
  3. Refactoring

I will put this project on hold now as the price goes up and down so much. Hope this can help anyone with similar interests.

crypto-arbitrage's People

Contributors

kelvinau 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  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  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  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  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

crypto-arbitrage's Issues

SyntaxError: invalid syntax

C:\Users\Ariez\Desktop\crypto-arbitrage-master>python main.py -m triangular
File "main.py", line 25
print 'Mode {0} is not recognized'.format(args.mode)
^
SyntaxError: invalid syntax

What is wrong?

Ideas to improve arbitrage_config.json

Hey @kelvinau

First of all, great work on this project. I only started yesterday on it as I am trying to gain more knowledge on triangular arbitrage and found your repo. Did you base your triangular algorithm on anything else? Like, for example, I've been looking at the Bellman-Ford algorithm to find the cheapest path, but that doesn't seem to be a good candidate for triangular arb.

I am looking at the json file mention in the subject and can see that we are basically "stuck" with BTC/LTC/ETH. It would be a good idea to try to expand this file, maybe to be an array of possible routes, so we can potentially explore more opportunities.

For example, if we were to run Bittrex's: https://bittrex.com/api/v1.1/public/getmarkets we would get all markets available there and we could then have a massive list of potential markets we can work with.

Is this something you're looking at, maybe?

Thanks and regards
Felipe

Kraken get_ticker_lastPrice

Getting error while running Triangular method on Kraken
'ExchangeEngine' object has no attribute 'get_ticker_lastPrice'

binance support

Binance has faster bot , so must have some arbitrage between pairs. can you add binance exchange?

kraken problem

hello i has edit the main.py to arbitrage_config.kraken.json and i run main.py -m triangular -p on kraken it doesnt open one trade , just show me [none]...and my kraken got 0.005 xbt what wrong on it ? hope you can help me , Thanks You!

Trading money without any tests

Where are the unit/integration tests? Seems like a risky proposition to run a fiscal operation without Quality Assured code.

Is the robot running?

Hello friend, thank you very much for your time, I am installing your arbitration bot. I have some doubts what I want to ask you:

  1. Before using it, I would like to know if I can use it with real money
  2. What percentage of profit can the bot give
  3. Could you help me if I have any problem with the installation?
  4. Can I contribute to improvements to the code?

Thank you very much, I remain attentive to your response.
Regards

Always mode nog recognized error

No matter what I try, I always get,

python main.py -m triangular
File "main.py", line 25
print 'Mode {0} is not recognized'.format(args.mode)

Is there something I am missing?

Project update

Hello,
Do you still work at that project ? Any fixes or updates not pushed ?

Issue connecting to the keys.

Hi, just discovered this arbit bot. Looks like you've just started working on it. Im not too handy with python but ive managed to get it all installed but its giving me this
IOError: [Errno 2] No such file or directory: '../.keys/bittrexkey'

The file is there and has not been tampered with

Also when modifying the exchange value in in the triangle arbit page. It tells me.
NameError: global name 'bitfinex' is not defined

Keys folder

Hi,

I am very new to programming and crypto world, so excuse my stupid question. What do you mean by public private and api name, i.e what should I fill in these spaces.

Thanks in advance,
Khanlar

binance support?

hello can you add binance to it because it got low fee , but got minimun order limit on 0.001btc ...

fully auto triangular arbitrage on binance

Hello , if this project can do :
fully automatic monitoring and auto multiply total amount of btc(binance minimum order limit is 0.001 Btc) and auto order 3 or more profit road(after calc the higher profit of triangular arbitrage pair like :
road1 :BTC-XX1-ETH-BTC 0.02% profit
road2 : BTC-XX2-ETH-BTC 0.018% profit
road3 : BTC-XX3-BNB-BTC 0.011% profit ) on few second and 24/7. running without problem or crash , i will donate 0.005-0.01 BTC , Hope someone can do this work , Thanks You !

There is always a problem

kelvinau
hello.
I don't know how to program, but I am learning. At the same time, I am also a cryptocurrency trader. So I think your project is very appealing to me. I feel great.
But unfortunately, I downloaded the program as requested, and after running, there is always a problem. I mainly want to know two questions:

  1. Does this script have to run in cmd.exe?
    2. When I run python main.py -m triangular in cmd.exe, I get an error. The error message is as follows:

D:\arbitrage>python main.py -m triangular
Traceback (most recent call last):
File "main.py", line 19, in
From engines.triangular_arbitrage import CryptoEngineTriArbitrage
File "D:\arbitrage\engines\triangular_arbitrage.py", line 3, in
Import grequests
ImportError: No module named grequests

D:\arbitrage>

kelvinau , I hope to get your help.My email: [email protected].
I also created a Telegram group https://t.me/joinchat/GBLOnRIoWXo7UHVF5R6AUw.
I hope to meet with you in the group, thank you. Other friends who use this great program are also welcome to join.
Thanks again. Your job is great.

Why would volatility be a problem for arbitraging?

Hi

Thanks for the useful resource.

Question:
You seem to imply that high volatility is not conducive to fruitful arbitraging, whereas my understanding was the opposite - that the volatility is creating the arbitrage opportunities.
Would you mind expanding on the topic?

Many thanks

Dont work at Bittrex

This bot still working? For me only show this:

crypto-arbitrage$ sudo python main.py -m triangular -p
20180209011813 starting Triangular Arbitrage Engine...
checking open orders...
no open orders
starting to check order book...

And nothing more after this.

what does the message "u'BTC'" mean?

Hello, I have run this code, in bittrex exchange, and just edit the key files. use the format "python main.py -m triangular -p", but all I get is the message u'BTC', what does these mean?

20190519160005 starting Triangular Arbitrage Engine...
checking open orders...
no open orders
starting to check order book...
u'BTC'
u'BTC'
u'BTC'
u'BTC'
u'BTC'

Can`t get it to start working

I left it running for about 24 hours and this is all I get.
Im doing the default values of BTC-LTC-ETH and the exchange is bittrex. I didnt change anything in the code except I put my Bittrex APIs

python main.py -m triangular -p
20180321023439 starting Triangular Arbitrage Engine...
checking open orders...
no open orders
starting to check order book...
[<Response [200]>, <Response [200]>, None]

[<Response [200]>, <Response [200]>, None]

[<Response [200]>, <Response [200]>, None]

[<Response [200]>, <Response [200]>, None]

[<Response [200]>, <Response [200]>, None]

[None]

[<Response [200]>, <Response [200]>, None]

[None, None, None]

[None, <Response [200]>, <Response [200]>]

[<Response [200]>, <Response [200]>, None]

[<Response [200]>, <Response [200]>, None]

[<Response [200]>, None, None]

[None, None, None]

[None]

[None]

[None, <Response [200]>, <Response [200]>]

[None, <Response [200]>, <Response [200]>]

[<Response [200]>, None, <Response [200]>]

u'BTC'

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.