                 self.market.lowest_ask = market.lowest_ask = self.lowest_ask if self.lowest_ask != Number.MAX_VALUE
                 self.market.highest_bid = market.highest_bid = self.highest_bid
 
-                self.helper.sort_array(self.asks, "price", false)
-                self.helper.sort_array(self.bids, "price", true)
+                self.helper.sort_array(self.asks, "price", "quantity", false)
+                self.helper.sort_array(self.bids, "price", "quantity", true)
 
                 if @counter % 5 == 0 and self.market.avg_price_1h and self.market.avg_price_1h > 0.0
 

    capitalize: (str) ->
        str.charAt(0).toUpperCase() + str.slice(1)

    sort_array: (array, field, reverse = false) ->
         array.sort (a, b) ->
            a = a[field]
            b = b[field]
            if reverse then b - a else a - b

    sort_array2: (array, field, field2, reverse = false) ->
         array.sort (a, b) ->
            a = a[field]
            b = b[field]

                #td.type = "cover"
                covers.push td
            @helper.update_array {target: @covers, data: covers }
            @helper.sort_array(@covers, "price", "quantity", !inverted)

    pull_orders: (market, inverted, account_name) ->
        orders = []
