WIPP
This commit is contained in:
parent
b16d11045c
commit
966440e074
3 changed files with 13 additions and 9 deletions
|
|
@ -106,16 +106,20 @@ exports.trade = function trade (deviceId, rawTrade) {
|
|||
// TODO: move this to DB, too
|
||||
// add bill to trader queue (if trader is enabled)
|
||||
const cryptoCode = rawTrade.cryptoCode
|
||||
const fiatCode = rawTrade.fiatCode
|
||||
const cryptoAtoms = rawTrade.cryptoAtoms
|
||||
|
||||
return db.recordBill(deviceId, rawTrade)
|
||||
.then(() => exchange.active(cryptoCode))
|
||||
.then(active => {
|
||||
if (!active) return
|
||||
|
||||
logger.debug('[%s] Pushing trade: %d', cryptoCode, rawTrade.cryptoAtoms)
|
||||
tradesQueues[cryptoCode].push({
|
||||
currency: rawTrade.currency,
|
||||
cryptoAtoms: rawTrade.cryptoAtoms,
|
||||
const market = [fiatCode, cryptoCode].join('')
|
||||
|
||||
logger.debug('[%s] Pushing trade: %d', market, cryptoAtoms)
|
||||
tradesQueues[market].push({
|
||||
fiatCode,
|
||||
cryptoAtoms,
|
||||
cryptoCode,
|
||||
timestamp: Date.now()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue