Skip to main content

Type alias: SwapAmount

SwapAmount = { amountInMaximum?: undefined; amountOutMinimum?: NumericAmount; exactIn: NumericAmount; exactOut?: undefined; priceLimit?: NumericAmount; } | { amountInMaximum?: NumericAmount; amountOutMinimum?: undefined; exactIn?: undefined; exactOut: NumericAmount; priceLimit?: NumericAmount; }

What a swap trades: exactly one of exactIn (sell this much of the input token) or exactOut (receive this much of the output token), with that side's slippage bound and an optional sqrt-price limit.

Union Members​

Type Literal​

{ amountInMaximum?: undefined; amountOutMinimum?: NumericAmount; exactIn: NumericAmount; exactOut?: undefined; priceLimit?: NumericAmount; }

NameTypeDescription
amountInMaximum?undefined-
amountOutMinimum?NumericAmount-
exactInNumericAmount-
exactOut?undefined-
priceLimit?NumericAmountSqrt-price limit passed through to the chain as priceLimit; omitted when undefined.

Type Literal​

{ amountInMaximum?: NumericAmount; amountOutMinimum?: undefined; exactIn?: undefined; exactOut: NumericAmount; priceLimit?: NumericAmount; }

NameTypeDescription
amountInMaximum?NumericAmount-
amountOutMinimum?undefined-
exactIn?undefined-
exactOutNumericAmount-
priceLimit?NumericAmountSqrt-price limit passed through to the chain as priceLimit; omitted when undefined.