Expand description
Common utility functions for Balancer pools
Constants§
- MAX_
UINT256 - Maximum uint256 value
Functions§
- compute_
and_ charge_ aggregate_ swap_ fees - Compute and charge aggregate swap fees
- copy_
to_ scaled18_ apply_ rate_ round_ down_ array - Copy amounts to scaled 18 with rate applied, rounding down
- copy_
to_ scaled18_ apply_ rate_ round_ up_ array - Copy amounts to scaled 18 with rate applied, rounding up
- find_
case_ insensitive_ index_ in_ list - Find case insensitive index in list
- get_
single_ input_ index - Get single input index from amounts
- is_
same_ address - Check if two addresses are the same (case insensitive)
- require_
unbalanced_ liquidity_ enabled - Require unbalanced liquidity to be enabled
- to_
raw_ undo_ rate_ round_ down - Convert scaled 18 amount back to raw amount, rounding down
Reverses the
scalingFactor
andtokenRate
applied toamount
, resulting in a smaller or equal value depending on whether it needed scaling/rate adjustment or not. The result is rounded down. - to_
raw_ undo_ rate_ round_ up - Convert scaled 18 amount back to raw amount, rounding up
Reverses the
scalingFactor
andtokenRate
applied toamount
, resulting in a smaller or equal value depending on whether it needed scaling/rate adjustment or not. The result is rounded up. - to_
scaled_ 18_ apply_ rate_ round_ down - Convert to scaled 18 with rate applied, rounding down
- to_
scaled_ 18_ apply_ rate_ round_ up - Convert to scaled 18 with rate applied, rounding up