Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const orders = positions.map(({ symbol, amount }) => new Order({
symbol,
type: 'MARKET',
amount: amount * -1,
flags: Order.flags.REDUCE_ONLY | Order.flags.POS_CLOSE
}))