Skip to main content

Interface: QuoteAmountsAndCosts<AmountType, Amounts>

CoW Protocol quote has amounts (sell/buy) and costs (network fee), there is also partner fees. Besides that, CoW Protocol supports both sell and buy orders and the fees and costs are calculated differently.

The order of adding fees and costs is as follows:

  1. Network fee is always added to the sell amount
  2. Partner fee is added to the surplus amount (sell amount for sell-orders, buy amount for buy-orders)

For sell-orders the partner fee is subtracted from the buy amount after network costs. For buy-orders the partner fee is added on top of the sell amount after network costs.

Type parameters

NameType
AmountTypebigint
Amounts{ buyAmount: AmountType ; sellAmount: AmountType }

Properties

afterNetworkCosts

afterNetworkCosts: Amounts

Defined in

external/cow-sdk/src/order-book/types.ts:42


afterPartnerFees

afterPartnerFees: Amounts

Defined in

external/cow-sdk/src/order-book/types.ts:43


afterSlippage

afterSlippage: Amounts

Defined in

external/cow-sdk/src/order-book/types.ts:44


beforeNetworkCosts

beforeNetworkCosts: Amounts

Defined in

external/cow-sdk/src/order-book/types.ts:41


costs

costs: Object

Type declaration

NameType
networkFee{ amountInBuyCurrency: AmountType ; amountInSellCurrency: AmountType }
networkFee.amountInBuyCurrencyAmountType
networkFee.amountInSellCurrencyAmountType
partnerFee{ amount: AmountType ; bps: number }
partnerFee.amountAmountType
partnerFee.bpsnumber

Defined in

external/cow-sdk/src/order-book/types.ts:30


isSell

isSell: boolean

Defined in

external/cow-sdk/src/order-book/types.ts:28