Background
Currently the autopilot and orderbook are configured via CLI args or env variables. This is very inconvenient for things that need multiple configuration parameters (e.g. configuring drivers). This prompted us to use a pattern where we encode multiple arguments inside 1 env variable by separating them via | or some other separator. This in turn always requires custom parsing logic and is overall just terrible to understand when reading an .env file.
To improve the situation the autopilot and orderbook should both be migrated to use config files like the driver.
This should be split into separate tasks but since the orderbook and autopilot actually share a lot of arguments I wanted to flag this in 1 overarching issue at least.
One thing to note is that clap (which is used for building CLI argument parsing) is exceptionally good for discoverability since it automatically generates a --help command that lists and explains all the available arguments.
This will no longer be possible the default with config files. Instead we likely have to use toml-example-derive to automatically generate example config files that stay in sync with the process and print that on --help.
Background
Currently the
autopilotandorderbookare configured viaCLIargs orenvvariables. This is very inconvenient for things that need multiple configuration parameters (e.g. configuring drivers). This prompted us to use a pattern where we encode multiple arguments inside 1envvariable by separating them via|or some other separator. This in turn always requires custom parsing logic and is overall just terrible to understand when reading an.envfile.To improve the situation the
autopilotandorderbookshould both be migrated to use config files like thedriver.This should be split into separate tasks but since the
orderbookandautopilotactually share a lot of arguments I wanted to flag this in 1 overarching issue at least.One thing to note is that
clap(which is used for building CLI argument parsing) is exceptionally good for discoverability since it automatically generates a--helpcommand that lists and explains all the available arguments.This will no longer be possible the default with config files. Instead we likely have to use toml-example-derive to automatically generate example config files that stay in sync with the process and print that on
--help.