-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patharbitrage.php
43 lines (39 loc) · 929 Bytes
/
arbitrage.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
include('arbitrage/class_exch.php');
include('arbitrage/class_arbit.php');
//Tests exchange_class
$exch_1 = new Exchange_usdtbtc();
$exch_2 = new Exchange_usdtbtc();
$exch_3 = new Exchange_usdtbtc();
$exch_1->hydrate_exchange(
'bitfinex',
'https://api.bitfinex.com/v1/book/btcusd',
0.001,
2,
0.25,
0.25
);
$exch_2->hydrate_exchange(
'poloniex',
'https://poloniex.com/public?command=returnOrderBook¤cyPair=USDT_BTC',
0.001,
2,
0.25,
0.25
);
$exch_3->hydrate_exchange(
'bittrex',
'https://bittrex.com/api/v1.1/public/getorderbook?market=USDT-BTC&type=both&depth=50',
0.001,
2,
0.25,
0.25
);
//Test Arbitration class
$arbit = new Arbitration_usdtbtc(0,20);
//Add exchanges to Arbitration
$arbit->add_exchange($exch_1);
$arbit->add_exchange($exch_2);
$arbit->add_exchange($exch_3);
//Test max profit operation
$arbit->max_profitable_operation();