You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, each position has its own AutoRebalancer scheduled independently. With $N$ positions, there are $N$ independent scheduled transactions running on their own intervals.
Key Issues:
$O(N)$ Overhead: Scheduling overhead grows linearly with the number of positions.
No Cross-Position Coordination: The Supervisor only performs fixReschedule() recovery; it lacks the logic to decide if a position actually requires action.
Efficiency: Every rebalancer fires unconditionally, consuming resources regardless of need.
graph TD
SUP[Supervisor<br/>cron every z min]
AB1[Rebalancer 1<br/>every x min]
AB2[Rebalancer 2<br/>every y min]
ABn[Rebalancer N<br/>...]
P1[Position 1]
P2[Position 2]
Pn[Position N]
SUP -->|fixReschedule| AB1
SUP -->|fixReschedule| AB2
SUP -->|fixReschedule| ABn
AB1 -->|rebalance| P1
AB2 -->|rebalance| P2
ABn -->|rebalance| Pn
Loading
Proposed Solution
Replace $N$ independent rebalancers with a single Coordinator. This central entity inspects all positions and only dispatches a worker for positions that meet the rebalancing criteria.
Problem
Currently, each position has its own$N$ positions, there are $N$ independent scheduled transactions running on their own intervals.
AutoRebalancerscheduled independently. WithKey Issues:
fixReschedule()recovery; it lacks the logic to decide if a position actually requires action.graph TD SUP[Supervisor<br/>cron every z min] AB1[Rebalancer 1<br/>every x min] AB2[Rebalancer 2<br/>every y min] ABn[Rebalancer N<br/>...] P1[Position 1] P2[Position 2] Pn[Position N] SUP -->|fixReschedule| AB1 SUP -->|fixReschedule| AB2 SUP -->|fixReschedule| ABn AB1 -->|rebalance| P1 AB2 -->|rebalance| P2 ABn -->|rebalance| PnProposed Solution
Replace$N$ independent rebalancers with a single Coordinator. This central entity inspects all positions and only dispatches a worker for positions that meet the rebalancing criteria.
graph TD COORD[Coordinator<br/>cron every x min] P1[Position 1] P2[Position 2] Pn[Position N] W1[Worker 1] Wn[Worker N] COORD -->|inspects| P1 COORD -->|inspects| P2 COORD -->|inspects| Pn COORD -.->|dispatch if needed| W1 COORD -.->|dispatch if needed| Wn W1 -->|rebalance| P1 Wn -->|rebalance| Pn