diff --git a/src/main/tjava/com/r35157/libs/raydium/Raydium.tjava b/src/main/tjava/com/r35157/libs/raydium/Raydium.tjava index 9e56d6d..11213da 100644 --- a/src/main/tjava/com/r35157/libs/raydium/Raydium.tjava +++ b/src/main/tjava/com/r35157/libs/raydium/Raydium.tjava @@ -1,6 +1,5 @@ package com.r35157.libs.raydium; -import com.r35157.libs.valuetypes.basic.AssetPrice; import com.r35157.libs.valuetypes.basic.MoneyAmount; import com.r35157.libs.valuetypes.basic.Range; @@ -16,11 +15,11 @@ public interface Raydium { * to any Raydium liquidity pool supported by the implementation.

* * @param poolId the Raydium liquidity pool id - * @return the current pool price + * @return the current pool price expressed as a Solana amount * @throws IOException if the price could not be fetched or the response could not be parsed * @throws InterruptedException if the calling thread is interrupted while fetching the price */ - AssetPrice fetchPoolPrice(ΩRaydiumLiquidityPoolIdΩ poolId) throws IOException, InterruptedException; + ΩSolanaAmountΩ fetchPoolPrice(ΩRaydiumLiquidityPoolIdΩ poolId) throws IOException, InterruptedException; /** * Fetches the Raydium liquidity pool ids where the supplied Solana owner address has positions. @@ -184,7 +183,7 @@ public interface Raydium { * @param decimalPlaces the number decimal places in the resulting price currency * @return the price range represented by the concentrated liquidity position */ - Range calculateConcentratedPositionPriceRange( + Range<ΩPriceΩ> calculateConcentratedPositionPriceRange( RaydiumConcentratedPositionState positionState, RaydiumConcentratedPoolInfo poolInfo, int decimalPlaces diff --git a/src/main/tjava/com/r35157/libs/raydium/RaydiumConcentratedPositionState.tjava b/src/main/tjava/com/r35157/libs/raydium/RaydiumConcentratedPositionState.tjava index ccc5496..b1f07aa 100644 --- a/src/main/tjava/com/r35157/libs/raydium/RaydiumConcentratedPositionState.tjava +++ b/src/main/tjava/com/r35157/libs/raydium/RaydiumConcentratedPositionState.tjava @@ -1,5 +1,6 @@ package com.r35157.libs.raydium; +import java.math.BigDecimal; import java.math.BigInteger; public record RaydiumConcentratedPositionState( diff --git a/src/main/tjava/com/r35157/libs/raydium/RaydiumLiquidityPoolPrice.tjava b/src/main/tjava/com/r35157/libs/raydium/RaydiumLiquidityPoolPrice.tjava index e44309e..24bd54d 100644 --- a/src/main/tjava/com/r35157/libs/raydium/RaydiumLiquidityPoolPrice.tjava +++ b/src/main/tjava/com/r35157/libs/raydium/RaydiumLiquidityPoolPrice.tjava @@ -1,18 +1,18 @@ package com.r35157.libs.raydium; -import com.r35157.libs.valuetypes.basic.AssetPrice; +import com.r35157.libs.valuetypes.basic.MoneyAmount; /** - * Represents the current price of the tokens in a Raydium liquidity pool. + * Represents the price of a Raydium liquidity pool. * - *

The 'poolId' identifies the Raydium liquidity pool for which the current token price applies. - * The 'price' represents the price value returned or calculated for that pool.

+ *

The pool id identifies the Raydium liquidity pool for which the price applies. + * The amount contains the price value returned or calculated for that pool.

* * @param poolId the Raydium liquidity pool id that the price belongs to - * @param price the price for a token in the liquidity pool + * @param amount the price amount for the liquidity pool */ public record RaydiumLiquidityPoolPrice( ΩRaydiumLiquidityPoolIdΩ poolId, - AssetPrice price + MoneyAmount amount ) { } \ No newline at end of file diff --git a/src/main/tjava/com/r35157/libs/valuetypes/basic/TradingPair.tjava b/src/main/tjava/com/r35157/libs/valuetypes/basic/TradingPair.tjava index bd6c671..c028ff6 100644 --- a/src/main/tjava/com/r35157/libs/valuetypes/basic/TradingPair.tjava +++ b/src/main/tjava/com/r35157/libs/valuetypes/basic/TradingPair.tjava @@ -1,13 +1,6 @@ package com.r35157.libs.valuetypes.basic; -import org.jetbrains.annotations.NotNull; - public record TradingPair( CurrencyType base, // The thing you are buying or selling. CurrencyType quote // The currency/unit used to price the base asset. -) { - @Override - public @NotNull String toString() { - return base.symbol() + "_" + quote.symbol(); - } -} +) { } diff --git a/src/main/tjava/com/r35157/nenjim/hubd/NenjimHub.tjava b/src/main/tjava/com/r35157/nenjim/hubd/NenjimHub.tjava index d3f7bbf..2685456 100644 --- a/src/main/tjava/com/r35157/nenjim/hubd/NenjimHub.tjava +++ b/src/main/tjava/com/r35157/nenjim/hubd/NenjimHub.tjava @@ -1,30 +1,18 @@ package com.r35157.nenjim.hubd; import com.r35157.nenjim.hubd.journal.Journal; -import crypto.r35157.nenjim.NenjimProcess; import org.jetbrains.annotations.NotNull; -import java.util.HashMap; - public interface NenjimHub { - /** - * Starts a process based on the provided fully qualified interface name. - * The actual implementation that is run is binded according to the Context. - * - * @param fqInterfaceName the fully qualified interface name of the process to start. The interface must extend the {@code NenjimProcess} interface. - */ - void startProcess(String fqInterfaceName); - - /** - * Provides a map of all running processes managed by the NenjimHub, keyed by the processId. - * - * @return a map of {@code NenjimProcess} running processes - */ - HashMap getRunningProcesses(); - /** * A no-operation (noop). This method is suppoted to do nothing. */ void noop(); + + /** + * + * @param journal + */ + void monitorJournal(@NotNull Journal journal); }