First spotted by Taki on slack:
When an order is inactive (amount: 0), the order's .price property when returned via Game.market.getOrderById is incorrect. It is smaller than the actual by a factor of 1000.
I've confirmed this and narrowed it down to the following code block:
|
getOrderById: register.wrapFn(function(id) { |
|
const order = runtimeData.market.orders.all[id] || this.orders[id]; |
|
if(!order) { |
|
return null; |
|
} |
|
const result = JSON.parse(JSON.stringify(order)); |
|
result.price /= 1000; |
|
return result; |
It attempts to fetch order from all orders, but inactive orders don't show up there, so instead it pulls it from your own orders (Game.market.orders), and then divides the order's price by 1000, however, in Game.market.orders the price is already processed, so the end result is price being dividied by 1000 twice, and inaccurate.