Skip to content

Commit

Permalink
Add basic CCXT support for 70+ exchanges (coinbase#25)
Browse files Browse the repository at this point in the history
* Add product and ticker methods

* Add loadOrderbook method

* Add loadBalances

* Update index

* Throw on unsupported operations

* Update node version requirement
  • Loading branch information
CjS77 authored Sep 20, 2017
1 parent a3ec1ae commit 293a255
Show file tree
Hide file tree
Showing 12 changed files with 744 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GDAX Trading toolkit
Provide all the tools traders need, both professional and hobbyist alike, to create automated trading bots on the
GDAX and supported digital asset exchanges. Note: Node 6.11 is required.
GDAX and supported digital asset exchanges. Note: Node 7.6 or above is required.


## Install
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@types/ws": "0.0.37",
"bignumber.js": "4.0.2",
"bintrees": "1.0.1",
"ccxt": "^1.6.72",
"commander": "2.9.0",
"crypto": "0.0.3",
"gdax": "0.3.1",
Expand Down
4 changes: 4 additions & 0 deletions src/exchanges/PublicExchangeAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ export interface Ticker {

export interface Product {
id: string;
// The id on the underlying source exchange
sourceId: string;
baseCurrency: string;
quoteCurrency: string;
baseMinSize: BigJS;
baseMaxSize: BigJS;
quoteIncrement: BigJS;
// The original data from the underlying exchange
sourceData: any;
}
4 changes: 3 additions & 1 deletion src/exchanges/bitfinex/BitfinexExchangeAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ export class BitfinexExchangeAPI implements PublicExchangeAPI, AuthenticatedExch
const quote = prod.pair.slice(3, 6);
return {
id: REVERSE_PRODUCT_MAP[prod.pair] || prod.pair,
sourceId: prod.pair,
baseCurrency: REVERSE_CURRENCY_MAP[base] || base,
quoteCurrency: REVERSE_CURRENCY_MAP[quote] || quote,
baseMinSize: Big(prod.minimum_order_size),
baseMaxSize: Big(prod.maximum_order_size),
quoteIncrement: Big(prod.minimum_order_size)
quoteIncrement: Big(prod.minimum_order_size),
sourceData: prod
};
});
return products;
Expand Down
4 changes: 3 additions & 1 deletion src/exchanges/bittrex/BittrexAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ export class BittrexAPI implements PublicExchangeAPI, AuthenticatedExchangeAPI {
const result: Product[] = data.result.map((market: any) => {
return {
id: market.MarketName, // same format as GDAX, so no need to map
sourceId: market.MarketName,
baseCurrency: market.BaseCurrency,
quoteCurrency: market.marketCurrency,
baseMinSize: Big(market.MinTradeSize),
baseMaxSize: Big('1e18'),
quoteIncrement: Big(market.MinTradeSize)
quoteIncrement: Big(market.MinTradeSize),
sourceData: market
};
});
return resolve(result);
Expand Down
Loading

0 comments on commit 293a255

Please sign in to comment.