Skip to content
This repository has been archived by the owner on Apr 28, 2023. It is now read-only.

Commit

Permalink
fix: fee for sell orders (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Apr 4, 2019
1 parent 456af75 commit 652c529
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/swaptab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,12 @@ class SwapTab extends React.Component {
};

updateQuoteAmount = baseAmount => {
const { rate } = this.state.rate;
const fee = this.calculateFee(baseAmount);
const { rate, orderSide } = this.state.rate;
let fee = this.calculateFee(baseAmount);

if (orderSide === 'sell') {
fee = fee * rate;
}

const quote = Number((baseAmount * rate - fee).toFixed(8));

Expand Down

0 comments on commit 652c529

Please sign in to comment.