16: Add 'side' to AnchorIdlJupiterPerpsPositionDecoder

This commit is contained in:
2026-06-26 18:41:15 +02:00
parent 0371dd1370
commit 101f4db61d
@@ -47,13 +47,16 @@ class AnchorIdlJupiterPerpsPositionDecoder {
private JupiterPerpsPositionDirection decodeDirection( private JupiterPerpsPositionDirection decodeDirection(
byte rawSide byte rawSide
) { ) {
return switch (rawSide) { // Jupiter Perps position side values are encoded as 1 = LONG, 2 = SHORT.
case 0 -> JupiterPerpsPositionDirection.LONG; JupiterPerpsPositionDirection direction = switch (rawSide) {
case 1 -> JupiterPerpsPositionDirection.SHORT; case 1 -> JupiterPerpsPositionDirection.LONG;
case 2 -> JupiterPerpsPositionDirection.SHORT;
default -> throw new IllegalArgumentException( default -> throw new IllegalArgumentException(
"Unknown Jupiter Perps position side: " + rawSide "Unknown Jupiter Perps position side: " + rawSide
); );
}; };
return direction;
} }
private static final int ANCHOR_DISCRIMINATOR_LENGTH = 8; private static final int ANCHOR_DISCRIMINATOR_LENGTH = 8;