Skip to content

Commit

Permalink
keep order consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
jmealy committed Apr 30, 2024
1 parent 1879b8e commit b36a93a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/features/swap/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ export const getSurplusPrice = (
>,
): number => {
const { kind, executedSellAmount, sellAmount, sellToken, executedBuyAmount, buyAmount, buyToken } = order
if (kind === OrderKind.SELL) {
return asDecimal(BigInt(executedBuyAmount), buyToken.decimals) - asDecimal(BigInt(buyAmount), buyToken.decimals)
} else if (kind === OrderKind.BUY) {
if (kind === OrderKind.BUY) {
return asDecimal(BigInt(sellAmount), sellToken.decimals) - asDecimal(BigInt(executedSellAmount), sellToken.decimals)
} else if (kind === OrderKind.SELL) {
return asDecimal(BigInt(executedBuyAmount), buyToken.decimals) - asDecimal(BigInt(buyAmount), buyToken.decimals)
} else {
return 0
}
Expand Down

0 comments on commit b36a93a

Please sign in to comment.