I’ve implemented some fairly rudimentary automation that covers the first five of the six quickstart steps. This includes:

  • Registering a new agent should one not be persisted for the current reset date
  • Accepting a contract
  • Purchasing a mining drone and sending it out the an asertoid
  • Refueling and mining the asteroid
  • Transiting to markets to sell the ore

I went down a particularly unpleasant PostgreSQL docker container permission issue and was ultimately unable to solve it. I’ve improved the error handling and have stack traces available in Seq, and solved wrong line numbers in ts-node/Node v20 stack traces. I’m now persisting market data in postgres to reduce api calls and have also introduced bottleneck to stay within the rate limits of the spacetraders api.

To complete this first round of automation I still need to:

  • Add some routing capability so ships can move between waypoints for journeys that otherwise can’t be made directly due to fuel constraints
  • Deliver contract goods to their destination and fulfil the contract

Source