Fix some bugs in calculateTotalDistributedSums()
This commit is contained in:
+11
-4
@@ -88,15 +88,22 @@ public class DesiredPositionCalculatorImpl implements DesiredPositionCalculator
|
||||
}
|
||||
|
||||
// TODO: This smells - setting to null. Oh dear!
|
||||
CurrencyType ct = null;
|
||||
CurrencyType ctA = null;
|
||||
ΩAmountΩ amountA = ZERO;
|
||||
CurrencyType ctB = null;
|
||||
ΩAmountΩ amountB = ZERO;
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
MoneyAmount ma = new MoneyAmount(amountB, ct);
|
||||
return new Pair(ZERO, ma);
|
||||
MoneyAmount ma = new MoneyAmount(amountA, ctA);
|
||||
MoneyAmount mb = new MoneyAmount(amountB, ctB);
|
||||
|
||||
return new Pair(ma, mb);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user