import { Route as V3RouteSDK } from "@onyxcoindev/pool-sdk-test"; import { Currency, CurrencyAmount, Percent, Price, TradeType } from "@onyxcoindev/sdk-core-test"; import { TPool } from "../util"; import { IRoute } from "./route"; export declare class Trade { readonly routes: IRoute[]; readonly tradeType: TTradeType; private _outputAmount; private _inputAmount; /** * The swaps of the trade, i.e. which routes and how much is swapped in each that * make up the trade. May consist of swaps in v2 or v3. */ readonly swaps: { route: IRoute; inputAmount: CurrencyAmount; outputAmount: CurrencyAmount; }[]; constructor({ v3Routes, tradeType, }: { v3Routes: { routev3: V3RouteSDK; inputAmount: CurrencyAmount; outputAmount: CurrencyAmount; }[]; tradeType: TTradeType; }); get inputAmount(): CurrencyAmount; get outputAmount(): CurrencyAmount; private _executionPrice; /** * The price expressed in terms of output amount/input amount. */ get executionPrice(): Price; /** * Returns the sell tax of the input token */ get inputTax(): Percent; /** * Returns the buy tax of the output token */ get outputTax(): Percent; /** * The cached result of the price impact computation * @private */ private _priceImpact; /** * Returns the percent difference between the route's mid price and the expected execution price * In order to exclude token taxes from the price impact calculation, the spot price is calculated * using a ratio of values that go into the pools, which are the post-tax input amount and pre-tax output amount. */ get priceImpact(): Percent; /** * Get the minimum amount that must be received from this trade for the given slippage tolerance * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade * @returns The amount out */ minimumAmountOut(slippageTolerance: Percent, amountOut?: CurrencyAmount): CurrencyAmount; /** * Get the maximum amount in that can be spent via this trade for the given slippage tolerance * @param slippageTolerance The tolerance of unfavorable slippage from the execution price of this trade * @returns The amount in */ maximumAmountIn(slippageTolerance: Percent, amountIn?: CurrencyAmount): CurrencyAmount; /** * Return the execution price after accounting for slippage tolerance * @param slippageTolerance the allowed tolerated slippage * @returns The execution price */ worstExecutionPrice(slippageTolerance: Percent): Price; static fromRoutes(v3Routes: { routev3: V3RouteSDK; amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount; }[], tradeType: TTradeType): Promise>; static fromRoute(route: V3RouteSDK, amount: TTradeType extends TradeType.EXACT_INPUT ? CurrencyAmount : CurrencyAmount, tradeType: TTradeType): Promise>; }