Tool for automating trades using spacetraders.io API. Built with Typescript
# Clone this repository
$ git clone https://github.com/PezeM/spacetraders-automation.git
# Go into the repository
$ cd spacetraders-automation
# Install dependencies
$ yarn install
# Start
$ yarn start:dev or yarn start:prod
To start the application you can run yarn build
then enter dist
directory and run node index.js
or use existing scripts in package.json
like yarn start:dev
or yarn start:prod
.
This app uses node-config for configuration files placed in config
directory.
Default configuration is placed in default.json
file.
You can easily override config, read more.
In the config
directory create production.json
file.
{
"shipsToScrapMarket": "0",
"marketplaceRefreshTimer": "3000000"
}
Then when running yarn start:prod
the default config properties will be overridden with production config.
Default config is in default.json
file. You can overwrite any config property.
Spacetraders API token. Will create new account if token and username are not presented.
Spacetraders API username. Will create new account if token and username are not presented.
Name of the directory where logs will be saved. It will be created if it doesn't exist.
Level of saved and displayed logs.
What strategy is used for trading, either PROFIT
or LOSS
. When LOSS
is selected, app will make the worst trades possible.
Number of ships to scrap market to calculate the best/worst trades. If 0
then marketplace won't be scraped.
If MAX
then every possible marketplace will have its own ship just for scrapping the market.
The interval to scrap marketplace in milliseconds.
Defines which property will be used to determine the best profit. The best is to use ror
(Rate of return) or profitPerVolume
.
All available types are in the interface MarketplaceProfitPer.
Property to set default trade which is used when the marketplace data is not available (eg. not scrapped yet). Type is ITradeData.
Object of ships to buy with required count of them and minimum money left after transaction. To disable this feature set the property to undefined. Object value is ShipBuyInfo.
Sell all the cargo in the ship other than FUEL
and current trade resource. Useful for emptying space in ships for more profit.
Number in seconds of marketplace cache.
Enables/disables pay loan feature. minMoneyLeftAfterLoanPayment
specifies how much money must be left before paying the loan.
Port of the express server. Default is 8080.
List of items that won't be traded. For example Research
.
You can check out the full license here
This project is licensed under the terms of the MIT license.