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

Arbitrage tx mempool filter #741

Merged
merged 4 commits into from
Jan 12, 2022
Merged

Arbitrage tx mempool filter #741

merged 4 commits into from
Jan 12, 2022

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Jan 9, 2022

Closes: #723

Description

This PR adds a mempool filter for arbitrage txs. When its hit, it charges a separate gas price, as specified in the full nodes application config. This defaults to 0 uosmo if not set in the app.toml, but the app.toml defaults to .005uosmo/gas.

The detection algorithm for arbitrage txs does have some false positives, and likely many false negatives. The false positives are described in the code comments, and I think are pretty miniscule. (Only thing I can see hitting it is a service that batches many users swap / LP positions together. Such a batching service seems like it can maintain connections to folks with lower fees though)


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@ValarDragon ValarDragon requested review from sunnya97 and faddat January 9, 2022 07:41
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2022

Codecov Report

Merging #741 (3f7aeb5) into main (bc65a83) will decrease coverage by 0.00%.
The diff coverage is 22.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #741      +/-   ##
==========================================
- Coverage   18.73%   18.72%   -0.01%     
==========================================
  Files         172      174       +2     
  Lines       23908    23932      +24     
==========================================
+ Hits         4478     4481       +3     
- Misses      18655    18675      +20     
- Partials      775      776       +1     
Impacted Files Coverage Δ
x/gamm/types/msg_lp.go 0.00% <0.00%> (ø)
x/gamm/types/msg_swap.go 0.00% <0.00%> (ø)
x/txfees/keeper/feedecorator.go 72.09% <75.00%> (-1.60%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc65a83...3f7aeb5. Read the comment docs.

Copy link
Member

@UnityChaos UnityChaos left a comment

Choose a reason for hiding this comment

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

tested in production (as is known to be best practice)
:shipit:

@ValarDragon ValarDragon merged commit 13531e5 into main Jan 12, 2022
@ValarDragon ValarDragon deleted the dev/arb_mempool_filter branch January 12, 2022 01:43
ValarDragon added a commit that referenced this pull request Jan 13, 2022
* Add Arb checktx filter, to raise gas

* Add config params for min fee for arbitrage tx

* Small improvements, add changelog

* Fix bug in swap_msg logic
@github-actions github-actions bot mentioned this pull request Mar 15, 2024
@github-actions github-actions bot mentioned this pull request May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

x/txfees: Make an ante-handler filter for recognizing Gamm arb txs, and charging a flat fee for them
3 participants