Tips for dealing with the market?



  • I'm currently trying to get started with the market and I'm wondering if anyone could share any tips for how to best approach this. It seems like quite a hard problem with lots of variables to consider.

    1. How do you decide when to deal with an existing order vs create your own?
    2. How do you decide what price to set for buy and sell orders? How do you get the best price without risking the order sitting there doing nothing?
    3. If you end up with an order that's just sitting there, what do you do? Just leave it? Change the price and lose out on the fee?
    4. The distance factor is another complication. If no-one is creating any orders around me, how do I know that there is any demand for anything I might sell? Or if anyone will sell if I create a buy order?

    Any thoughts would be much appreciated.

    Thanks.



  • @systemparadox

    Some random thoughts.

    1. Is your empire the most efficient at extracting energy locally? If not, you should always be a market-maker rather than a market-taker, since the takers have cheaper costs than you (in terms of CPU per mined energy) and markets are efficient.

    2. Are you trying to get the best price or the best execution speed? Depending on which it is, you can look at different strategies. You can always buy at the offer if you care about speed. If you care about price, you should throw up a high price and slowly walk it down until someone takes it. There are lots of ways to do this and lots of optimizations of the different params you can do.

    3. Walk it down. Reducing a price 10% only costs you .3%. It's not a big deal.

    4. You can probably ignore the local market at first. Using global prices and walking them down works fine and discovers the highest marginal buyer (it's basically an auction). If you care about who is buying your stuff, you can always track this in a table. I haven't found this information to be very useful yet. It's more useful to track the historical prices of different resources over time (using a moving average over different windows), so you know when to sell or hold. For example, if the 1-day average is higher than the 3-day average, it is probably a good time to sell.

    My 2c



  • Thanks.

    This leaves me wondering though - is there no API method to get the stats shown on the market page (the table at the bottom with the volume and average price for each day)?

    It seems that the only way to track the order price is to call Game.market.getAllOrders() to get the list of current orders and then store these prices somewhere. It's too expensive to call this every tick, but say I called this every 100 ticks - surely I am going to miss any orders which were created and fulfilled during this time? This seems like it would skew the stats pretty badly, as I'll always be getting the orders with bad prices which are hanging around forever and missing all the good orders.

    Perhaps I am missing something?


  • Culture

    Unfortunately there is no API to get the market stats data. I handle this by storing a rolling average for each resource, with new "snapshots" of prices added to the rolling average every X ticks.