markokeeffe / arb
监控澳大利亚加密货币市场,寻找套利机会。
1.1
2018-01-09 03:01 UTC
Requires
- php: >=5.4.0
- coinbase/coinbase: ^2.5
- google/apiclient: ^2.2
- vlucas/phpdotenv: ^2.4
README
连接到Coinbase和BTC Markets,计算从一方购买并在另一方出售能赚取多少钱。
安装
- Composer 安装:
$ composer install
- 将
/.env.example
复制到/.env
。 - 获取Coinbase API密钥和密钥,需要
wallet:payment-methods:read
和wallet:payment-methods:limits
权限。 - 将这些值放入
/.env
文件中。 - 获取BTC Markets API密钥和密钥。
- 将这些值放入
/.env
- 使脚本可执行
$ chmod +x arb.php
使用方法
$ ./arb.php
示例输出
Getting Coinbase Limits...
Coinbase Buy Limit: $55.00
Coinbase Buy Amount after Fee: $52.8055
Getting Coinbase BTC price...
Getting Coinbase ETH price...
BTC: $18681.37
ETH: $599.06
Getting BTCMarkets BTC price...
Getting BTCMarkets ETH price...
BTC: $21090.47
ETH: $648.01
Calculating variances...
BTC: 12.8957351629%
ETH: 8.17113477782%
Can Buy BTC: 0.002826639588
Can Buy ETH: 0.088147264047
Expected BTC Profit: $7.6878128193
Expected ETH Profit: $4.66737739918
作为守护进程运行
$ ./arb.php daemon
以守护进程运行脚本,每10分钟检查一次。