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

feat: omnipool fees rework #987

Merged
merged 141 commits into from
Feb 8, 2025
Merged

feat: omnipool fees rework #987

merged 141 commits into from
Feb 8, 2025

Conversation

enthusiastmartin
Copy link
Contributor

@enthusiastmartin enthusiastmartin commented Jan 10, 2025

This PR implements changes to dynamic fee and other omnipool fee adjustments:

  • Multiblock dynamic fee
  • Mint H20 for asset fee
  • Use part of protocol fee to buy HDX or transfer to treasury ( now we transfer, when buyback implemented, it will go there instead)
  • Remove imbalance
  • Rebenchmark

Spec: https://www.notion.so/hydradx/Fee-adjustments-b2447f1f5d294d8d9b4b74e353f3c098

@@ -342,6 +345,7 @@ where
<Runtime as frame_system::Config>::AccountId: From<AccountId>,
<Runtime as pallet_staking::Config>::AssetId: From<AssetId>,
<Runtime as pallet_referrals::Config>::AssetId: From<AssetId>,
MC: MultiCurrency<AccountId, CurrencyId = AssetId, Balance = Balance>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this standard naming we use?

@@ -69,6 +73,17 @@ impl OraclePeriod {
use OraclePeriod::*;
&[Short, TenMinutes, Hour, Day, Week]
}

pub const fn as_period(&self) -> u64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice but... people might be mistaken if they change this, oracle periods will change.. We should probably write test to see if it matches smoothing factors down.

martinfridrich
martinfridrich previously approved these changes Feb 7, 2025
@martinfridrich martinfridrich dismissed their stale review February 7, 2025 11:46

Investigating potential issue

@enthusiastmartin enthusiastmartin merged commit 00c6884 into master Feb 8, 2025
7 checks passed
@enthusiastmartin enthusiastmartin deleted the feat/adjust-dynamic-fee branch February 8, 2025 08:28
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.

Omnipool dynamic fee adjustments
5 participants