Skip to content

feat: schedule live cycles from previous cycle end#1347

Merged
miohtama merged 3 commits intomasterfrom
feat/live-cycle-since-last-end
Mar 19, 2026
Merged

feat: schedule live cycles from previous cycle end#1347
miohtama merged 3 commits intomasterfrom
feat/live-cycle-since-last-end

Conversation

@miohtama
Copy link
Collaborator

Why

Hyperliquid vault deposits only become tradeable after a 24 hour delay. With a daily strategy that is still scheduled from midnight-aligned wall-clock slots, the extra time spent actually running the cycle means the next live decision can drift away from the point where funds become available.

This PR adds an opt-in live trigger mode so the next cycle is scheduled 24 hours after the previous successful cycle really ended, instead of always snapping back to midnight.

What changed

  • add StrategyCycleTrigger.since_last_cycle_end and expose it through STRATEGY_CYCLE_TRIGGER
  • schedule live cycles from persisted decision_cycle_ended_at, with fallback to uptime completion timestamps
  • reschedule rolling live cycles as one-shot jobs after each successful completion
  • preserve the rolling logical cycle timestamp instead of snapping it back to wall-clock ticks
  • relax the old wall-clock alignment assertion for this trigger mode only
  • add focused scheduler helper coverage and a CLI integration test that runs start with 1 second cycles and verifies the offset behaviour
  • add a changelog entry for the new feature

@miohtama miohtama merged commit 4a42c6f into master Mar 19, 2026
5 checks passed
@miohtama miohtama deleted the feat/live-cycle-since-last-end branch March 19, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant