Skip to content

V2: Actor implementation for "Trader" (WIP)#4

Merged
FergusInLondon merged 3 commits into
developfrom
v2/trader-actor
Aug 12, 2021
Merged

V2: Actor implementation for "Trader" (WIP)#4
FergusInLondon merged 3 commits into
developfrom
v2/trader-actor

Conversation

@FergusInLondon
Copy link
Copy Markdown
Owner

No description provided.

@FergusInLondon FergusInLondon changed the title V2: Actor implementation for "Trader" V2: Actor implementation for "Trader" (WIP) Aug 6, 2021
@FergusInLondon FergusInLondon force-pushed the v2/trader-actor branch 2 times, most recently from 16daa72 to 3daafcc Compare August 12, 2021 15:09
This PR introduces a WIP implementation of the `SyncAgent`, an Actor-based
component that is responsible for handling messages from both the strategy
and the exchange. Inbound data from the exchange - via the user stream - is
used to maintain a snapshot of the status of the account. Whilst messages
originating from the strategy are used to generate transactions destined
for the exchange. The SyncAgent runs within the context of it's own thread,
and communication is managed via a Queue and associated message types.

There are associated tests for the SyncAgent, written in Gherkin and using
the `behave` python package.

Incidental Work:

- All changes to the `AccountStatus` entity are now done via combined
update/mutation objects, available in the `mutations` module.
- Trader/Account and Strategy entities are now combined, this allows more
customisation when writing strategies, but also removes some moving parts.
- User defined `Strategy` objects are now expected to implement any risk
calculations - as opposed to having seperate `Calculator` objects.
- The Runner is now capable of handling graceful shutdowns, and terminating
the SyncAgent and API Adapter.
- Unit test coverage has improved, although the BDD tests need work for
compatibility with the new `SyncAgent`
- Various amendments and tweaks to interface/abstract classes.
- The `Makefile` now has a 'help' target.

As usual, these changes are driven by the living design document on notion.so
@FergusInLondon FergusInLondon merged commit 213beff into develop Aug 12, 2021
@FergusInLondon FergusInLondon deleted the v2/trader-actor branch August 12, 2021 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant