Orderly SDKs / Modules / @orderly.network/perp / positions
@orderly.network/perp.positions
Ƭ LiqPriceInputs: Object
Name | Type |
---|---|
MMR | number |
markPrice | number |
positionQty | number |
positions | Pick <PositionExt , "position_qty" | "mark_price" | "mmr" >[] |
totalCollateral | number |
Ƭ MMInputs: Object
Name | Type |
---|---|
MMR | number |
markPrice | number |
positionQty | number |
Ƭ MMRInputs: Object
Name | Type |
---|---|
IMRFactor | number |
IMR_factor_power | number |
baseIMR | number |
baseMMR | number |
positionNotional | number |
Ƭ TotalUnsettlementPnLInputs: Object
Name | Type |
---|---|
positions | Position & { sum_unitary_funding : number }[] |
sumUnitaryFunding | number |
Ƭ UnrealPnLInputs: Object
Name | Type |
---|---|
markPrice | number |
openPrice | number |
qty | number |
Ƭ UnrealPnLROIInputs: Object
Name | Type |
---|---|
IMR | number |
openPrice | number |
positionQty | number |
unrealizedPnL | number |
Ƭ UnsettlementPnLInputs: Object
Name | Type |
---|---|
costPosition | number |
lastSumUnitaryFunding | number |
markPrice | number |
positionQty | number |
sumUnitaryFunding | number |
▸ MMR(inputs
): number
Calculates the maintenance margin requirement (MMR) of a position.
Name | Type | Description |
---|---|---|
inputs | MMRInputs | The inputs for calculating the MMR. |
number
The MMR of the position.
▸ estOffsetForTP(inputs
): number
Calculates the estimated offset for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.price | number |
number
▸ estPnLForSL(inputs
): number
Calculates the PnL for stop loss.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.positionQty | number |
number
▸ estPnLForTP(inputs
): number
Calculates the profit or loss for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.positionQty | number |
inputs.price | number |
number
The profit or loss for take profit.
▸ estPriceForTP(inputs
): number
Calculates the estimated price for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.pnl | number |
inputs.positionQty | number |
number
▸ estPriceFromOffsetForTP(inputs
): number
Calculates the estimated price from offset for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.offset | number |
number
▸ liqPrice(inputs
): number
| null
Calculates the liquidation price of a single position.
Name | Type | Description |
---|---|---|
inputs | LiqPriceInputs | The inputs for calculating the liquidation price. |
number
| null
The liquidation price of the position.
▸ maintenanceMargin(inputs
): number
Calculates the maintenance margin of a position.
Name | Type | Description |
---|---|---|
inputs | MMInputs | The inputs for calculating the maintenance margin. |
number
The maintenance margin of the position.
▸ notional(qty
, mark_price
): number
Calculates the notional value of a single position.
Name | Type | Description |
---|---|---|
qty | number | The quantity of the position. |
mark_price | number | The price of the position. |
number
The notional value of the position.
▸ totalNotional(positions
): number
Calculates the total notional value of all positions.
Name | Type | Description |
---|---|---|
positions | Position [] | The array of positions. |
number
The total notional value of all positions.
▸ totalUnrealizedPnL(positions
): number
Calculates the total unrealized profit or loss of all positions.
Name | Type | Description |
---|---|---|
positions | Position [] | The array of positions. |
number
The total unrealized profit or loss of all positions.
▸ totalUnsettlementPnL(positions
): number
Calculates the total unrealized profit or loss of all positions.
Name | Type | Description |
---|---|---|
positions | Position & { sum_unitary_funding : number }[] | The array of positions. |
number
The total unrealized profit or loss of all positions.
▸ unrealizedPnL(inputs
): number
Calculates the unrealized profit or loss of a single position.
Name | Type | Description |
---|---|---|
inputs | UnrealPnLInputs | The inputs for calculating the unrealized profit or loss. |
number
The unrealized profit or loss of the position.
▸ unrealizedPnLROI(inputs
): number
Calculates the return on investment (ROI) of a single position’s unrealized profit or loss.
Name | Type | Description |
---|---|---|
inputs | UnrealPnLROIInputs | The inputs for calculating the ROI. |
number
The ROI of the position’s unrealized profit or loss.
▸ unsettlementPnL(inputs
): number
Calculates the unrealized profit or loss of each position.
Name | Type | Description |
---|---|---|
inputs | UnsettlementPnLInputs | The inputs for calculating the unrealized profit or loss. |
number
The unrealized profit or loss of each position.
Orderly SDKs / Modules / @orderly.network/perp / positions
@orderly.network/perp.positions
Ƭ LiqPriceInputs: Object
Name | Type |
---|---|
MMR | number |
markPrice | number |
positionQty | number |
positions | Pick <PositionExt , "position_qty" | "mark_price" | "mmr" >[] |
totalCollateral | number |
Ƭ MMInputs: Object
Name | Type |
---|---|
MMR | number |
markPrice | number |
positionQty | number |
Ƭ MMRInputs: Object
Name | Type |
---|---|
IMRFactor | number |
IMR_factor_power | number |
baseIMR | number |
baseMMR | number |
positionNotional | number |
Ƭ TotalUnsettlementPnLInputs: Object
Name | Type |
---|---|
positions | Position & { sum_unitary_funding : number }[] |
sumUnitaryFunding | number |
Ƭ UnrealPnLInputs: Object
Name | Type |
---|---|
markPrice | number |
openPrice | number |
qty | number |
Ƭ UnrealPnLROIInputs: Object
Name | Type |
---|---|
IMR | number |
openPrice | number |
positionQty | number |
unrealizedPnL | number |
Ƭ UnsettlementPnLInputs: Object
Name | Type |
---|---|
costPosition | number |
lastSumUnitaryFunding | number |
markPrice | number |
positionQty | number |
sumUnitaryFunding | number |
▸ MMR(inputs
): number
Calculates the maintenance margin requirement (MMR) of a position.
Name | Type | Description |
---|---|---|
inputs | MMRInputs | The inputs for calculating the MMR. |
number
The MMR of the position.
▸ estOffsetForTP(inputs
): number
Calculates the estimated offset for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.price | number |
number
▸ estPnLForSL(inputs
): number
Calculates the PnL for stop loss.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.positionQty | number |
number
▸ estPnLForTP(inputs
): number
Calculates the profit or loss for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.positionQty | number |
inputs.price | number |
number
The profit or loss for take profit.
▸ estPriceForTP(inputs
): number
Calculates the estimated price for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.pnl | number |
inputs.positionQty | number |
number
▸ estPriceFromOffsetForTP(inputs
): number
Calculates the estimated price from offset for take profit.
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.offset | number |
number
▸ liqPrice(inputs
): number
| null
Calculates the liquidation price of a single position.
Name | Type | Description |
---|---|---|
inputs | LiqPriceInputs | The inputs for calculating the liquidation price. |
number
| null
The liquidation price of the position.
▸ maintenanceMargin(inputs
): number
Calculates the maintenance margin of a position.
Name | Type | Description |
---|---|---|
inputs | MMInputs | The inputs for calculating the maintenance margin. |
number
The maintenance margin of the position.
▸ notional(qty
, mark_price
): number
Calculates the notional value of a single position.
Name | Type | Description |
---|---|---|
qty | number | The quantity of the position. |
mark_price | number | The price of the position. |
number
The notional value of the position.
▸ totalNotional(positions
): number
Calculates the total notional value of all positions.
Name | Type | Description |
---|---|---|
positions | Position [] | The array of positions. |
number
The total notional value of all positions.
▸ totalUnrealizedPnL(positions
): number
Calculates the total unrealized profit or loss of all positions.
Name | Type | Description |
---|---|---|
positions | Position [] | The array of positions. |
number
The total unrealized profit or loss of all positions.
▸ totalUnsettlementPnL(positions
): number
Calculates the total unrealized profit or loss of all positions.
Name | Type | Description |
---|---|---|
positions | Position & { sum_unitary_funding : number }[] | The array of positions. |
number
The total unrealized profit or loss of all positions.
▸ unrealizedPnL(inputs
): number
Calculates the unrealized profit or loss of a single position.
Name | Type | Description |
---|---|---|
inputs | UnrealPnLInputs | The inputs for calculating the unrealized profit or loss. |
number
The unrealized profit or loss of the position.
▸ unrealizedPnLROI(inputs
): number
Calculates the return on investment (ROI) of a single position’s unrealized profit or loss.
Name | Type | Description |
---|---|---|
inputs | UnrealPnLROIInputs | The inputs for calculating the ROI. |
number
The ROI of the position’s unrealized profit or loss.
▸ unsettlementPnL(inputs
): number
Calculates the unrealized profit or loss of each position.
Name | Type | Description |
---|---|---|
inputs | UnsettlementPnLInputs | The inputs for calculating the unrealized profit or loss. |
number
The unrealized profit or loss of each position.