UNPKG

@alcorexchange/alcor-swap-sdk

Version:

## Installation ​​ **npm** ``` npm i @alcorexchange/alcor-swap-sdk ``` **yarn** ``` yarn add @alcorexchange/alcor-swap-sdk ``` ## Usage ### Import:

18 lines (15 loc) 393 B
import JSBI from "jsbi"; import { NEGATIVE_ONE, ZERO } from "../internalConstants"; export abstract class LiquidityMath { /** * Cannot be constructed. */ private constructor() {} public static addDelta(x: JSBI, y: JSBI): JSBI { if (JSBI.lessThan(y, ZERO)) { return JSBI.subtract(x, JSBI.multiply(y, NEGATIVE_ONE)); } else { return JSBI.add(x, y); } } }