-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dynamic fee tweaks #194
Conversation
…_fee_tweaks # Conflicts: # hydradx/tests/test_omnipool_amm.py
There was a problem hiding this 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.
hydradx/model/amm/omnipool_amm.py
Outdated
unique_id: str = 'omnipool' | ||
lrna_mint_pct: float = 1.0, | ||
unique_id: str = 'omnipool', | ||
lrna_fee_burn: float = 1.0, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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
There was a problem hiding this 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?
hydradx/model/amm/omnipool_amm.py
Outdated
unique_id: str = 'omnipool' | ||
lrna_mint_pct: float = 1.0, | ||
unique_id: str = 'omnipool', | ||
lrna_fee_burn: float = 1.0, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
hydradx/tests/test_omnipool_amm.py
Outdated
@@ -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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
implementing changes to the dynamic fee spec