getPositionInfoList
The getPositionInfoList
function retrieves detailed information about positions based on a list of position cap information.
Function Signature
Parameters
positionCapInfoList
: An array ofIPositionCapInfo
objects, typically obtained fromgetPositionCapInfoList
.owner
: A string representing the owner's address.
Return Value
Returns a Promise
that resolves to an array of IPositionInfo
objects. Each IPositionInfo
object contains detailed information about a position, including:
Description
This function takes a list of position cap information and fetches detailed data for each position. It calculates additional information such as reserving fee amount and funding fee value for open positions.
Usage Example
Notes
The function sorts the returned positions by
openTimestamp
in ascending order.For open positions, the function calculates
reservingFeeAmount
andfundingFeeValue
using separate API calls.If there's an error calculating
reservingFeeAmount
orfundingFeeValue
, these values are set to 0 and the error is logged.
Last updated