Skip to main content

Creating and running AutoConfig jobs

In AutoConfig, all job configurations are contained in a single file named autoconfig.json. This file can hold multiple job configurations. Whenever Gunbot restarts or the autoconfig.json file is modified, all jobs within the configuration are automatically scheduled. Previously scheduled jobs are removed to avoid any conflicts.

Running jobs​

Running AutoConfig jobs is a straightforward process that requires two things:

  • Enabled jobs, each job has an option to enable or disable it
  • AutoConfig itself enabled, which can be done through the browser interface on the AutoConfig page.

Creating simple jobs without writing code​

To create a straightforward AutoConfig job, such as modifying a single strategy parameter through pre-built filter options, you can utilize the browser interface's editor. The editor will walk you through each necessary step, but before beginning the job configuration process, ensure that you have familiarized yourself with filters and job types by reading about them.

AutoConfig editor interface for creating automated configuration jobs

This editor allows for creating simple jobs

Creating more complex jobs​

To create jobs with greater complexity, you can use the Gunbot code editor. This tool is ideal for users comfortable with JSON, or for those with ambitious plans.

The editor offers autosuggest options for valid templates related to all job types and filters. However, if you prefer, you may use any editor you like, as the format for jobs is simply JSON.

AutoConfig built-in code editor for customizing configuration scripts

The JSON based config is easier for more complex jobs. The editor has code suggestions for templates of valid jobs and filters.

General info about jobs​

When a job is processed, changes to the config.js file are made only for pairs that pass all filters in a filter set.

You can include one or many jobs in the autoconfig.json file, each with its own schedule. A job applies to a single exchange, and can have one or multiple filters. Within a job, you can specify filters to determine which pairs it applies to.

If a job successfully completes, the changes are written to config.js and Gunbot starts using the new settings. Most config changes, such as pair override changes, are applied without restarting the bot. If a job doesn't cause any changes, for example, because it attempts to place already existing overrides, it won't cause a Gunbot restart.

You can set schedules per job in a format similar to how cron jobs are set. If you're not familiar with the format, you can use a website like https://crontab-generator.org/ to generate it.

All configuration options are available in the browser interface. We suggest creating a config example using the interface, even if you prefer manually editing the config file. This way, you can ensure all necessary parameters are included.


tip

To avoid unexpected configuration changes when using a very fast schedule, such as jobs that update your bot configuration every few seconds, it is important to refrain from making manual setting changes using the browser while AutoConfig jobs are running. Be sure to make this a habit to maintain consistency in your bot's configuration.