Structs§
Enums§
Constants§
- AMOUNT_
EXCEEDS_ MAX_ U32 - AMOUNT_
EXCEEDS_ MAX_ U64 - AMOUNT_
EXCEEDS_ MAX_ U128 - ARITHMETIC_
OVERFLOW - INVALID_
ORACLE_ DATA - PER_
M_ DENOMINATOR
Functions§
- a_to_b
- Convert an amount in token A to an amount in token B
- amount_
to_ ui_ amount - b_to_a
- Convert an amount in token B to an amount in token A
- from_
q64_ 64 - Convert a Q64.64 price into a floating point price IMPORTANT: floating point operations can reduce the precision of the result. Make sure to do these operations last and not to use the result for further calculations.
- inverse_
q64_ 64 - Invert a Q64.64 price from A/B to B/A
- quote_
exact_ in - quote_
exact_ out - to_
q64_ 64 - Convert a floating point price into a Q64.64 price IMPORTANT: floating point operations can reduce the precision of the result. Make sure to do these operations last and not to use the result for further calculations.
- ui_
amount_ to_ amount