Constants§
- AMP_
PRECISION - Amplification precision
- _MAX_
INVARIANT_ RATIO - Invariant shrink limit: non-proportional remove cannot cause the invariant to decrease by less than this ratio.
- _MIN_
INVARIANT_ RATIO - Invariant growth limit: non-proportional add cannot cause the invariant to increase by more than this ratio.
Functions§
- compute_
balance - Compute the balance of a token given the invariant.
- compute_
in_ given_ exact_ out - Compute how many tokens must be sent to a pool to take out
token_amount_out - compute_
invariant - Calculate the invariant for the stable swap curve.
- compute_
out_ given_ exact_ in - Compute how many tokens can be taken out of a pool if
token_amount_inare sent