-
Notifications
You must be signed in to change notification settings - Fork 13
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
Roundrip fee on proportional remove #1010
Open
jubeira
wants to merge
8
commits into
main
Choose a base branch
from
pump-dump-fee
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+240
−111
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
998733b
Roundrip fee on proportional remove.
b422a51
Merge branch 'main' into pump-dump-fee
cefcefa
Merge branch 'main' into pump-dump-fee
279ec36
Charge swap fees, tests.
6b631a9
Lint.
6320f88
Avoid roundtrip fee in liquidity approximation tests to keep testing …
5d1b298
Fix remaining roundtrip assumptions.
3c67514
Merge branch 'main' into pump-dump-fee
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...ots/[WeightedPool - ERC4626 - BatchRouter] swapExactIn - no buffer liquidity - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
299.4k | ||
299.5k |
2 changes: 1 addition & 1 deletion
2
...s/[WeightedPool - ERC4626 - BatchRouter] swapExactIn - with buffer liquidity - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
234.5k | ||
234.7k |
2 changes: 1 addition & 1 deletion
2
...ts/[WeightedPool - ERC4626 - BatchRouter] swapExactOut - no buffer liquidity - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
329.7k | ||
329.9k |
2 changes: 1 addition & 1 deletion
2
.../[WeightedPool - ERC4626 - BatchRouter] swapExactOut - with buffer liquidity - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
256.0k | ||
256.1k |
2 changes: 1 addition & 1 deletion
2
...tedPool - Standard - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
208.2k | ||
208.6k |
2 changes: 1 addition & 1 deletion
2
...ots/[WeightedPool - Standard - BatchRouter] add liquidity using swapExactOur - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
185.8k | ||
186.1k |
2 changes: 1 addition & 1 deletion
2
...s/[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactIn - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
200.8k | ||
200.9k |
2 changes: 1 addition & 1 deletion
2
.../[WeightedPool - Standard - BatchRouter] remove liquidity using swapExactOut - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
233.5k | ||
233.6k |
2 changes: 1 addition & 1 deletion
2
...WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - cold slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
184.9k | ||
185.0k |
2 changes: 1 addition & 1 deletion
2
...WeightedPool - Standard - BatchRouter] swap exact in with one token and fees - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
167.8k | ||
167.9k |
2 changes: 1 addition & 1 deletion
2
...weighted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity proportional
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
179.5k | ||
179.8k |
2 changes: 1 addition & 1 deletion
2
...hat-snapshots/[WeightedPool - Standard] add liquidity single token exact out - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
179.2k | ||
179.5k |
2 changes: 1 addition & 1 deletion
2
...st/gas/.hardhat-snapshots/[WeightedPool - Standard] add liquidity unbalanced - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
212.8k | ||
213.2k |
2 changes: 1 addition & 1 deletion
2
...ghted/test/gas/.hardhat-snapshots/[WeightedPool - Standard] remove liquidity proportional
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
168.0k | ||
168.2k |
2 changes: 1 addition & 1 deletion
2
...edPool - With rate - BatchRouter] add liquidity unbalanced using swapExactIn - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
230.0k | ||
230.4k |
2 changes: 1 addition & 1 deletion
2
...ts/[WeightedPool - With rate - BatchRouter] add liquidity using swapExactOur - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
207.5k | ||
207.9k |
2 changes: 1 addition & 1 deletion
2
.../[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactIn - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
222.3k | ||
222.4k |
2 changes: 1 addition & 1 deletion
2
...[WeightedPool - With rate - BatchRouter] remove liquidity using swapExactOut - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
255.0k | ||
255.1k |
2 changes: 1 addition & 1 deletion
2
...eightedPool - With rate - BatchRouter] swap exact in with one token and fees - cold slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
218.2k | ||
218.4k |
2 changes: 1 addition & 1 deletion
2
...eightedPool - With rate - BatchRouter] swap exact in with one token and fees - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
184.0k | ||
184.2k |
2 changes: 1 addition & 1 deletion
2
...eighted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity proportional
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
234.9k | ||
235.2k |
2 changes: 1 addition & 1 deletion
2
...at-snapshots/[WeightedPool - With rate] add liquidity single token exact out - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
198.4k | ||
198.8k |
2 changes: 1 addition & 1 deletion
2
...t/gas/.hardhat-snapshots/[WeightedPool - With rate] add liquidity unbalanced - warm slots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
229.6k | ||
229.9k |
2 changes: 1 addition & 1 deletion
2
...hted/test/gas/.hardhat-snapshots/[WeightedPool - With rate] remove liquidity proportional
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
223.2k | ||
223.4k |
2 changes: 1 addition & 1 deletion
2
pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] donation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
178.3k | ||
178.6k |
2 changes: 1 addition & 1 deletion
2
pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize with ETH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
348.8k | ||
348.9k |
2 changes: 1 addition & 1 deletion
2
pkg/pool-weighted/test/gas/.hardhat-snapshots/[WeightedPool] initialize without ETH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
336.3k | ||
336.4k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Bytecode 23.066 | ||
InitCode 24.407 | ||
Bytecode 23.280 | ||
InitCode 24.688 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Bytecode 13.824 | ||
InitCode 14.847 | ||
InitCode 14.903 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Bytecode 19.159 | ||
InitCode 20.242 | ||
InitCode 20.302 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note: if we clear this flag here, it's easy to bypass.
You add a huge amount, make a decoy proportional exit, and then a big exit.
Whenever the flag is set, it'll be set for the rest of the tx. A more correct approach would be to clean it when
transient
modifier ends, but we would need a transient set for that and I really don't think it's worth the added complexity.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.
Agree that's probably not worth it for an edge case. Although... maybe aggregators might bundle lots of transactions and come across that, since it just checks the pool, not the pool + user, so this could also get triggered on bundled transactions with multiple unrelated users doing liquidity operations on a popular pool. Maybe worth investigating if that's possible? If one person added and another person removed, the second one would get unexpectedly taxed.
Though even storing the user wouldn't be foolproof, as someone could craft a transaction where the add and remove steps were done from separate addresses controlled by the same account.