@cowprotocol/cow-sdk
Advanced tools
Comparing version 5.3.0 to 5.3.1-RC.0
@@ -8,1 +8,33 @@ import { Order } from './generated'; | ||
} | ||
/** | ||
* 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. | ||
*/ | ||
export interface QuoteAmountsAndCosts<Amounts = { | ||
sellAmount: bigint; | ||
buyAmount: bigint; | ||
}> { | ||
isSell: boolean; | ||
quotePrice: number; | ||
costs: { | ||
networkFee: { | ||
amountInSellCurrency: bigint; | ||
amountInBuyCurrency: bigint; | ||
}; | ||
partnerFee: { | ||
amount: bigint; | ||
bps: number; | ||
}; | ||
}; | ||
beforeNetworkCosts: Amounts; | ||
afterNetworkCosts: Amounts; | ||
afterPartnerFees: Amounts; | ||
afterSlippage: Amounts; | ||
} |
{ | ||
"name": "@cowprotocol/cow-sdk", | ||
"version": "5.3.0", | ||
"version": "5.3.1-RC.0", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -103,2 +103,2 @@ "files": [ | ||
] | ||
} | ||
} |
{ | ||
"name": "@cowprotocol/cow-sdk", | ||
"version": "5.3.0", | ||
"version": "5.3.1-RC.0", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -103,2 +103,2 @@ "files": [ | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1092727
115
8402
4