20: Clean-up before update
This commit is contained in:
+11
@@ -34,6 +34,8 @@ public final class JupiterPerpsEntryPriceVariableRefresher {
|
|||||||
+ " open Jupiter Perps positions for wallet: " + wallet
|
+ " open Jupiter Perps positions for wallet: " + wallet
|
||||||
);
|
);
|
||||||
|
|
||||||
|
removeEntryPriceVariables();
|
||||||
|
|
||||||
for (JupiterPerpsPosition position : positions) {
|
for (JupiterPerpsPosition position : positions) {
|
||||||
String variableName = createEntryPriceVariableName(position);
|
String variableName = createEntryPriceVariableName(position);
|
||||||
|
|
||||||
@@ -57,6 +59,15 @@ public final class JupiterPerpsEntryPriceVariableRefresher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removeEntryPriceVariables() {
|
||||||
|
variables.remove("SOL_LONG_ENTRY_PRICE");
|
||||||
|
variables.remove("SOL_SHORT_ENTRY_PRICE");
|
||||||
|
variables.remove("BTC_LONG_ENTRY_PRICE");
|
||||||
|
variables.remove("BTC_SHORT_ENTRY_PRICE");
|
||||||
|
variables.remove("ETH_LONG_ENTRY_PRICE");
|
||||||
|
variables.remove("ETH_SHORT_ENTRY_PRICE");
|
||||||
|
}
|
||||||
|
|
||||||
private static String createEntryPriceVariableName(JupiterPerpsPosition position) {
|
private static String createEntryPriceVariableName(JupiterPerpsPosition position) {
|
||||||
String asset = switch (position.tradedTokenMint()) {
|
String asset = switch (position.tradedTokenMint()) {
|
||||||
case "So11111111111111111111111111111111111111112" -> "SOL";
|
case "So11111111111111111111111111111111111111112" -> "SOL";
|
||||||
|
|||||||
Reference in New Issue
Block a user