-
Notifications
You must be signed in to change notification settings - Fork 129
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
refactor external feeds to be External Price and Order Engine + fix unit tests #524
Comments
@bitfag would you be able to handle this? |
Yes I think this this task can be done in reasonable time. |
i think external feeds should be refashioned into the CEX price query engine as part of the TDD refactor proposal. save us time and cost if this is done as a whole chunk including the unit tests. This is the ccxt manual See section in yellow for 2 separate modules 1 for price query and 1 for the order engine to ccxt. |
Don't forget - Relative Orders strategy uses external feeds, so whatever you change here will need to be updated over there. |
Sorry I don't get it: are you proposing to not refactor tests until external feeds will be moved into "CEX price query engine"? So we're postponing this task until we do application design for a new model with all these price engines etc? |
As @thehapax described in the dev chat, the task is the develop Cex Price Query Engine. This raises the next question: how does this engine should fit into current project architecture? |
The architecture has been laid in the UML. It should be obvious. |
Specifically page 5 of the TDD And here as octo linked: https://www.lucidchart.com/documents/view/6d5d06c4-81b2-4866-82d3-88788e1e2f6b/0 |
Not postponing. Developing the price query engine using the existing price feed code as a starting point
|
Ok, basically it's should be a standalone class like dexbot/cex_engine.py. UML diagram does not specify any API how to instantiate (
There are several methods in UML and no description provided, it's unclear what these methods are supposed to do?
Also maybe I missed, what is the goal of separating "CEX price query engine" and "CEX order engine"? |
Ok, I see these methods are part of dexbot/strategies/external_feeds/ now. |
I leave the init design choice to the developer who is making the implementation.
A class should have only one job - see SOLID principles. |
@thehapax I don't think separation of orders placement methods into separate class is a good idea:
|
|
Further:
|
I currently implementing Price Engine using OOP and class inheritance, probably I need to publish WIP version for you to review, so you can tell me more precisely if you like it or not, and what needs to be changed. |
ok sounds good. :) |
I pushed current work into https://github.com/bitfag/DEXBot/tree/524-refactor-external-feeds |
ok I took a look. it is a good start but we will need to rename the packages. As per conversation with @joelvai StrategyBase will become an Abstract Base class. Future Strategies could use more than one feed at any time and more than one dex/cex at the same time.
the flow should be Price Feed >> Strategy >> Order Engine where Each Strategy can have N source of price feeds and M order engines and the relationship is {M:N} where N >= 1 and M >=1. price_engine would not be switching between individual feeds, i don't think we need to develop this at this stage. It would be better to just implement gecko and waves and do interface later (if needed) when we get base refactor done. For now, I would focus on the getting staggered orders with unit test and refactored with virtual orders logic separated. Once the base refactor is merged into the devel branch then we can continue with this part. |
refactor external feeds unit tests to use a proper unittest framework.
The text was updated successfully, but these errors were encountered: