@interlay/interbtc-api / Exports / Trade
• new Trade(path
, inputAmount
, outputAmount
): Trade
Name | Type |
---|---|
path |
MultiPath |
inputAmount |
MonetaryAmount <CurrencyExt > |
outputAmount |
MonetaryAmount <CurrencyExt > |
src/parachain/amm/trade/trade.ts:11
• executionPrice: MonetaryAmount
<CurrencyExt
>
src/parachain/amm/trade/trade.ts:9
• inputAmount: MonetaryAmount
<CurrencyExt
>
src/parachain/amm/trade/trade.ts:13
• outputAmount: MonetaryAmount
<CurrencyExt
>
src/parachain/amm/trade/trade.ts:14
• path: MultiPath
src/parachain/amm/trade/trade.ts:12
• priceImpact: Big
src/parachain/amm/trade/trade.ts:10
▸ getMinimumOutputAmount(maxSlippage
): MonetaryAmount
<CurrencyExt
>
Get minimum output amount for trade with provided maximum allowed slippage.
Name | Type | Description |
---|---|---|
maxSlippage |
number |
Maximum slippage in percentage. |
MonetaryAmount
<CurrencyExt
>
Minimum output amount of trade allowed with provided slippage.
src/parachain/amm/trade/trade.ts:52
▸ isBetter(anotherTrade
): boolean
Comparator for 2 trades with same input and output.
Name | Type | Description |
---|---|---|
anotherTrade |
null | Trade |
Trade to compare. |
boolean
true if this
trade is better, false if anotherTrade
is better.
Throws
When provided trade has different input or output currency.