diff --git a/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsAlarmImpl.tjava b/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsAlarmImpl.tjava index 224e8f8..1b69a02 100644 --- a/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsAlarmImpl.tjava +++ b/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsAlarmImpl.tjava @@ -18,9 +18,11 @@ public final class JupiterPerpsAlarmImpl { public static void main(String[] args) throws Exception { Config config; - + System.out.println("Starting Jupiter Perps Alarms..."); try { + System.out.print("Parsing commandline parameters... "); config = Config.parse(args, System.getenv()); + System.out.println("Done."); } catch (IllegalArgumentException exception) { printUsage(); String errMsg = "Could not parse configuration for JupiterPerpsAlarm: " + exception.getMessage() + "!"; @@ -31,7 +33,9 @@ public final class JupiterPerpsAlarmImpl { AlarmConfiguration alarmConfiguration; try { + System.out.print("Parsing alarm configuration... "); alarmConfiguration = AlarmConfigurationParser.parse(config.alarmConfiguration()); + System.out.println("Done."); definitions = alarmConfiguration.definitions(); } catch (Exception exception) { String errMsg = "Could not load alarm configuration: " + exception.getMessage() + "!"; @@ -42,11 +46,16 @@ public final class JupiterPerpsAlarmImpl { alarmConfiguration.variables() ); + System.out.print("Initializing dependecies... "); SolanaBlockChain solanaBlockChain = new SolanaBlockChainImpl(); JupiterPerpsService jupiterPerpsService = new AnchorIdlJupiterPerpsServiceImpl(solanaBlockChain); JupiterPerpsEntryPriceVariableRefresher entryPriceVariableRefresher = new JupiterPerpsEntryPriceVariableRefresher(alarmConfiguration.variables(), jupiterPerpsService); + System.out.println("Done."); + + System.out.println("Executing first pre-run data fetch:"); entryPriceVariableRefresher.refresh(); + System.out.println("Fetching done."); JupiterPerpsEntryPriceVariableRefreshWatcher entryPriceVariableRefreshWatcher = new JupiterPerpsEntryPriceVariableRefreshWatcher( diff --git a/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsEntryPriceVariableRefresher.tjava b/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsEntryPriceVariableRefresher.tjava index 271cec5..fbc09a1 100644 --- a/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsEntryPriceVariableRefresher.tjava +++ b/src/main/tjava/com/r35157/jupiterperpsalarm/impl/ref/JupiterPerpsEntryPriceVariableRefresher.tjava @@ -27,6 +27,7 @@ public final class JupiterPerpsEntryPriceVariableRefresher { } try { + System.out.println(" Fetching 'Open Positions':"); Set positions = jupiterPerpsService.getOpenPositions(wallet); System.out.println( diff --git a/src/main/tjava/com/r35157/libs/jupiter/perps/impl/anchoridl/AnchorIdlJupiterPerpsServiceImpl.tjava b/src/main/tjava/com/r35157/libs/jupiter/perps/impl/anchoridl/AnchorIdlJupiterPerpsServiceImpl.tjava index 65c23af..818e08e 100644 --- a/src/main/tjava/com/r35157/libs/jupiter/perps/impl/anchoridl/AnchorIdlJupiterPerpsServiceImpl.tjava +++ b/src/main/tjava/com/r35157/libs/jupiter/perps/impl/anchoridl/AnchorIdlJupiterPerpsServiceImpl.tjava @@ -73,6 +73,7 @@ public class AnchorIdlJupiterPerpsServiceImpl implements JupiterPerpsService { Set positions = new HashSet<>(); for (SolanaAccountInfo accountInfo : accountInfos) { + System.out.println(" Found " + accountInfos.size() + " postion candidates..."); ΩSolanaProgramIdΩ programId = accountInfo.owner(); ΩJupiterPerpsPositionAccountΩ positionAccount = accountInfo.address(); @@ -104,7 +105,9 @@ public class AnchorIdlJupiterPerpsServiceImpl implements JupiterPerpsService { ) throws IOException, InterruptedException { ΩJupiterPerpsCustodyAccountAddressΩ custodyAccountAddress = perpsPositionInfo.custodyAccountAddress(); + System.out.print(" Getting account info for: " + custodyAccountAddress + "..."); ΩJupiterCustodyAccountInfoEncodedΩ encodedCustodyAccountInfo = solanaBlockChain.getAccountInfo(custodyAccountAddress); + System.out.println(" Done."); if (encodedCustodyAccountInfo == null) { String errorMsg = "Jupiter Perps custody account does not exist: " + custodyAccountAddress; @@ -118,14 +121,17 @@ public class AnchorIdlJupiterPerpsServiceImpl implements JupiterPerpsService { ΩJupiterPerpsCollateralCustodyAccountAddressΩ collateralCustodyAccountAddress = perpsPositionInfo.collateralCustodyAccountAddress(); + System.out.print(" Getting collateral custody account Info for: " + custodyAccountAddress + "..."); ΩJupiterCustodyAccountInfoEncodedΩ encodedCollateralCustodyAccountInfo = solanaBlockChain.getAccountInfo(collateralCustodyAccountAddress); + System.out.println(" Done."); if (encodedCollateralCustodyAccountInfo == null) { String errorMsg = "Jupiter Perps collateral custody account does not exist: " + collateralCustodyAccountAddress; throw new IllegalArgumentException(errorMsg); } + System.out.print(" Calculating fiels in position..."); JupiterCustodyAccountInfo collateralCustodyAccountInfo = custodyDecoder.decode(encodedCollateralCustodyAccountInfo); @@ -174,6 +180,7 @@ public class AnchorIdlJupiterPerpsServiceImpl implements JupiterPerpsService { accountRent ); + System.out.println(" Done."); return pos; }