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

fix(amm): fix swap fee double payment #869

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

cosmic-vagabond
Copy link
Contributor

Description

What has Changed?

Swap fee was getting paid twice by the user, once with tokenIn/tokenOut amount swap fee amount substraction and then once gain from user address (recipient) to rebalance treasury address.

Now the swap fee payment only occurs from pool address to the rebalance treasury address as both tokenIn and tokenOut amounts are available in the pool addr.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Deployment Notes

Are there any specific considerations to take into account when deploying these changes? This may include new dependencies, scripts that need to be executed, or any aspects that can only be evaluated in a deployed environment.

Screenshots and Videos

Please provide any relevant before and after screenshots by uploading them here. Additionally, demo videos can be highly beneficial in demonstrating the process.

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.22%. Comparing base (578cd47) to head (cc89477).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #869      +/-   ##
==========================================
- Coverage   43.50%   34.22%   -9.28%     
==========================================
  Files         675     1105     +430     
  Lines       23496    42924   +19428     
==========================================
+ Hits        10221    14691    +4470     
- Misses      12036    26734   +14698     
- Partials     1239     1499     +260     
Components Coverage Δ
leveragelp_transactions 92.30% <ø> (-0.73%) ⬇️
leveragelp_lifecycle 82.72% <ø> (-2.06%) ⬇️
leveragelp_keeper 87.62% <ø> (+1.04%) ⬆️
leveragelp_queries 7.64% <ø> (-17.48%) ⬇️
accountedpool_transactions 100.00% <ø> (ø)
accountedpool_lifecycle ∅ <ø> (∅)
accountedpool_queries 54.47% <ø> (-13.95%) ⬇️
amm_transactions 55.68% <ø> (-3.16%) ⬇️
amm_lifecycle 77.33% <ø> (-1.84%) ⬇️
amm_keeper 58.75% <100.00%> (-1.87%) ⬇️
amm_queries 20.18% <ø> (-9.77%) ⬇️
assetprofile_transactions 76.85% <ø> (-1.98%) ⬇️
assetprofile_lifecycle ∅ <ø> (∅)
assetprofile_keeper 86.66% <ø> (+3.33%) ⬆️
assetprofile_queries 37.18% <ø> (-10.23%) ⬇️
burner_transactions 0.00% <ø> (ø)
burner_lifecycle ∅ <ø> (∅)
burner_keeper 100.00% <ø> (ø)
burner_queries 50.31% <ø> (-13.23%) ⬇️
clock_transactions 30.76% <ø> (+0.76%) ⬆️
clock_lifecycle ∅ <ø> (∅)
clock_keeper 78.12% <ø> (+1.20%) ⬆️
clock_queries 0.00% <ø> (∅)
commitment_transactions 47.65% <ø> (-1.19%) ⬇️
commitment_lifecycle ∅ <ø> (∅)
commitment_keeper 20.16% <ø> (+0.56%) ⬆️
commitment_queries 2.51% <ø> (-6.82%) ⬇️
epochs_transactions ∅ <ø> (∅)
epochs_lifecycle 100.00% <ø> (ø)
epochs_keeper 84.61% <ø> (+2.79%) ⬆️
epochs_queries 22.72% <ø> (-62.99%) ⬇️
estaking_transactions 45.34% <ø> (-3.30%) ⬇️
estaking_lifecycle 76.14% <ø> (+2.90%) ⬆️
estaking_keeper 63.05% <ø> (+<0.01%) ⬆️
estaking_queries 23.70% <ø> (-31.62%) ⬇️
incentive_transactions 0.00% <ø> (ø)
incentive_lifecycle ∅ <ø> (∅)
incentive_keeper 0.00% <ø> (ø)
incentive_queries 0.00% <ø> (∅)
masterchef_transactions 61.71% <ø> (-3.08%) ⬇️
masterchef_lifecycle 73.21% <ø> (+1.86%) ⬆️
masterchef_keeper 90.47% <ø> (+0.47%) ⬆️
masterchef_queries 12.80% <ø> (-33.18%) ⬇️
oracle_transactions 28.44% <ø> (-3.47%) ⬇️
oracle_lifecycle 0.00% <ø> (ø)
oracle_keeper 65.85% <ø> (+1.96%) ⬆️
oracle_queries 10.19% <ø> (-24.72%) ⬇️
parameter_transactions 15.04% <ø> (-0.08%) ⬇️
parameter_lifecycle ∅ <ø> (∅)
parameter_keeper 77.77% <ø> (+2.77%) ⬆️
parameter_queries 8.16% <ø> (-51.84%) ⬇️
stablestake_transactions 72.80% <ø> (-3.80%) ⬇️
stablestake_lifecycle 78.94% <ø> (+2.02%) ⬆️
stablestake_keeper 76.00% <ø> (+4.57%) ⬆️
stablestake_queries 3.66% <ø> (-9.38%) ⬇️
tier_transactions 25.00% <ø> (-3.58%) ⬇️
tier_lifecycle 100.00% <ø> (ø)
tier_keeper 91.66% <ø> (+1.19%) ⬆️
tier_queries 6.15% <ø> (-14.18%) ⬇️
tokenomics_transactions 71.87% <ø> (-0.45%) ⬇️
tokenomics_lifecycle ∅ <ø> (∅)
tokenomics_keeper 86.66% <ø> (+3.33%) ⬆️
tokenomics_queries 56.12% <ø> (-14.84%) ⬇️
transferhook_transactions ∅ <ø> (∅)
transferhook_lifecycle ∅ <ø> (∅)
transferhook_keeper 100.00% <ø> (ø)
transferhook_queries 8.69% <ø> (-51.31%) ⬇️
tradeshield_transactions 1.19% <ø> (-0.52%) ⬇️
tradeshield_lifecycle ∅ <ø> (∅)
tradeshield_keeper 79.48% <ø> (+2.56%) ⬆️
tradeshield_queries 7.10% <ø> (-0.38%) ⬇️

@cosmic-vagabond cosmic-vagabond merged commit 4ff3f7f into main Oct 18, 2024
51 of 73 checks passed
@cosmic-vagabond cosmic-vagabond deleted the fix/swap-fee-double-payment branch October 18, 2024 11:22
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