Namespace: positions
@orderly.network/perp.positionsTable of contents
Type Aliases
- LiqPriceInputs
- MMInputs
- MMRInputs
- TotalUnsettlementPnLInputs
- UnrealPnLInputs
- UnrealPnLROIInputs
- UnsettlementPnLInputs
Functions
- MMR
- estOffsetForTP
- estPnLForSL
- estPnLForTP
- estPriceForTP
- estPriceFromOffsetForTP
- liqPrice
- maintenanceMargin
- notional
- totalNotional
- totalUnrealizedPnL
- totalUnsettlementPnL
- unrealizedPnL
- unrealizedPnLROI
- unsettlementPnL
Type Aliases
LiqPriceInputs
Ƭ LiqPriceInputs:Object
Type declaration
Defined in
positions.ts:89MMInputs
Ƭ MMInputs:Object
Type declaration
Defined in
positions.ts:130MMRInputs
Ƭ MMRInputs:Object
Type declaration
Defined in
positions.ts:213TotalUnsettlementPnLInputs
Ƭ TotalUnsettlementPnLInputs:Object
Type declaration
Defined in
positions.ts:178UnrealPnLInputs
Ƭ UnrealPnLInputs:Object
Type declaration
Defined in
positions.ts:26UnrealPnLROIInputs
Ƭ UnrealPnLROIInputs:Object
Type declaration
Defined in
positions.ts:43UnsettlementPnLInputs
Ƭ UnsettlementPnLInputs:Object
Type declaration
Defined in
positions.ts:147Functions
MMR
▸ MMR(inputs): number
Calculates the maintenance margin requirement (MMR) of a position.
Parameters
Returns
number
The MMR of the position.
Defined in
positions.ts:226estOffsetForTP
▸ estOffsetForTP(inputs): number
Calculates the estimated offset for take profit.
Parameters
Returns
number
Defined in
positions.ts:276estPnLForSL
▸ estPnLForSL(inputs): number
Calculates the PnL for stop loss.
Parameters
Returns
number
Defined in
positions.ts:296estPnLForTP
▸ estPnLForTP(inputs): number
Calculates the profit or loss for take profit.
Parameters
Returns
number
The profit or loss for take profit.
Defined in
positions.ts:249estPriceForTP
▸ estPriceForTP(inputs): number
Calculates the estimated price for take profit.
Parameters
Returns
number
Defined in
positions.ts:262estPriceFromOffsetForTP
▸ estPriceFromOffsetForTP(inputs): number
Calculates the estimated price from offset for take profit.
Parameters
Returns
number
Defined in
positions.ts:286liqPrice
▸ liqPrice(inputs): number | null
Calculates the liquidation price of a single position.
Parameters
Returns
number | null
The liquidation price of the position.
Defined in
positions.ts:102maintenanceMargin
▸ maintenanceMargin(inputs): number
Calculates the maintenance margin of a position.
Parameters
Returns
number
The maintenance margin of the position.
Defined in
positions.ts:141notional
▸ notional(qty, mark_price): number
Calculates the notional value of a single position.
Parameters
Returns
number
The notional value of the position.
Defined in
positions.ts:11totalNotional
▸ totalNotional(positions): number
Calculates the total notional value of all positions.
Parameters
Returns
number
The total notional value of all positions.
Defined in
positions.ts:20totalUnrealizedPnL
▸ totalUnrealizedPnL(positions): number
Calculates the total unrealized profit or loss of all positions.
Parameters
Returns
number
The total unrealized profit or loss of all positions.
Defined in
positions.ts:76totalUnsettlementPnL
▸ totalUnsettlementPnL(positions): number
Calculates the total unrealized profit or loss of all positions.
Parameters
Returns
number
The total unrealized profit or loss of all positions.
Defined in
positions.ts:190unrealizedPnL
▸ unrealizedPnL(inputs): number
Calculates the unrealized profit or loss of a single position.
Parameters
Returns
number
The unrealized profit or loss of the position.
Defined in
positions.ts:37unrealizedPnLROI
▸ unrealizedPnLROI(inputs): number
Calculates the return on investment (ROI) of a single position’s unrealized profit or loss.
Parameters
Returns
number
The ROI of the position’s unrealized profit or loss.
Defined in
positions.ts:55unsettlementPnL
▸ unsettlementPnL(inputs): number
Calculates the unrealized profit or loss of each position.
Parameters
Returns
number
The unrealized profit or loss of each position.