Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Commit

Permalink
Pulls min_size from Bittrex instead of being a static value. Creates …
Browse files Browse the repository at this point in the history
…a static value for min_total of 50k Satoshi (0.005BTC), Bittrex's minimum order size. (#653)
  • Loading branch information
jerrytunin authored and DeviaVir committed Oct 24, 2017
1 parent 677f37f commit 2077c17
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extensions/exchanges/bittrex/update-products.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ var bittrex = require('node.bittrex.api')
var mapping
var products = []

function addProduct(base, quote, altname) {
function addProduct(base, quote, minSize, altname) {
products.push({
asset: quote,
currency: base,
min_size: '0.01',
min_size: minSize,
min_total: '0.0005',
max_size: '1000000',
increment: '0.00000001',
label: base + '/' + quote
Expand All @@ -32,7 +33,7 @@ bittrex.getmarkets(function (data) {
mapping = data.result

Object.keys(data.result).forEach(function (result) {
addProduct(data.result[result].BaseCurrency, data.result[result].MarketCurrency, data.result[result].altname)
addProduct(data.result[result].BaseCurrency, data.result[result].MarketCurrency, data.result[result].MinTradeSize.toFixed(8), data.result[result].altname)
})
var target = require('path').resolve(__dirname, 'products.json')
require('fs').writeFileSync(target, JSON.stringify(products, null, 2))
Expand Down

0 comments on commit 2077c17

Please sign in to comment.