Skip to content

Commit

Permalink
kraken limits and precision
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Oct 2, 2017
1 parent 5fe5b57 commit 4417168
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -14421,6 +14421,18 @@ var kraken = {
'amount': market['lot_decimals'],
'price': market['pair_decimals'],
};
let amountLimits = {
'min': Math.pow (10, -precision['amount']),
'max': Math.pow (10, precision['amount']),
};
let priceLimits = {
'min': Math.pow (10, -precision['price']),
'max': undefined,
};
let limits = {
'amount': amountLimits,
'price': priceLimits,
};
result.push ({
'id': id,
'symbol': symbol,
Expand All @@ -14432,6 +14444,7 @@ var kraken = {
'maker': maker,
'taker': parseFloat (market['fees'][0][1]) / 100,
'precision': precision,
'limits': limits,
});
}
this.marketsByAltname = this.indexBy (result, 'altname');
Expand Down
2 changes: 2 additions & 0 deletions examples/js/symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ let printSymbols = async (id) => {
// output a list of all market symbols
log (id.green, 'has', exchange.symbols.length, 'symbols:', exchange.symbols.join (', ').yellow)

// Object.values (markets).forEach (market => log (market))

// make a table of all markets
let table = asTable.configure ({ delimiter: ' | ' }) (Object.values (markets))
log (table)
Expand Down
2 changes: 1 addition & 1 deletion keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"coingi": { "apiKey": "6ZUYcF0BAABlKbb4oD5rNoOvnfhSzpls/zj4g+DstYCYm85aGuFh1LpsYug339PT", "secret": "6TLLWAqYkCSA68U+0oJ2GFCvNxZJgQntZnRbnN2b" },
"coinmate": { "apiKey": "RK3tVw8CEmHfvx5qryeNa2lvvQovU4W31qXqBuQDObY", "secret": "UmS7PMgzAgTwbEO8ylSpAuKqkz2ShEG9ZW429OiUVws", "uid": "12092" },
"coinsecure": { "apiKey": "gzrm0fP6BGMilMzmsoJFPMpWjDvCLThyrVanX0yu" },
"coinspot": { "apiKey": "f212d2519be1814dce6eb9cfe7f60f7b", "secret": "R5H5DBEL482WC14EAJTDBVLJDDUFL28HV43D5PNM4QEAYR69WW56QKQ1ECG7XYLEB85FBKAFQ68UYWQXJ" },
"coinspot": { "apiKey": "f212d2519be1814dce6eb9cfe7f60f7b", "secret": "R5H5DBEL482WC14EAJTDBVLJDDUFL28HV43D5PNM4QEAYR69WW56QKQ1ECG7XYLEB85FBKAFQ68UYWQXJ", "skip": true },
"cryptopia": { "apiKey": "1b1a398d7d4c415287a3ca04107257aa", "secret": "ODXmrj4JWDxVo2kaGhJ8m/BmwEcDUNmSBIf2bQtGvtA=" },
"dsx": { "apiKey": "13bbd413-2d97-4373-8757-72f35b8803cc", "secret": "9X6QHG9Q2U5876D1RNSFJJ02E8P2KGTORSPSC2AMN7YJ" },
"flowbtc": { "apiKey": "849d68a1a5261acab999d1dab7a6bb88", "secret": "106e79c2a6f77e860ebf5aa5c6405c5e", "uid": "[email protected]" },
Expand Down
2 changes: 2 additions & 0 deletions transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ while (exchanges = regex.exec (contents)) {
[ /([^\s]+)\.slice \(([^\)\:]+)\)/g, '$1[$2:]' ],
[ /Math\.floor\s*\(([^\)]+)\)/g, 'int(math.floor($1))' ],
[ /Math\.abs\s*\(([^\)]+)\)/g, 'abs($1)' ],
[ /Math\.pow\s*\(([^\)]+)\)/g, 'math.pow($1)' ],
[ /Math\.round\s*\(([^\)]+)\)/g, 'int(round($1))' ],
[ /(\([^\)]+\)|[^\s]+)\s*\?\s*(\([^\)]+\)|[^\s]+)\s*\:\s*(\([^\)]+\)|[^\s]+)/g, '$2 if $1 else $3'],
[/ \/\//g, ' #' ],
Expand Down Expand Up @@ -369,6 +370,7 @@ while (exchanges = regex.exec (contents)) {
[ /Math\.floor\s*\(([^\)]+)\)/g, '(int) floor ($1)' ],
[ /Math\.abs\s*\(([^\)]+)\)/g, 'abs ($1)' ],
[ /Math\.round\s*\(([^\)]+)\)/g, '(int) round ($1)' ],
[ /Math\.pow\s*\(([^\)]+)\)/g, 'pow ($1)' ],
[ /([^\(\s]+)\s+%\s+([^\s\)]+)/g, 'fmod ($1, $2)' ],
[ /\(([^\s]+)\.indexOf\s*\(([^\)]+)\)\s*\>\=\s*0\)/g, '(mb_strpos ($1, $2) !== false)' ],
[ /([^\s]+)\.indexOf\s*\(([^\)]+)\)\s*\>\=\s*0/g, 'mb_strpos ($1, $2) !== false' ],
Expand Down

0 comments on commit 4417168

Please sign in to comment.