当前位置: 首页 > 软件库 > Web3 > 开源货币/比特币 >

crypto-arbitrage

授权协议 MIT License
开发语言 Python
所属分类 Web3、 开源货币/比特币
软件类型 开源软件
地区 不详
投 递 者 澹台庆
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Crypto Arbitrage

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.

 相关资料
  • Overview 因为Java的Crypto API始终有点难用,SpringSide在core module中的org.springside.modules.security.utils中提供了封装。 API的出入参数都是byte[]数组,需要配合Encodes来转换成Hex或Base64存储。 Digests消息摘要 去年一轮的密码被盗风波后,使用salt并迭代N次的sha-1式密码存储已经是

  • The crypto component hosts all the implementations of cryptographic primitives we use in Libra: hashing, signing, and key derivation/generation. The NextGen directory contains implementations of crypt

  • crypto 跟加密相关的一些功能,包括安全验证等。

  • crypto 包括 attr、ecdsa、utils 子包。 attr:chaincode 属性检查校验; ecdsa:ecdsa 加密算法接口,一些 hash 和签名校验方法。 utils:提供 aes、ecdsa、x509 等方法。

  • crypto模块的目的是为了提供通用的加密和哈希算法。用纯JavaScript代码实现这些功能不是不可能,但速度会非常慢。Nodejs用C/C++实现这些算法后,通过cypto这个模块暴露为JavaScript接口,这样用起来方便,运行速度也快。 MD5和SHA1 MD5是一种常用的哈希算法,用于给任意数据一个“签名”。这个签名通常用一个十六进制的字符串表示: const crypto = req

  • import "crypto" crypto包搜集了常用的密码(算法)常量。 type PublicKey type PublicKey interface{} 代表一个使用未指定算法的公钥。 type PrivateKey type PrivateKey interface{} 代表一个使用未指定算法的私钥。 type Hash type Hash uint Hash用来识别/标识另一个包里实现