Module utils

Module utils 

Source
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 and tokenRate applied to amount, 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 and tokenRate applied to amount, 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