Add traded token mint to JupiterPerpsPosition #17

Closed
opened 2026-06-26 19:13:03 +02:00 by minimons · 0 comments
Owner

Description:

Extend JupiterPerpsPosition with the mint address of the token traded by the position.

The API should not return a display name such as SOL, BTC, or ETH. A UI or client can map the mint address to a display name later.

Suggested API change:

public record JupiterPerpsPosition(
        ΩJupiterPerpsPositionAccountΩ positionAccount,
        ΩUSDCPriceΩ entryPrice,
        JupiterPerpsPositionDirection direction,
        ΩSPLMintAddressΩ tradedTokenMint
) {
}

Implementation:

  • Decode or derive the traded token mint for a Jupiter Perps position.
  • Return it as part of JupiterPerpsPosition.
  • Keep existing decoding of entryPrice and direction unchanged.

Non-goals:

  • No display/token names
  • No collateral amount
  • No liquidation price
  • No trading or transaction signing
  • No UI-specific mapping

Acceptance criteria:

  • JupiterPerpsPosition contains the traded token mint address.
  • getPosition(...) returns the traded token mint.
  • getOpenPositions(...) returns positions with traded token mint populated.
  • Existing entryPrice and direction behavior still works.
  • Project compiles.
### Description: Extend `JupiterPerpsPosition` with the mint address of the token traded by the position. The API should not return a display name such as `SOL`, `BTC`, or `ETH`. A UI or client can map the mint address to a display name later. ### Suggested API change: ```java public record JupiterPerpsPosition( ΩJupiterPerpsPositionAccountΩ positionAccount, ΩUSDCPriceΩ entryPrice, JupiterPerpsPositionDirection direction, ΩSPLMintAddressΩ tradedTokenMint ) { } ``` ### Implementation: * Decode or derive the traded token mint for a Jupiter Perps position. * Return it as part of `JupiterPerpsPosition`. * Keep existing decoding of `entryPrice` and `direction` unchanged. ### Non-goals: * No display/token names * No collateral amount * No liquidation price * No trading or transaction signing * No UI-specific mapping ### Acceptance criteria: * `JupiterPerpsPosition` contains the traded token mint address. * `getPosition(...)` returns the traded token mint. * `getOpenPositions(...)` returns positions with traded token mint populated. * Existing `entryPrice` and `direction` behavior still works. * Project compiles.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#17