diff --git a/mm2src/mm2_main/src/lp_ordermatch/simple_market_maker.rs b/mm2src/mm2_main/src/lp_ordermatch/simple_market_maker.rs index 6ac227c29f..728f177176 100644 --- a/mm2src/mm2_main/src/lp_ordermatch/simple_market_maker.rs +++ b/mm2src/mm2_main/src/lp_ordermatch/simple_market_maker.rs @@ -137,10 +137,10 @@ impl PriceSources { #[derive(Deserialize)] pub struct StartSimpleMakerBotRequest { cfg: SimpleMakerBotRegistry, - // TODO: We can't `flatten` the price_sources while implementing `default` because of this issue: - // https://github.com/serde-rs/serde/issues/1626 - so let's only flatten for now and provide no default. + // TODO: This is marked as an `Option` for now so we can be able to provide a default value for it since + // `flatten` & `default` don't work together: https://github.com/serde-rs/serde/issues/1626. #[serde(flatten)] - price_sources: PriceSources, + price_sources: Option, bot_refresh_rate: Option, } @@ -752,7 +752,7 @@ pub async fn start_simple_market_maker_bot(ctx: MmArc, req: StartSimpleMakerBotR *state = RunningState { trading_bot_cfg: req.cfg, bot_refresh_rate: refresh_rate, - price_urls: req.price_sources.get_urls(), + price_urls: req.price_sources.unwrap_or_default().get_urls(), } .into(); drop(state); diff --git a/mm2src/mm2_main/tests/mm2_tests/lp_bot_tests.rs b/mm2src/mm2_main/tests/mm2_tests/lp_bot_tests.rs index a4c4e69d91..846508d2f2 100644 --- a/mm2src/mm2_main/tests/mm2_tests/lp_bot_tests.rs +++ b/mm2src/mm2_main/tests/mm2_tests/lp_bot_tests.rs @@ -32,7 +32,6 @@ fn test_start_and_stop_simple_market_maker_bot() { "mmrpc": "2.0", "method": "start_simple_market_maker_bot", "params": { - "price_url": "https://prices.komodian.info/api/v2/tickers", "cfg": { "KMD-BEP20/BUSD-BEP20": { "base": "KMD-BEP20",