UNPKG

@polycity/sdk

Version:

🛠 An SDK for building applications on top of PolyCityDex Protocol.

12 lines (11 loc) • 679 B
import { Currency } from '../entities/Currency'; import { CurrencyAmount } from '../entities/CurrencyAmount'; import { Percent } from '../entities/Percent'; import { Price } from '../entities/Price'; /** * Returns the percent difference between the mid price and the execution price, i.e. price impact. * @param midPrice mid price before the trade * @param inputAmount the input amount of the trade * @param outputAmount the output amount of the trade */ export declare function computePriceImpact<TBase extends Currency, TQuote extends Currency>(midPrice: Price<TBase, TQuote>, inputAmount: CurrencyAmount<TBase>, outputAmount: CurrencyAmount<TQuote>): Percent;