16: Add 'side' to AnchorIdlJupiterPerpsPositionDecoder
This commit is contained in:
+6
-3
@@ -47,13 +47,16 @@ class AnchorIdlJupiterPerpsPositionDecoder {
|
||||
private JupiterPerpsPositionDirection decodeDirection(
|
||||
byte rawSide
|
||||
) {
|
||||
return switch (rawSide) {
|
||||
case 0 -> JupiterPerpsPositionDirection.LONG;
|
||||
case 1 -> JupiterPerpsPositionDirection.SHORT;
|
||||
// Jupiter Perps position side values are encoded as 1 = LONG, 2 = SHORT.
|
||||
JupiterPerpsPositionDirection direction = switch (rawSide) {
|
||||
case 1 -> JupiterPerpsPositionDirection.LONG;
|
||||
case 2 -> JupiterPerpsPositionDirection.SHORT;
|
||||
default -> throw new IllegalArgumentException(
|
||||
"Unknown Jupiter Perps position side: " + rawSide
|
||||
);
|
||||
};
|
||||
|
||||
return direction;
|
||||
}
|
||||
|
||||
private static final int ANCHOR_DISCRIMINATOR_LENGTH = 8;
|
||||
|
||||
Reference in New Issue
Block a user