Skip to content

Commit

Permalink
feat(buy): added some comments to make life easier
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-bc authored and schnogz committed May 27, 2021
1 parent 54f7287 commit 14d01fa
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const getMaxMin = (
let limitMaxChanged = false
if (limits?.maxOrder) {
const buyMaxItem = Number(limitMaxAmount)
// 1000.00 => 100000 since all other amounts are in base we do convert this in base
const maxOrderBase = convertBaseToStandard('FIAT', limits.maxOrder, false)

const baseMaxLimitAmount = Number(maxOrderBase)
Expand All @@ -158,6 +159,8 @@ export const getMaxMin = (
: convertBaseToStandard('FIAT', pair.buyMax)
}

// we have to convert in case that this ammount is from maxOrder
// we have to convert it to Standard since defaultMax is in standard format
const defaultMaxCompare = limitMaxChanged
? Number(convertBaseToStandard('FIAT', limitMaxAmount))
: limitMaxAmount
Expand Down

0 comments on commit 14d01fa

Please sign in to comment.