View Facet Aggregate
Overview
Key Data Structures
struct AggregatedPositionAmount {
PositionType positionType; // LONG or SHORT
uint256 aggregatedAmount; // Total open position size
uint256 avgOpenPrice; // aggregatedNotional / aggregatedAmount
}
struct AggregatedPositionBySymbol {
uint256 symbolId;
PositionType positionType;
uint256 aggregatedOpenAmount;
uint256 avgOpenPrice;
}
struct AggregatedFundingDebtBySymbol {
uint256 symbolId;
PositionType positionType;
int256 fundingDebt; // Positive = party owes, negative = party is owed
}
struct UpnlData {
uint256 symbolId;
PositionType positionType;
uint256 aggregatedAmount;
uint256 avgOpenPrice;
int256 fundingDebt;
}uPnL Calculation Formula
Position Aggregate Functions
Function
Parameters
Description
Funding Aggregate Functions
Function
Parameters
Returns
Active Symbols Functions
Function
Parameters
Returns
Paginated Batch Functions
Position Batches
Function
Parameters
Returns
Funding Debt Batches
Function
Parameters
Returns
uPnL Data Functions (Recommended)
Function
Parameters
Returns
uPnL Formula
Usage Example
Last updated

