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

Asset group #34

Merged
merged 26 commits into from
Oct 24, 2024
Merged

Asset group #34

merged 26 commits into from
Oct 24, 2024

Conversation

iboss-ptk
Copy link
Collaborator

@iboss-ptk iboss-ptk commented Sep 30, 2024

This PR introduce concept of scope for limiter and upcoming rebalancing incentive

scope can be either denom or asset_group which can practically represent source chain or bridge. This is what changed in registering limiter:

{
  "register_limiter": {
-  "denom": "token1",
+  "scope": "denom::token1",
    "label": "1h",
    "limiter_params": {
      "change_limiter": {
        "window_config": {
          "window_size": "3600000000000",
          "division_count": "5"
        },
        "boundary_offset": "0.2"
      }
    }
  }
}

scope can be prefixed with either denom:: or asset_group:: to differentiate the scope variant.

In order to specify an asset_group as scope, it creating new group is requried

{ 
  "create_asset_group": {
    "label": "group0",
    "denom": ["denom0", "denom1"]
  }
}

it can also be removed, and the associated limiters will we removed along with it

{ "remove_asset_group": { "label": "group0" } }

mark_corrupted_assets & unmark_corrupted_assets also changed to mark_corrupted_scopes & unmark_corrupted_scopes

The assets that are within the corrupted scopes will be removed from the pool when the amount reaches 0 as before. The reference to the specific asset that is corrupted and reaches 0 will also be removed from asset_group. Once asset group emptied, it is also automatically removed.

Copy link
Collaborator

@crnbarr93 crnbarr93 left a comment

Choose a reason for hiding this comment

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

Few comments otherwise LGTM!

@iboss-ptk
Copy link
Collaborator Author

nice catches, will fix them!

@iboss-ptk iboss-ptk merged commit 2a3d4cc into main Oct 24, 2024
1 check passed
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