From 51dbbe54e8cf1be20985b5f963dc7ec53d2a59a6cd099c2b74fa336b46d56431 Mon Sep 17 00:00:00 2001 From: Minimons Date: Sat, 4 Jul 2026 16:25:05 +0200 Subject: [PATCH] X: Add a lot of new fields to 'JupiterPerpsPostion' --- .../jupiter/perps/JupiterPerpsPosition.tjava | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/src/main/tjava/com/r35157/libs/jupiter/perps/JupiterPerpsPosition.tjava b/src/main/tjava/com/r35157/libs/jupiter/perps/JupiterPerpsPosition.tjava index f831c43..995fbd3 100644 --- a/src/main/tjava/com/r35157/libs/jupiter/perps/JupiterPerpsPosition.tjava +++ b/src/main/tjava/com/r35157/libs/jupiter/perps/JupiterPerpsPosition.tjava @@ -10,18 +10,36 @@ import java.math.BigDecimal; * position.

* * @param positionAccount the Solana account address of the Jupiter Perps position - * @param entryPrice the entry price of the position, denominated in USDC - * @param direction whether the position is long or short * @param tradedTokenMint the mint address of the token being traded - * @param sizeUsd the size of this position in USD - * @param collateralUsd the amount of USD representing the collateral for this position + * @param direction whether the position is long or short + * @param value the amount the position is worth if closed now + * @param size the leveraged amount used to open the contracts + * @param pnl the amount in usd in profit or loss on this position + * @param pnlPercent the profit and loss represented as a percentage + * @param leverage + * @param entryPrice the entry price of the position, denominated in USDC + * @param marketPrice the current spot price of the token + * @param collateral the amount of USD representing the collateral for this position + * @param totalFees the total amount of fees (TODO: is that including pending/due fees) + * @param borrowFeesDue the amount of USD that is currently outstanding + * @param closeFeePending the fee in USD for closing the account (TODO: multiple accounts - when adding collateral?) + * @param accountRent refundable amount locked for Solana account renting */ public record JupiterPerpsPosition( ΩJupiterPerpsPositionAccountΩ positionAccount, - ΩUSDCPriceΩ entryPrice, - JupiterPerpsPositionDirection direction, ΩSPLMintAddressΩ tradedTokenMint, - ΩUSDCAmountΩ sizeUsd, - ΩUSDCAmountΩ collateralUsd + JupiterPerpsPositionDirection direction, + ΩUSDCAmountΩ value, + ΩUSDCAmountΩ size, + ΩUSDCAmountΩ pnl, + BigDecimal pnlPercent, + BigDecimal leverage, + ΩUSDCPriceΩ entryPrice, + ΩUSDCPriceΩ marketPrice, + ΩUSDCAmountΩ collateral, + ΩUSDCAmountΩ totalFees, + ΩUSDCAmountΩ borrowFeesDue, + ΩUSDCAmountΩ closeFeePending, + ΩSolanaAmountΩ accountRent ) { } \ No newline at end of file