eseidel / space_traders

spacetraders.io client in Dart
MIT License
22 stars 1 forks source link

feat: Better understand and use market data #1

Closed eseidel closed 1 year ago

eseidel commented 1 year ago

Right now I've done some basic integration of market data from: https://st.feba66.de/prices Via: https://github.com/eseidel/space_traders/blob/main/packages/space_traders_cli/lib/prices.dart

But there are a bunch of things wrong with this approach.

  1. This is global market data. Across the whole "universe". Likely that data is split across functionally separate markets. Although trades are possible across the whole thing, it may be prohibitively "long" distances. Also the data is relatively small (only 4k trades last I checked), which likely means it's only for a small subset of the universe, which may or may not correspond with where I'm trading.
  2. I'm currently using "median" value across all the data for a given trade good (probably at least want to use only "local" data for the last N minutes). I'm not sure "median" is the right way to get a sense of "what is a normal price for this", maybe? Should I put putting it into some sort of distribution? (to avoid that "median" might be dominated by lots of trades at the same overused market?)
  3. Currently I'm displaying the percentile information from this data on trades (to try and get a sense of how good/bad the trade was). But I probably want to display either percentage discount (e.g. 50% of median price) or percentage discount * median price (e.g. this trade was -5c worse than median per unit).

image

Things I've considered doing with price data is planning trade routes.

The game does not let you see price information at a waypoint unless you have a ship there. You can obviously record recent transactions in your own database when you visit a waypoint.

The game will let you see what imports / exports / allowed-tradegoods (not necessarily wanted by the waypoint, just allowed for trading between agents) a given market handles.

A basic trading algorithm might be to buy goods locally that seem at the greatest credits discount below median trade value and then head towards either a nearby market with recently known above-median trade prices, or head blindly to a market marked as "import" for those goods, on the assumption that should give you median-or-better trade prices?

eseidel commented 1 year ago

I've done a ton of work on trading since this issue was filed. I actually turned off my trading logic the last month or so to focus on making my mining (and mounts) better. I'm not sure this issue has a lot of utility being open, so closing. A more up-to-date todo list is kept in the README: https://github.com/eseidel/space_traders/blob/main/README.md