refactor of ticker logic #304
No reviewers
Labels
No labels
blocked
breaking
bug
dependencies
duplicate
enhancement
good first issue
help wanted
question
tech debt
testing
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
scion/arbitrader!304
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ticker-refactor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The main purpose of this PR is to strengthen the separation between the code that fetches price data and the code that analyzes the market for trade opportunities. The idea was always that we would maintain the
allTickersmap with the most up-to-date view of market prices that we know, so that the rest of the code didn't have to worry about calling APIs and could focus on just crunching the numbers. Because I had avoided adding a lot of concurrency to the bot in the past, the two processes were tied together and happening sequentially. As we moved forward we started to introduce some events and event listeners, and this PR fully separates things. All ticker fetching happens the same way: use aTickerStrategyto get some prices, put them inallTickersand publish an event about the change. Each event received triggers an analysis to determine whether or not to trade, but now the ticker updating and market analyzing happen independently of one another in entirely separate thread pools.