Skip to content

refactor: simplify FlowALPRebalancerPaidv1#298

Open
holyfuchs wants to merge 2 commits intomainfrom
holyfuchs/rebalancer-refactor
Open

refactor: simplify FlowALPRebalancerPaidv1#298
holyfuchs wants to merge 2 commits intomainfrom
holyfuchs/rebalancer-refactor

Conversation

@holyfuchs
Copy link
Copy Markdown
Member

Removes per-rebalancer RecurringConfig storage and the RebalancerPaid handle resource.
All PositionRebalancer instances now read from a single defaultRecurringConfig set by the admin, eliminating per-position config.
createPaidRebalancer is now fire-and-forget (no return value), and removal goes through Admin.removePaidRebalancer.
Focus on simplicity.

@holyfuchs holyfuchs requested a review from a team as a code owner March 27, 2026 14:23
Comment on lines +241 to 248
access(all) fun createPaidRebalancer(positionID: UInt64) {
let rebalancer <- create PositionRebalancer(
positionID: positionID
)
// will panic if the rebalancer already exists
self.storeRebalancer(rebalancer: <-rebalancer, positionID: positionID)
self.setSelfCapability(positionID: positionID).fixReschedule()
emit CreatedRebalancerPaid(positionID: positionID)
return <- create RebalancerPaid(positionID: positionID)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should validate that a FlowALP position with positionID exists

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.

2 participants