21: Add sizeUsd to JupiterPerpsPosition
This commit is contained in:
+10
@@ -47,11 +47,21 @@ class AnchorIdlJupiterPerpsPositionDecoder {
|
|||||||
.valueOf(rawCollateralUsd)
|
.valueOf(rawCollateralUsd)
|
||||||
.movePointLeft(6);
|
.movePointLeft(6);
|
||||||
|
|
||||||
|
long rawSizeUsd = ByteBuffer
|
||||||
|
.wrap(data, SIZE_USD_OFFSET, U64_LENGTH)
|
||||||
|
.order(ByteOrder.LITTLE_ENDIAN)
|
||||||
|
.getLong();
|
||||||
|
|
||||||
|
ΩUSDCAmountΩ sizeUsd = BigDecimal
|
||||||
|
.valueOf(rawSizeUsd)
|
||||||
|
.movePointLeft(6);
|
||||||
|
|
||||||
JupiterPerpsPosition pos = new JupiterPerpsPosition(
|
JupiterPerpsPosition pos = new JupiterPerpsPosition(
|
||||||
positionAccount,
|
positionAccount,
|
||||||
entryPrice,
|
entryPrice,
|
||||||
direction,
|
direction,
|
||||||
tradedTokenMint,
|
tradedTokenMint,
|
||||||
|
sizeUsd,
|
||||||
collateralUsd
|
collateralUsd
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user