Fix some bugs in calculateTotalDistributedSums()

This commit is contained in:
2026-06-10 09:09:23 +02:00
parent f9c5391688
commit 902b6ffd91
@@ -88,15 +88,22 @@ public class DesiredPositionCalculatorImpl implements DesiredPositionCalculator
} }
// TODO: This smells - setting to null. Oh dear! // TODO: This smells - setting to null. Oh dear!
CurrencyType ct = null; CurrencyType ctA = null;
ΩAmountΩ amountA = ZERO;
CurrencyType ctB = null;
ΩAmountΩ amountB = ZERO; ΩAmountΩ amountB = ZERO;
for (RaydiumLiquidityPoolPositionConcentrated position : liquidityProviderPositions.values()) { for (RaydiumLiquidityPoolPositionConcentrated position : liquidityProviderPositions.values()) {
ct = position.amountMintB().currencyType(); // TODO: Too redundant - please rethink ctA = position.amountMintA().currencyType(); // TODO: Too redundant - please rethink
amountA = amountA.add(position.accountingInfo().addedMintA());
ctB = position.amountMintB().currencyType(); // TODO: Too redundant - please rethink
amountB = amountB.add(position.accountingInfo().addedMintB()); amountB = amountB.add(position.accountingInfo().addedMintB());
} }
MoneyAmount ma = new MoneyAmount(amountB, ct); MoneyAmount ma = new MoneyAmount(amountA, ctA);
return new Pair(ZERO, ma); MoneyAmount mb = new MoneyAmount(amountB, ctB);
return new Pair(ma, mb);
} }
@Override @Override