-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simple market maker bot #1066
simple market maker bot #1066
Conversation
…1065 - Add `start_simple_market_maker_bot` rpc call in dispatcher_v2.rs - Add `stop_simple_market_maker_bot` rpc call in dispatcher_v2.rs - Create a lp_bot.rs file and initiate the module in mm2.rs - Create a lp_bot_tests.rs file that contains unit test of the lp_bot module. - Add a context for the simple_trading_bot in mm_ctx.rs - Add a simple_market_maker.rs file that contains the simple trading bot logic. - Add the loop/logic for lp_price_service_loop (that fetch price every 20 seconds) - Add the loop of lp_bot_loop and an empty logic function - Add bot configuration data structure - Add price registry data structure Some notes: - There is too many logs right now in my implementation, I should reduce them.
…into simple_market_maker_bot
- Add a function to clone maker_order as read-only ops - Add a loop that iterate through maker orders and call update_single_order if the combination is found in cfg - Add update_single_order without any concrete logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have several changes requests and few questions 🙂
mm2src/lp_bot/simple_market_maker.rs
Outdated
|
||
pub async fn lp_bot_loop(ctx: MmArc) { | ||
info!("lp_bot_loop successfully started"); | ||
loop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a good chance to start more extensive usage of the State machine
pattern implemented by @sergeyboyko0791 🙂 Please check https://github.com/KomodoPlatform/atomicDEX-API/blob/mm2.1/mm2src/common/patterns/state_machine.rs. We plan to refactor some code parts to it in the future too.
… code review - Change `StartSimpleMakerBotAnswer` to `StartSimpleMakerBotRes` - Change `StopSimpleMakerBotAnswer` to `StopSimpleMakerBotRes` - Remove spurious usage of `return` - Sort alphabetically the dispatcher_v2 commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more changes requests and a couple of questions 🙂
- add a new log passthrough function that could be used
…into simple_market_maker_bot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have few more changes requests and questions 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more review iteration 🙂
…into simple_market_maker_bot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved 🙂 @Milerius Thanks for your patience and good work on fixing all the remarks 👍
No description provided.