UNPKG

@perk.money/perk-swap-core

Version:

This npm package contains core logic of Perk Aggregator build on top of NEAR blockchain

37 lines (36 loc) 1.09 kB
import JSBI from 'jsbi'; import { Percentage } from '../../utils'; import { Reserves } from './types'; interface GetOutputAmountParams { reserves: Reserves; poolFee: number; inputMint: string; outputMint: string; inputAmount: JSBI; slippage: Percentage; } interface GetInputAmountParams { reserves: Reserves; poolFee: number; inputMint: string; outputMint: string; outputAmount: JSBI; slippage: Percentage; } declare function getOutputAmount({ reserves, poolFee, slippage, inputMint, outputMint, inputAmount, }: GetOutputAmountParams): { amountIn: JSBI; amountOut: JSBI; minAmountOut: JSBI; feeAmount: JSBI; notEnoughLiquidity: boolean; priceImpact: number; }; declare function getInputAmount({ reserves, poolFee, slippage, inputMint, outputMint, outputAmount, }: GetInputAmountParams): { amountIn: JSBI; amountOut: JSBI; minAmountOut: JSBI; feeAmount: JSBI; notEnoughLiquidity: boolean; priceImpact: number; }; export { getOutputAmount, getInputAmount };