ValueTag improvements
This commit is contained in:
@@ -3,6 +3,8 @@ package com.fanitas.evelyn.core.impl.ref;
|
||||
import com.fanitas.evelyn.core.*;
|
||||
import com.fanitas.evelyn.raydium.RaydiumLiquidityPoolPositionConcentrated;
|
||||
|
||||
import com.r35157.libs.basic.Pair;
|
||||
import com.r35157.libs.basic.Triblet;
|
||||
import com.r35157.libs.raydium.Raydium;
|
||||
import com.r35157.libs.raydium.RaydiumLiquidityPoolPrice;
|
||||
import com.r35157.libs.solana.SPLTokenHolding;
|
||||
@@ -119,25 +121,29 @@ public class EvelynImpl implements Evelyn {
|
||||
|
||||
System.out.println("Pool price: " + currentPriceFromRaydium + "/" + currentPriceFromChain.amount());
|
||||
|
||||
Pair totalDistributedSums = desiredPositionCalculator.calculateTotalDistributedSums();
|
||||
ΩSolanaAmountΩ totalDistributedSumSolana = totalDistributedSums.amountA();
|
||||
ΩSyrupAmountΩ totalDistributedSumSyrup = totalDistributedSums.amountB();
|
||||
Pair<ΩSolanaAmountΩ, ΩSyrupAmountΩ> totalDistributedSums =
|
||||
desiredPositionCalculator.calculateTotalDistributedSums();
|
||||
ΩSolanaAmountΩ totalDistributedSumSolana = totalDistributedSums.left();
|
||||
ΩSyrupAmountΩ totalDistributedSumSyrup = totalDistributedSums.right();
|
||||
System.out.println("Total amount currently distributed: " + totalDistributedSumSolana
|
||||
+ " / " + totalDistributedSumSyrup);
|
||||
|
||||
Pair amountsLocked = desiredPositionCalculator.calculateLockedSums(currentPriceFromChain.amount());
|
||||
ΩSolanaAmountΩ amountLockedSolana = amountsLocked.amountA();
|
||||
ΩSyrupAmountΩ amountLockedSyrup = amountsLocked.amountB();
|
||||
Pair<ΩSolanaAmountΩ, ΩSyrupAmountΩ> amountsLocked =
|
||||
desiredPositionCalculator.calculateLockedSums(currentPriceFromChain.amount());
|
||||
ΩSolanaAmountΩ amountLockedSolana = amountsLocked.left();
|
||||
ΩSyrupAmountΩ amountLockedSyrup = amountsLocked.right();
|
||||
System.out.println("Total amount locked due to HIGH price: " + amountLockedSolana);
|
||||
System.out.println("Total amount locked due to LOW price: " + amountLockedSyrup);
|
||||
|
||||
ΩSyrupAmountΩ totalAmountSyrup = add(totalDistributedSumSyrup, inactiveInAccountSyrup);
|
||||
ΩSyrupAmountΩ reservedForBurnSyrup = subtract(totalAmountSyrup, state.getSyrupOwnedByEvelyn());
|
||||
ΩSolanaAmountΩ readyForBurnSolana = subtract(solBalanceEvelyn, SOFT_LOW_LIMIT_SOLANA_BALANCE);
|
||||
System.out.println("Amount reserved for burn: Syrup:" + reservedForBurnSyrup.amount()
|
||||
+ " + Solana: " + readyForBurnSolana.amount());
|
||||
|
||||
Pair/*ΩSyrupAmountΩ*/ syrupTotalReadyAmount = desiredPositionCalculator.calculateRedistributableSums(
|
||||
ΩSolanaAmountΩ readyForBurnSolana = subtract(solBalanceEvelyn, SOFT_LOW_LIMIT_SOLANA_BALANCE);
|
||||
System.out.println("Amount reserved for burn: "
|
||||
+ "Solana: " + readyForBurnSolana
|
||||
+ ", Syrup:" + reservedForBurnSyrup);
|
||||
|
||||
Pair<ΩSolanaAmountΩ, ΩSyrupAmountΩ> syrupTotalReadyAmount = desiredPositionCalculator.calculateRedistributableSums(
|
||||
currentPriceFromChain.amount(),
|
||||
new ΩSyrupAmountΩ(inactiveInAccountSyrup, readyForBurnSolana.currencyType()), // TODO: Wow! This is not pretty! Stealing cyrrenctType from another object. Oh dear!
|
||||
reservedForBurnSyrup
|
||||
|
||||
Reference in New Issue
Block a user