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

Pool fee events #1247

Open
kaber2 opened this issue Jan 22, 2025 · 3 comments · May be fixed by #1250
Open

Pool fee events #1247

kaber2 opened this issue Jan 22, 2025 · 3 comments · May be fixed by #1250
Assignees

Comments

@kaber2
Copy link

kaber2 commented Jan 22, 2025

Hello,

I'm a bit puzzled how pool fee events are supposed to work.

In order to properly track pool balances on swap and liquidity events, the aggregate swap fee percentage needs to be known. This is initialized to a default value from the ProtocolFeeController and may be updated later on. Updates to both the default values and the pool specific value emit proper events, so these are not a problem.

However if the pool is created with protocolFeeExempt set, I can't see a way to properly retrieve this information. It is not included in the pool registration event, not can it be retrieved from the protocol fee controller in a reliable fashion. While it does internally store this information in the isOverride flag, this can be changed later on if the fee is updated. The end result is that there is no way to reliably retrieve the fee information for newly created pools unless running an archive node.

I hope I'm missing something here, maybe someone can shed some light on how this is supposed to work, with the goal being able to track pool balances.

@jubeira
Copy link
Contributor

jubeira commented Jan 22, 2025

Hey @kaber2,

Thanks for bringing this up. I believe we still haven't faced this case live, because all pools come from Balancer pools and this was a feature intended for pool creators (which are still not live).

I think that case might not be covered as you point out. If we emitted an event on the fee controller with the initial aggregate swap fee percentage, would that work?

We can't update the vault at this point because it's immutable, so there's no way to add or modify existing events.

/cc @mendesfabio

@EndymionJkb EndymionJkb self-assigned this Jan 22, 2025
@kaber2
Copy link
Author

kaber2 commented Jan 22, 2025

Hey, thanks for the quick response. Yes, I believe that should work fine. Let me have another closer look and I will get back to you with a definite answer tomorrow.

Cheers!

@EndymionJkb EndymionJkb linked a pull request Jan 22, 2025 that will close this issue
12 tasks
@jubeira
Copy link
Contributor

jubeira commented Jan 23, 2025

Hey @kaber2, you can check a possible fix in #1250. We'll get that reviewed and plan on how to proceed, as we'll probably need some migration script.

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 a pull request may close this issue.

3 participants