-
Notifications
You must be signed in to change notification settings - Fork 608
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
x/gamm: Add fixed gas cost for swaps #2016
Changes from 1 commit
557fac4
88e6112
4bdfc68
44abd66
7eed0c3
5190924
df0f26b
5ea427f
29ad32a
3cbb9dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ const ( | |
// Raise 10 to the power of SigFigsExponent to determine number of significant figures. | ||
// i.e. SigFigExponent = 8 is 10^8 which is 100000000. This gives 8 significant figures. | ||
SigFigsExponent = 8 | ||
// TODO: Current fixed cost gas fee per swap -- turn this into a param in the future. | ||
rrrliu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
GasFeeForSwap = 10000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason to not directly just make this a param? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We decided to make it a fixed cost for now to avoid needing to set up migration code for a change this small (#1903 (comment)) |
||
) | ||
|
||
var ( | ||
|
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.
It feels safer to move the gas consumption to the top-most level of abstraction, i.e the
msg
handler for swapping.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 it should be in each core loop here right, so that we scale by number of hops in a multi-hop?
(Also needs to be in swapExactAmountOut)
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 guess really it should probably be defined per pool type
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.
Thoughts on applying it right here: https://github.com/osmosis-labs/osmosis/blob/main/x/gamm/pool-models/balancer/pool.go#L585-L599 ?
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.
That way we have it per Balancer swap, rather than per total swap. (And can then later charge a different gas amount for stableswap / next CFMM)
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.
Yeah that makes sense, just updated! Should we update balancer pool docs with this or should we wait until it becomes a param?