Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VS Incentives] upgrade handler logic for updating linked CL & balancer incentives mechanism #6603

Closed
Tracked by #6057
p0mvn opened this issue Sep 29, 2023 · 1 comment · Fixed by #6608 or #6610
Closed
Tracked by #6057
Assignees
Labels
F: volume-splitting feat: Volume-splitting incentives

Comments

@p0mvn
Copy link
Member

p0mvn commented Sep 29, 2023

Background

Our current mechanism for incentivizing pairs of the same denom first directs incentives to CL gauges. Then, CL module retroactively pipes the eligible amounts to balancer based on its liquidity relative to CL.

On main, we already removed the retroactive mechanism from CL module. However, on-chain CL gauges continue to receive all rewards a denom pair is entitled to.

We should update all distribution records to detect CL gauges and associate Group gauges in their place.

Suggested Design

High-Level Upgrade Handler Logic

In v20 upgrade handler, retrieve all DistrRecords.

Retrieve all migration records from x/gamm module

Iterate over all DistrRecords. Read gauge and its type. If NoLock gauge, see if a CL pool with the same ID is present in the migration records. If so, create a Group with that migration record's CL and balancer pool.

Group Creation Changes

Our Groups sync weights during creation. Synching fails whenever there is no volume present in the x/poolmanager module. Since we are just adding the logic for tracking volume today, their volume trackers will be empty. As a result, no Group cannot be created.

We should expose a new method meant to be used internally (e.g. in upgrade handler)

  • Make a CreateGroupNoSync - can only be called by the incentives module account
  • Refactor CreateGroup to call CreateGroupNoSync and then sync
  • In the upgrade handler, we call CreateGroupNoSync

This will initialize groups with zero volume. The volume will be accumulated until the next epoch. At the first epoch, we will use the volume since the upgrade time for determining the incentives split.

Acceptance Criteria

  • implement CreateGroupNoSync helper in a separate PR & test it
  • implement upgrade handler logic in a separate PR and test it
@p0mvn
Copy link
Member Author

p0mvn commented Oct 1, 2023

Only partially addressed - reopened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment