Skip to content

Commit a28edb1

Browse files
authored
Merge pull request QuickSwap#1769 from webdev403/fix/infinite-loading-for-gamma-in-pools
2 parents e08233b + e8cf56c commit a28edb1

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

  • src/pages/PoolsPage/v3/SupplyLiquidityV3/components/PresetRanges

src/pages/PoolsPage/v3/SupplyLiquidityV3/components/PresetRanges/index.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,14 @@ export function PresetRanges({
152152
gammaBaseUppers.length >= index &&
153153
gammaCurrentTicks.length >= index
154154
) {
155-
const gammaBaseLower = gammaBaseLowers[index];
156-
const gammaCurrentTick = gammaCurrentTicks[index];
157-
const gammaBaseUpper = gammaBaseUppers[index];
155+
const gammaBaseLower = gammaBaseLowers[index] ?? 0;
156+
const gammaCurrentTick = gammaCurrentTicks[index] ?? 0;
157+
const gammaBaseUpper = gammaBaseUppers[index] ?? 0;
158158

159-
if (gammaBaseLower && gammaCurrentTick && gammaBaseUpper) {
160-
const lowerValue = Math.pow(1.0001, gammaBaseLower - gammaCurrentTick);
161-
const upperValue = Math.pow(1.0001, gammaBaseUpper - gammaCurrentTick);
159+
const lowerValue = Math.pow(1.0001, gammaBaseLower - gammaCurrentTick);
160+
const upperValue = Math.pow(1.0001, gammaBaseUpper - gammaCurrentTick);
162161

163-
return { min: lowerValue, max: upperValue };
164-
}
165-
return;
162+
return { min: lowerValue, max: upperValue };
166163
}
167164
return;
168165
});

0 commit comments

Comments
 (0)