Add sizeUsd to JupiterPerpsPosition
#21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The Jupiter Perps API should expose the USD size of a position.
The position account contains a
sizeUsdfield located immediately afterpriceand beforecollateralUsd. This value should be decoded and exposed through the public API.Required changes
Add a new field to
JupiterPerpsPosition:ΩUSDCAmountΩ sizeUsdDecode the
sizeUsdfield from the Jupiter Perps position account.Return the decoded value as part of
JupiterPerpsPosition.Validation
Verify the decoded value against the Jupiter web UI for one or more open positions to ensure the decoded value is correct.
Notes
The value represents the position size in USD and is not the collateral.
This field is expected to become one of the required building blocks for a future implementation of liquidation price calculations.