Add direction to JupiterPerpsPosition #16

Closed
opened 2026-06-26 17:14:12 +02:00 by minimons · 0 comments
Owner

Description:

Extend the Jupiter Perps position API with the position direction.

Add a direction field to JupiterPerpsPosition so callers can see whether a position is LONG or SHORT.

Suggested API change:

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

Add enum:

public enum JupiterPerpsPositionDirection {
    LONG,
    SHORT
}

Implementation:

  • Decode the side field from the Jupiter Perps Position account.
  • Map the decoded value to JupiterPerpsPositionDirection.
  • Keep existing entry price decoding unchanged.

Non-goals:

  • No market/token name
  • No collateral
  • No liquidation price
  • No wallet discovery changes
  • No trading or transaction signing

Acceptance criteria:

  • JupiterPerpsPosition contains a direction field.
  • Direction is decoded from the Position account.
  • Existing getPosition(...) and getOpenPositions(...) still work.
### Description: Extend the Jupiter Perps position API with the position direction. Add a direction field to `JupiterPerpsPosition` so callers can see whether a position is `LONG` or `SHORT`. ### Suggested API change: ```java public record JupiterPerpsPosition( ΩJupiterPerpsPositionAccountΩ positionAccount, ΩUSDCPriceΩ entryPrice, JupiterPerpsPositionDirection direction ) { } ``` Add enum: ```java public enum JupiterPerpsPositionDirection { LONG, SHORT } ``` ### Implementation: * Decode the `side` field from the Jupiter Perps Position account. * Map the decoded value to `JupiterPerpsPositionDirection`. * Keep existing entry price decoding unchanged. ### Non-goals: * No market/token name * No collateral * No liquidation price * No wallet discovery changes * No trading or transaction signing ### Acceptance criteria: * `JupiterPerpsPosition` contains a direction field. * Direction is decoded from the Position account. * Existing `getPosition(...)` and `getOpenPositions(...)` still work.
minimons added the enhancement label 2026-06-26 17:14:12 +02:00
minimons self-assigned this 2026-06-26 17:14:12 +02:00
minimons added this to the AssetAZ project 2026-06-26 17:14:12 +02:00
minimons moved this to Done in AssetAZ on 2026-06-26 18:40:43 +02:00
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#16