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

Reduce taker fee param loading #7259

Merged
merged 3 commits into from
Jan 7, 2024
Merged

Conversation

ValarDragon
Copy link
Member

Currently chargeTakerFee is expensively loading all the pool manager params. This lowers what it loads to be the minimum amount (which may still be too large in general) but should lower costs a bit.

This reduces gas costs by at least 10k gas per swap, potentially more.

What is the purpose of the change

Speedup chargeTakerFee which is too gas expensive and CPU intense. We need to further revisit this later, though these terms may be less bad after the fee tracker changes. (This, plus the fee tracker changes has the potential to 5x reduce this overhead. Not expecting it to be that good though, and still think this needs rethinking)

Testing and Verifying

This should be covered by existing tests

Copy link
Member

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

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

LGTM

@czarcas7ic czarcas7ic merged commit a2e7601 into main Jan 7, 2024
1 check passed
@czarcas7ic czarcas7ic deleted the dev/reduce_taker_fee_param_loading branch January 7, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/poolmanager V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants