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

CEXIO update products fix #1227

Merged
merged 1 commit into from
Jan 26, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions extensions/exchanges/cexio/update-products.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
#!/usr/bin/env node

const ccxt = require('ccxt')
const path = require('path')
var client = new ccxt.cex()
client.fetchMarkets().then(result => {
var products = []
result.forEach(function (product) {
var increment = ''
if (product.info.symbol1 === 'BTC' && product.info.symbol2 !== 'RUB') {
increment = '0.1'
} else if (product.info.symbol1 === 'BTC' && product.info.symbol2 === 'RUB') {
increment = '1'
} else if (product.info.symbol2 === 'BTC' && (product.info.symbol1 === 'XRP' || product.info.symbol1 === 'GHS')) {
increment = '0.00000001'
} else if (product.info.symbol2 === 'BTC') {
increment = '0.000001'
} else if (product.info.symbol1 === 'XRP') {
increment = '0.0001'
} else {
increment = '0.01'
}
products.push({
asset: product.info.symbol1,
currency: product.info.symbol2,
min_size: product.info.minLotSize.toString(),
max_size: product.info.maxLotSize != null ? product.info.maxLotSize.toString() : product.info.maxLotSize,
increment: product.info.symbol1 === 'BTC' ? '0.01' : (product.info.symbol2 === 'BTC' ? '0.00000001' : '0.0001'),
increment: increment,
label: product.id
})
})
Expand Down