https://github.com/mcgizzle/haxchange
A uniform collection of API bindings for various cryptocurrency exchanges
https://github.com/mcgizzle/haxchange
arbitrage binance cryptocurrency cryptocurrency-exchanges haskell kraken trading
Last synced: 2 months ago
JSON representation
A uniform collection of API bindings for various cryptocurrency exchanges
- Host: GitHub
- URL: https://github.com/mcgizzle/haxchange
- Owner: mcgizzle
- License: bsd-3-clause
- Created: 2018-01-12T13:29:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T16:33:47.000Z (about 8 years ago)
- Last Synced: 2026-01-02T09:22:10.491Z (5 months ago)
- Topics: arbitrage, binance, cryptocurrency, cryptocurrency-exchanges, haskell, kraken, trading
- Language: Haskell
- Homepage:
- Size: 139 KB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# haxchange 🤑
## About
The goal of this project is to create a uniform E-DSL for various cryptocurrency exchanges. This could have many uses from arbitraging to algorithmic trading. I will initially only be implementing a select set of functions, but the hope is to extend it in the future.
## Progress
Exchange | getMarkets | getTicker | getBalance | buyLimit | sellLimit
---|---|---|---|---|---
Kraken | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark:
Binance | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark:| :heavy_check_mark:
Bittrex | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_multiplication_x:* | :heavy_multiplication_x:* | :heavy_multiplication_x:*
*New accounts are currently blocked
## Templates
There is a template folder which contains the modules and tests necessary for adding a new exchange, along with most of the bolier plate.
There is a script for creating the files needed to add a new exchange.
### Adding a new exchange
run the following
```
cd templates
sh make.sh
```
This will copy the template files replacing all `` tags with the name of the new exchange.
Contributions are welcomed with open arms :)
## Implementation
There are shared ADT's that are uniform accross all exchanges. Each exchange implements custom `FromJSON` instances as appropriate.
In order to improve effeciency, the data types are mostly [Text](http://sorryiwillinsertalinkatsomestage.com).
There are *ToText* and *FromText* type classes which each have one method
```Haskell
toText :: a -> Text
fromText :: Text -> a
```
Each exchange then implements overrides the *ToText* class with its own implementation
This helps with wrangling data into the unified model and vice-versa. The `toText` function is used to override the general version for special cases.
```Haskell
import qualified Types as T
instance ToText Currency where
toText (COIN BTC) = "XBT"
toText a = T.toText a
```
*Kraken refers to Bitcoin as XBT whereas most exchanges refer to it as BTC
For more information please see the source