Skip to content

Commit

Permalink
Merge pull request #538 from invariant-labs/fix-min-range
Browse files Browse the repository at this point in the history
Fix concentration calculations
  • Loading branch information
awojciak authored Nov 27, 2023
2 parents 48b7fc1 + 21571ab commit 15ac9d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/NewPosition/RangeSelector/RangeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const RangeSelector: React.FC<IRangeSelector> = ({
const { leftRange, rightRange } = calculateConcentrationRange(
tickSpacing,
concentrationArray[0],
1,
2,
midPrice.index,
isXtoY
)
Expand Down Expand Up @@ -257,7 +257,7 @@ export const RangeSelector: React.FC<IRangeSelector> = ({
}

const concentrationArray = useMemo(
() => getConcentrationArray(tickSpacing, 1, midPrice.index).sort((a, b) => a - b),
() => getConcentrationArray(tickSpacing, 2, midPrice.index).sort((a, b) => a - b),
[tickSpacing, midPrice.index]
)

Expand All @@ -268,7 +268,7 @@ export const RangeSelector: React.FC<IRangeSelector> = ({
const { leftRange, rightRange } = calculateConcentrationRange(
tickSpacing,
concentrationArray[0],
1,
2,
midPrice.index,
isXtoY
)
Expand All @@ -288,7 +288,7 @@ export const RangeSelector: React.FC<IRangeSelector> = ({
const { leftRange, rightRange } = calculateConcentrationRange(
tickSpacing,
concentrationArray[index],
1,
2,
midPrice.index,
isXtoY
)
Expand Down Expand Up @@ -470,7 +470,7 @@ export const RangeSelector: React.FC<IRangeSelector> = ({
const { leftRange, rightRange } = calculateConcentrationRange(
tickSpacing,
concentrationArray[value],
1,
2,
midPrice.index,
isXtoY
)
Expand Down

0 comments on commit 15ac9d8

Please sign in to comment.