16: Add 'side' to AnchorIdlJupiterPerpsPositionDecoder
This commit is contained in:
+6
-3
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user