diff --git a/order.js b/order.js index ca18122..1bed58f 100644 --- a/order.js +++ b/order.js @@ -19,7 +19,7 @@ export function sendVaultOrders( socket, chainId, vault ) { for( let [orderIndex, status] of recents ) { if( !(orderIndex in statuses) ) { // only write the database version if there's no open order in the memcache - const orderKey = `${vault}|${orderIndex}` + const orderKey = `${vault}|${orderIndex.toString().padStart(5,'0')}` proms.push(fillOrderStatus(chainId, orderKey, status)) statuses[orderIndex] = status } @@ -72,13 +72,13 @@ export async function recentOrders( socket, chainId, vault, limit=25 ) { } function applyFills( orderStatus, filled ) { - console.log('apply fills', orderStatus, filled) + // console.log('apply fills', orderStatus, filled) orderStatus[5] = filled[0][0] orderStatus[6] = filled[0][1] for( const i in filled[1] ) { - const {filledIn, filledOut} = filled[1][i] + const [filledIn, filledOut] = filled[1][i] orderStatus[7][i] = filledIn orderStatus[8][i] = filledOut } - console.log('applied fills', orderStatus) + // console.log('applied fills', orderStatus) }