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

Dynamic fee tweaks #194

Merged
merged 194 commits into from
Feb 7, 2025
Merged

Dynamic fee tweaks #194

merged 194 commits into from
Feb 7, 2025

Conversation

jepidoptera
Copy link
Contributor

implementing changes to the dynamic fee spec

Copy link
Collaborator

@poliwop poliwop left a comment

Choose a reason for hiding this comment

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

Overall looks good, only minor changes needed. We do need to make sure we are updating dynamic fees on add/remove liquidity. See comments for other change requests.

requirements.txt Outdated Show resolved Hide resolved
hydradx/model/amm/omnipool_amm.py Outdated Show resolved Hide resolved
hydradx/model/amm/omnipool_amm.py Outdated Show resolved Hide resolved
hydradx/model/amm/omnipool_amm.py Outdated Show resolved Hide resolved
hydradx/model/amm/omnipool_amm.py Show resolved Hide resolved
hydradx/notebooks/Omnipool/TestLpFeeDeposit.ipynb Outdated Show resolved Hide resolved
unique_id: str = 'omnipool'
lrna_mint_pct: float = 1.0,
unique_id: str = 'omnipool',
lrna_fee_burn: float = 1.0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Default lrna_fee_burn should be 0.5, since that's what we're doing in PROD. Eventually though we should replace this with parameter sets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need lrna_mint_pct to be 1.0 and lrna_fee_burn = 0.5

hydradx/tests/test_omnipool_amm.py Outdated Show resolved Hide resolved
hydradx/tests/test_omnipool_amm.py Outdated Show resolved Hide resolved
hydradx/other tests/test_exploits.py Outdated Show resolved Hide resolved
@jepidoptera jepidoptera requested a review from poliwop February 6, 2025 16:37
Copy link
Collaborator

@poliwop poliwop left a comment

Choose a reason for hiding this comment

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

Mostly fine, I think the default parameter fix for Omnipool was not quite correct. I would also extend the multi-block test to include num_blocks=0 if possible? I think that should work?

unique_id: str = 'omnipool'
lrna_mint_pct: float = 1.0,
unique_id: str = 'omnipool',
lrna_fee_burn: float = 1.0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need lrna_mint_pct to be 1.0 and lrna_fee_burn = 0.5

liquidity={tkn: self.liquidity[tkn] for tkn in self.liquidity},
net_volume=get_last_volume()
)
else: # value is a number
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't find this particular comment clarification very helpful... I think you do have the type hints in the function signature so maybe that's enough.

@@ -1375,6 +1317,62 @@ def test_dynamic_fees(hdx_price: float):
raise AssertionError('LRNA fee should decrease with time.')


@given(num_blocks = st.integers(min_value=1, max_value=1000))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this also worth with num_blocks=0? i.e., second transaction in the same block? Can we include this in the test?

@jepidoptera jepidoptera requested a review from poliwop February 7, 2025 16:57
Copy link
Collaborator

@poliwop poliwop left a comment

Choose a reason for hiding this comment

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

Looks good.

@poliwop poliwop merged commit f092878 into main Feb 7, 2025
4 checks passed
@poliwop poliwop deleted the dynamic_fee_tweaks branch February 7, 2025 21:10
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