balancer / balancer-v3-monorepo

GNU General Public License v3.0
37 stars 10 forks source link

Invariant ratio guard rails for pools #814

Closed jubeira closed 1 month ago

jubeira commented 1 month ago

Big unbalanced joins and exits are equivalent to swaps, and pools might need to limit them.

Weighted pool in V2 limits invariant ratio and swap sizes. We need a way to do this in V3 that is pool-specific.

For computeBalance it's kinda trivial since we get the invariant ratio as an argument. For computeInvariant we might need to rework BasePoolMath.

jubeira commented 1 month ago

Closed via #812