forked from kelvinau/crypto-arbitrage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
28 lines (22 loc) · 900 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import argparse
import json
configFile = 'arbitrage_config.json'
f = open(configFile)
config = json.load(f)
f.close()
parser = argparse.ArgumentParser(description='Crypto Arbitrage')
parser.add_argument('-m', '--mode', help='Arbitrage mode: triangular or exchange', required=True)
parser.add_argument('-p', '--production', help='Production mode', action='store_true')
args = parser.parse_args()
engine = None
isMockMode = True if not args.production else False
if args.mode == 'triangular':
from engines.triangular_arbitrage import CryptoEngineTriArbitrage
engine = CryptoEngineTriArbitrage(config['triangular'], isMockMode)
elif args.mode == 'exchange':
from engines.exchange_arbitrage import CryptoEngineExArbitrage
engine = CryptoEngineExArbitrage(config['exchange'], isMockMode)
else:
print 'Mode {0} is not recognized'.format(args.mode)
if engine:
engine.run()