-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup new bot data controller (#636)
* Setup new bot data controller * Simplify database operations By creating simpler and atomic db operations as a separate layer, we reduce complexity for testing (duplicated code), decouple dependencies of database and services and also reduce circular imports. * Refactor and unify simulated orders (paper trading) * Fix tests for new SQL bots migration * Refactor all data models to use a single BotModel The reason behind this is that pydantic table models are SQL models which are different from traditional pydantic models. So to reduce repetition, we have to create a BotBase which is inherited by the "guardian" i.e. the BotModel which is use to guard data everywhere, and the separation of database tables i.e. BotTable * Fix all SQLModel vs Pydantic model compatibility issues * Refactor deals into a singleton The DealFactory is a literal factory, not a factory pattern, in that we do know what kind of object we are creating, but we are unifying into a single point of entry (singleton)
- Loading branch information
Showing
49 changed files
with
2,781 additions
and
2,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.