@melonproject/token-math
Version:
A small helper library to do precision safe calculations
13 lines (12 loc) • 398 B
TypeScript
import PriceInterface from "./PriceInterface";
/**
* Takes a price and normalizes it:
* Brings the base quantity to 1.0 and changes the quote value accordingly.
*
* Warning: This is a destructive operation (?).
*
* Example: For a token with 4 decimals the normalized base quantity is:
* 10000
*/
declare const normalize: (price: PriceInterface) => PriceInterface;
export default normalize;