Skip to content

Commit

Permalink
fix(Swap): scaleDown short token balance in swap
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdt committed Mar 20, 2021
1 parent ad0bc43 commit bea33d7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/components/Market/OrderCard/components/Swap/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,7 @@ const Swap: React.FC = () => {

const scaledShortToken: TokenAmount = new TokenAmount(
shortTokenAmount.token,
BigNumber.from(shortTokenAmount.raw.toString())
.mul(
entity.isPut
? entity.baseValue.raw.toString()
: entity.quoteValue.raw.toString()
)
.div(entity.baseValue.raw.toString())
.toString()
scaleDown(BigNumber.from(shortTokenAmount.raw.toString())).toString()
)

// if a short or close short order is submitted, use the router to swap between short<>underlying
Expand Down

0 comments on commit bea33d7

Please sign in to comment.