-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CS5.7 - Prevent executing recurring swaps for missed intervals + add …
…SwapWindow.length (#90) Previously, if a recurring swap interval was missed in the past, a swap could be repeatedly executed for each missed interval. This change makes it so that swaps can no longer be executed for missed intervals. We also define another `SwapWindow` struct that defines the `startTime`, `interval`, and `length` of the window. The `length` field is the only new field. It allows us to keep the window tighter so we don't end up in a situation where a "Swap every Monday" configuration results in a "Buy on Sunday" + "Buy on Monday". A swap is executable any time between the `swapWindowStartTime` + `swapWindowLength`. The `swapWindowStartTime` shifts in increments of `swapWindowInterval`.
- Loading branch information
1 parent
ff00501
commit 14f377b
Showing
4 changed files
with
229 additions
and
81 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
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.