> ## Documentation Index
> Fetch the complete documentation index at: https://orderly.network/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Orderly network perp.account

[Orderly SDKs](/sdks/tech-doc/README) / [Modules](/sdks/tech-doc/modules) / [@orderly.network/perp](/sdks/tech-doc/modules/orderly_network_perp) / account

# Namespace: account

[@orderly.network/perp](/sdks/tech-doc/modules/orderly_network_perp).account

## Table of contents

### Type Aliases

* [AccountMMRInputs](/sdks/tech-doc/modules/orderly_network_perp.account#accountmmrinputs)
* [AvailableBalanceInputs](/sdks/tech-doc/modules/orderly_network_perp.account#availablebalanceinputs)
* [FreeCollateralInputs](/sdks/tech-doc/modules/orderly_network_perp.account#freecollateralinputs)
* [IMRInputs](/sdks/tech-doc/modules/orderly_network_perp.account#imrinputs)
* [MaxQtyInputs](/sdks/tech-doc/modules/orderly_network_perp.account#maxqtyinputs)
* [OtherIMsInputs](/sdks/tech-doc/modules/orderly_network_perp.account#otherimsinputs)
* [PositionNotionalWithOrderInputs](/sdks/tech-doc/modules/orderly_network_perp.account#positionnotionalwithorderinputs)
* [PositionQtyWithOrderInputs](/sdks/tech-doc/modules/orderly_network_perp.account#positionqtywithorderinputs)
* [ResultOptions](/sdks/tech-doc/modules/orderly_network_perp.account#resultoptions)
* [TotalCollateralValueInputs](/sdks/tech-doc/modules/orderly_network_perp.account#totalcollateralvalueinputs)
* [TotalInitialMarginWithOrdersInputs](/sdks/tech-doc/modules/orderly_network_perp.account#totalinitialmarginwithordersinputs)
* [TotalMarginRatioInputs](/sdks/tech-doc/modules/orderly_network_perp.account#totalmarginratioinputs)
* [TotalUnrealizedROIInputs](/sdks/tech-doc/modules/orderly_network_perp.account#totalunrealizedroiinputs)
* [TotalValueInputs](/sdks/tech-doc/modules/orderly_network_perp.account#totalvalueinputs)

### Functions

* [IMR](/sdks/tech-doc/modules/orderly_network_perp.account#imr)
* [MMR](/sdks/tech-doc/modules/orderly_network_perp.account#mmr)
* [availableBalance](/sdks/tech-doc/modules/orderly_network_perp.account#availablebalance)
* [buyOrdersFilter\_by\_symbol](/sdks/tech-doc/modules/orderly_network_perp.account#buyordersfilter_by_symbol)
* [currentLeverage](/sdks/tech-doc/modules/orderly_network_perp.account#currentleverage)
* [extractSymbols](/sdks/tech-doc/modules/orderly_network_perp.account#extractsymbols)
* [freeCollateral](/sdks/tech-doc/modules/orderly_network_perp.account#freecollateral)
* [getPositonsAndOrdersNotionalBySymbol](/sdks/tech-doc/modules/orderly_network_perp.account#getpositonsandordersnotionalbysymbol)
* [getQtyFromOrdersBySide](/sdks/tech-doc/modules/orderly_network_perp.account#getqtyfromordersbyside)
* [getQtyFromPositions](/sdks/tech-doc/modules/orderly_network_perp.account#getqtyfrompositions)
* [groupOrdersBySymbol](/sdks/tech-doc/modules/orderly_network_perp.account#groupordersbysymbol)
* [initialMarginWithOrder](/sdks/tech-doc/modules/orderly_network_perp.account#initialmarginwithorder)
* [maxQty](/sdks/tech-doc/modules/orderly_network_perp.account#maxqty)
* [maxQtyByLong](/sdks/tech-doc/modules/orderly_network_perp.account#maxqtybylong)
* [maxQtyByShort](/sdks/tech-doc/modules/orderly_network_perp.account#maxqtybyshort)
* [otherIMs](/sdks/tech-doc/modules/orderly_network_perp.account#otherims)
* [positionNotionalWithOrder\_by\_symbol](/sdks/tech-doc/modules/orderly_network_perp.account#positionnotionalwithorder_by_symbol)
* [positionQtyWithOrders\_by\_symbol](/sdks/tech-doc/modules/orderly_network_perp.account#positionqtywithorders_by_symbol)
* [sellOrdersFilter\_by\_symbol](/sdks/tech-doc/modules/orderly_network_perp.account#sellordersfilter_by_symbol)
* [totalCollateral](/sdks/tech-doc/modules/orderly_network_perp.account#totalcollateral)
* [totalInitialMarginWithOrders](/sdks/tech-doc/modules/orderly_network_perp.account#totalinitialmarginwithorders)
* [totalInitialMarginWithQty](/sdks/tech-doc/modules/orderly_network_perp.account#totalinitialmarginwithqty)
* [totalMarginRatio](/sdks/tech-doc/modules/orderly_network_perp.account#totalmarginratio)
* [totalUnrealizedROI](/sdks/tech-doc/modules/orderly_network_perp.account#totalunrealizedroi)
* [totalValue](/sdks/tech-doc/modules/orderly_network_perp.account#totalvalue)

## Type Aliases

### AccountMMRInputs

Ƭ **AccountMMRInputs**: `Object`

#### Type declaration

| Name                | Type     | Description                                              |
| :------------------ | :------- | :------------------------------------------------------- |
| `positionsMMR`      | `number` | -                                                        |
| `positionsNotional` | `number` | Notional sum of all positions, positions.totalNotional() |

#### Defined in

[account.ts:718](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L718)

***

### AvailableBalanceInputs

Ƭ **AvailableBalanceInputs**: `Object`

#### Type declaration

| Name              | Type     |
| :---------------- | :------- |
| `USDCHolding`     | `number` |
| `unsettlementPnL` | `number` |

#### Defined in

[account.ts:708](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L708)

***

### FreeCollateralInputs

Ƭ **FreeCollateralInputs**: `Object`

Total value of available collateral in the user's account (denominated in USDC).

#### Type declaration

| Name                           | Type      |
| :----------------------------- | :-------- |
| `totalCollateral`              | `Decimal` |
| `totalInitialMarginWithOrders` | `number`  |

#### Defined in

[account.ts:41](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L41)

***

### IMRInputs

Ƭ **IMRInputs**: `Object`

#### Type declaration

| Name                | Type     |
| :------------------ | :------- |
| `IMR_Factor`        | `number` |
| `IMR_factor_power?` | `number` |
| `baseIMR`           | `number` |
| `maxLeverage`       | `number` |
| `ordersNotional`    | `number` |
| `positionNotional`  | `number` |

#### Defined in

[account.ts:123](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L123)

***

### MaxQtyInputs

Ƭ **MaxQtyInputs**: `Object`

#### Type declaration

| Name              | Type     | Description                                                                                                           |
| :---------------- | :------- | :-------------------------------------------------------------------------------------------------------------------- |
| `IMR_Factor`      | `number` | -                                                                                                                     |
| `baseIMR`         | `number` | -                                                                                                                     |
| `baseMaxQty`      | `number` | -                                                                                                                     |
| `buyOrdersQty`    | `number` | -                                                                                                                     |
| `markPrice`       | `number` | -                                                                                                                     |
| `maxLeverage`     | `number` | -                                                                                                                     |
| `otherIMs`        | `number` | **`See`** otherIMs                                                                                                    |
| `positionQty`     | `number` | -                                                                                                                     |
| `sellOrdersQty`   | `number` | -                                                                                                                     |
| `symbol`          | `string` | -                                                                                                                     |
| `takerFeeRate`    | `number` | -                                                                                                                     |
| `totalCollateral` | `number` | Total collateral of the user (denominated in USDC), can be calculated from totalCollateral. **`See`** totalCollateral |

#### Defined in

[account.ts:483](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L483)

***

### OtherIMsInputs

Ƭ **OtherIMsInputs**: `Object`

#### Type declaration

| Name          | Type                                                                          |
| :------------ | :---------------------------------------------------------------------------- |
| `IMR_Factors` | \{ `[key: string]`: `number`; }                                               |
| `markPrices`  | \{ `[key: string]`: `number`; }                                               |
| `maxLeverage` | `number`                                                                      |
| `orders`      | [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[]       |
| `positions`   | [`Position`](/sdks/tech-doc/interfaces/orderly_network_types.API.Position)\[] |
| `symbolInfo`  | `any`                                                                         |

#### Defined in

[account.ts:396](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L396)

***

### PositionNotionalWithOrderInputs

Ƭ **PositionNotionalWithOrderInputs**: `Object`

#### Type declaration

| Name                    | Type     |
| :---------------------- | :------- |
| `markPrice`             | `number` |
| `positionQtyWithOrders` | `number` |

#### Defined in

[account.ts:87](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L87)

***

### PositionQtyWithOrderInputs

Ƭ **PositionQtyWithOrderInputs**: `Object`

#### Type declaration

| Name            | Type     |
| :-------------- | :------- |
| `buyOrdersQty`  | `number` |
| `positionQty`   | `number` |
| `sellOrdersQty` | `number` |

#### Defined in

[account.ts:100](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L100)

***

### ResultOptions

Ƭ **ResultOptions**: `Object`

#### Type declaration

| Name | Type     |
| :--- | :------- |
| `dp` | `number` |

#### Defined in

[account.ts:10](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L10)

***

### TotalCollateralValueInputs

Ƭ **TotalCollateralValueInputs**: `Object`

#### Type declaration

| Name              | Type                                                                       |
| :---------------- | :------------------------------------------------------------------------- |
| `USDCHolding`     | `number`                                                                   |
| `nonUSDCHolding`  | \{ `discount`: `number` ; `holding`: `number` ; `markPrice`: `number` }\[] |
| `unsettlementPnL` | `number`                                                                   |

#### Defined in

[account.ts:56](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L56)

***

### TotalInitialMarginWithOrdersInputs

Ƭ **TotalInitialMarginWithOrdersInputs**: \{ `IMR_Factors`: \{ `[key: string]`: `number`; } ; `markPrices`: \{ `[key: string]`: `number`; } ; `orders`: [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[] ; `positions`: [`Position`](/sdks/tech-doc/interfaces/orderly_network_types.API.Position)\[] ; `symbolInfo`: `any` } & `Pick`\<[`IMRInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#imrinputs), `"maxLeverage"`>

#### Defined in

[account.ts:228](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L228)

***

### TotalMarginRatioInputs

Ƭ **TotalMarginRatioInputs**: `Object`

#### Type declaration

| Name              | Type                                                                          |
| :---------------- | :---------------------------------------------------------------------------- |
| `markPrices`      | \{ `[key: string]`: `number`; }                                               |
| `positions`       | [`Position`](/sdks/tech-doc/interfaces/orderly_network_types.API.Position)\[] |
| `totalCollateral` | `number`                                                                      |

#### Defined in

[account.ts:650](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L650)

***

### TotalUnrealizedROIInputs

Ƭ **TotalUnrealizedROIInputs**: `Object`

#### Type declaration

| Name                 | Type     |
| :------------------- | :------- |
| `totalUnrealizedPnL` | `number` |
| `totalValue`         | `number` |

#### Defined in

[account.ts:682](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L682)

***

### TotalValueInputs

Ƭ **TotalValueInputs**: `Object`

#### Type declaration

| Name                   | Type                                                                       |
| :--------------------- | :------------------------------------------------------------------------- |
| `USDCHolding`          | `number`                                                                   |
| `nonUSDCHolding`       | \{ `discount`: `number` ; `holding`: `number` ; `markPrice`: `number` }\[] |
| `totalUnsettlementPnL` | `number`                                                                   |

#### Defined in

[account.ts:14](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L14)

## Functions

### IMR

▸ **IMR**(`inputs`): `number`

Initial margin rate for a symbol.
Max(1 / Max Account Leverage, Base IMR i, IMR Factor i \* Abs(Position Notional i + Order Notional i)^(4/5))

#### Parameters

| Name     | Type                                                                         |
| :------- | :--------------------------------------------------------------------------- |
| `inputs` | [`IMRInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#imrinputs) |

#### Returns

`number`

#### Defined in

[account.ts:136](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L136)

***

### MMR

▸ **MMR**(`inputs`): `number` | `null`

total maintenance margin ratio

#### Parameters

| Name     | Type                                                                                       | Description      |
| :------- | :----------------------------------------------------------------------------------------- | :--------------- |
| `inputs` | [`AccountMMRInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#accountmmrinputs) | AccountMMRInputs |

#### Returns

`number` | `null`

number|null

#### Defined in

[account.ts:733](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L733)

***

### availableBalance

▸ **availableBalance**(`inputs`): `number`

#### Parameters

| Name     | Type                                                                                                   |
| :------- | :----------------------------------------------------------------------------------------------------- |
| `inputs` | [`AvailableBalanceInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#availablebalanceinputs) |

#### Returns

`number`

#### Defined in

[account.ts:712](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L712)

***

### buyOrdersFilter\_by\_symbol

▸ **buyOrdersFilter\_by\_symbol**(`orders`, `symbol`): [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[]

#### Parameters

| Name     | Type                                                                    |
| :------- | :---------------------------------------------------------------------- |
| `orders` | [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[] |
| `symbol` | `string`                                                                |

#### Returns

[`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[]

#### Defined in

[account.ts:159](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L159)

***

### currentLeverage

▸ **currentLeverage**(`totalMarginRatio`): `number`

current account leverage

#### Parameters

| Name               | Type     |
| :----------------- | :------- |
| `totalMarginRatio` | `number` |

#### Returns

`number`

#### Defined in

[account.ts:701](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L701)

***

### extractSymbols

▸ **extractSymbols**(`positions`, `orders`): `string`\[]

Extracts all unique symbols from positions and orders.

#### Parameters

| Name        | Type                                                                                               | Description                   |
| :---------- | :------------------------------------------------------------------------------------------------- | :---------------------------- |
| `positions` | `Pick`\<[`Position`](/sdks/tech-doc/interfaces/orderly_network_types.API.Position), `"symbol"`>\[] | An array of position objects. |
| `orders`    | `Pick`\<[`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order), `"symbol"`>\[]       | An array of order objects.    |

#### Returns

`string`\[]

An array of unique symbols.

#### Defined in

[account.ts:375](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L375)

***

### freeCollateral

▸ **freeCollateral**(`inputs`): `Decimal`

Calculate free collateral.

#### Parameters

| Name     | Type                                                                                               |
| :------- | :------------------------------------------------------------------------------------------------- |
| `inputs` | [`FreeCollateralInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#freecollateralinputs) |

#### Returns

`Decimal`

#### Defined in

[account.ts:50](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L50)

***

### getPositonsAndOrdersNotionalBySymbol

▸ **getPositonsAndOrdersNotionalBySymbol**(`inputs`): `number`

#### Parameters

| Name               | Type                                                                          |
| :----------------- | :---------------------------------------------------------------------------- |
| `inputs`           | `Object`                                                                      |
| `inputs.markPrice` | `number`                                                                      |
| `inputs.orders`    | [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[]       |
| `inputs.positions` | [`Position`](/sdks/tech-doc/interfaces/orderly_network_types.API.Position)\[] |
| `inputs.symbol`    | `string`                                                                      |

#### Returns

`number`

#### Defined in

[account.ts:208](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L208)

***

### getQtyFromOrdersBySide

▸ **getQtyFromOrdersBySide**(`orders`, `symbol`, `side`): `number`

Get the quantity of long and short orders for a specified symbol from the list of orders.

#### Parameters

| Name     | Type                                                                    |
| :------- | :---------------------------------------------------------------------- |
| `orders` | [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[] |
| `symbol` | `string`                                                                |
| `side`   | [`OrderSide`](/sdks/tech-doc/enums/orderly_network_types.OrderSide)     |

#### Returns

`number`

#### Defined in

[account.ts:194](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L194)

***

### getQtyFromPositions

▸ **getQtyFromPositions**(`positions`, `symbol`): `number`

Get the quantity of a specified symbol from the list of positions.

#### Parameters

| Name        | Type                                                                          |
| :---------- | :---------------------------------------------------------------------------- |
| `positions` | [`Position`](/sdks/tech-doc/interfaces/orderly_network_types.API.Position)\[] |
| `symbol`    | `string`                                                                      |

#### Returns

`number`

#### Defined in

[account.ts:180](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L180)

***

### groupOrdersBySymbol

▸ **groupOrdersBySymbol**(`orders`): `Object`

Group orders by symbol, as a symbol can have multiple orders.

#### Parameters

| Name     | Type                                                                    |
| :------- | :---------------------------------------------------------------------- |
| `orders` | [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[] |

#### Returns

`Object`

#### Defined in

[account.ts:355](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L355)

***

### initialMarginWithOrder

▸ **initialMarginWithOrder**(): `void`

#### Returns

`void`

#### Defined in

[account.ts:85](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L85)

***

### maxQty

▸ **maxQty**(`side`, `inputs`, `options?`): `number`

Maximum order quantity.

#### Parameters

| Name       | Type                                                                                 |
| :--------- | :----------------------------------------------------------------------------------- |
| `side`     | [`OrderSide`](/sdks/tech-doc/enums/orderly_network_types.OrderSide)                  |
| `inputs`   | [`MaxQtyInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#maxqtyinputs)   |
| `options?` | [`ResultOptions`](/sdks/tech-doc/modules/orderly_network_perp.account#resultoptions) |

#### Returns

`number`

#### Defined in

[account.ts:515](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L515)

***

### maxQtyByLong

▸ **maxQtyByLong**(`inputs`, `options?`): `number`

#### Parameters

| Name       | Type                                                                                                  |
| :--------- | :---------------------------------------------------------------------------------------------------- |
| `inputs`   | `Omit`\<[`MaxQtyInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#maxqtyinputs), `"side"`> |
| `options?` | [`ResultOptions`](/sdks/tech-doc/modules/orderly_network_perp.account#resultoptions)                  |

#### Returns

`number`

#### Defined in

[account.ts:526](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L526)

***

### maxQtyByShort

▸ **maxQtyByShort**(`inputs`, `options?`): `number`

#### Parameters

| Name       | Type                                                                                                  |
| :--------- | :---------------------------------------------------------------------------------------------------- |
| `inputs`   | `Omit`\<[`MaxQtyInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#maxqtyinputs), `"side"`> |
| `options?` | [`ResultOptions`](/sdks/tech-doc/modules/orderly_network_perp.account#resultoptions)                  |

#### Returns

`number`

#### Defined in

[account.ts:587](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L587)

***

### otherIMs

▸ **otherIMs**(`inputs`): `number`

Total margin used by other symbols (except the current symbol).

#### Parameters

| Name     | Type                                                                                   |
| :------- | :------------------------------------------------------------------------------------- |
| `inputs` | [`OtherIMsInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#otherimsinputs) |

#### Returns

`number`

#### Defined in

[account.ts:410](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L410)

***

### positionNotionalWithOrder\_by\_symbol

▸ **positionNotionalWithOrder\_by\_symbol**(`inputs`): `Decimal`

Sum of notional value for a symbol's position and orders.

#### Parameters

| Name     | Type                                                                                                                     |
| :------- | :----------------------------------------------------------------------------------------------------------------------- |
| `inputs` | [`PositionNotionalWithOrderInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#positionnotionalwithorderinputs) |

#### Returns

`Decimal`

#### Defined in

[account.ts:94](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L94)

***

### positionQtyWithOrders\_by\_symbol

▸ **positionQtyWithOrders\_by\_symbol**(`inputs`): `number`

Sum of position quantity and orders quantity for a symbol.

#### Parameters

| Name     | Type                                                                                                           |
| :------- | :------------------------------------------------------------------------------------------------------------- |
| `inputs` | [`PositionQtyWithOrderInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#positionqtywithorderinputs) |

#### Returns

`number`

#### Defined in

[account.ts:110](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L110)

***

### sellOrdersFilter\_by\_symbol

▸ **sellOrdersFilter\_by\_symbol**(`orders`, `symbol`): [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[]

#### Parameters

| Name     | Type                                                                    |
| :------- | :---------------------------------------------------------------------- |
| `orders` | [`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[] |
| `symbol` | `string`                                                                |

#### Returns

[`Order`](/sdks/tech-doc/interfaces/orderly_network_types.API.Order)\[]

#### Defined in

[account.ts:168](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L168)

***

### totalCollateral

▸ **totalCollateral**(`inputs`): `Decimal`

Calculate total collateral.

#### Parameters

| Name     | Type                                                                                                           |
| :------- | :------------------------------------------------------------------------------------------------------------- |
| `inputs` | [`TotalCollateralValueInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#totalcollateralvalueinputs) |

#### Returns

`Decimal`

#### Defined in

[account.ts:71](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L71)

***

### totalInitialMarginWithOrders

▸ **totalInitialMarginWithOrders**(`inputs`): `number`

Calculate the total initial margin used by the user (including positions and orders).

#### Parameters

| Name     | Type                                                                                                                           |
| :------- | :----------------------------------------------------------------------------------------------------------------------------- |
| `inputs` | [`TotalInitialMarginWithOrdersInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#totalinitialmarginwithordersinputs) |

#### Returns

`number`

#### Defined in

[account.ts:240](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L240)

***

### totalInitialMarginWithQty

▸ **totalInitialMarginWithQty**(`inputs`): `number`

#### Parameters

| Name                 | Type                                                                          |
| :------------------- | :---------------------------------------------------------------------------- |
| `inputs`             | `Object`                                                                      |
| `inputs.IMR_Factors` | `Object`                                                                      |
| `inputs.markPrices`  | `Object`                                                                      |
| `inputs.maxLeverage` | `number`                                                                      |
| `inputs.positions`   | [`Position`](/sdks/tech-doc/interfaces/orderly_network_types.API.Position)\[] |
| `inputs.symbolInfo`  | `any`                                                                         |

#### Returns

`number`

#### Defined in

[account.ts:298](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L298)

***

### totalMarginRatio

▸ **totalMarginRatio**(`inputs`, `dp?`): `number`

total margin ratio

#### Parameters

| Name     | Type                                                                                                   |
| :------- | :----------------------------------------------------------------------------------------------------- |
| `inputs` | [`TotalMarginRatioInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#totalmarginratioinputs) |
| `dp?`    | `number`                                                                                               |

#### Returns

`number`

#### Defined in

[account.ts:658](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L658)

***

### totalUnrealizedROI

▸ **totalUnrealizedROI**(`inputs`): `number`

totalUnrealizedROI

#### Parameters

| Name     | Type                                                                                                       |
| :------- | :--------------------------------------------------------------------------------------------------------- |
| `inputs` | [`TotalUnrealizedROIInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#totalunrealizedroiinputs) |

#### Returns

`number`

#### Defined in

[account.ts:690](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L690)

***

### totalValue

▸ **totalValue**(`inputs`): `Decimal`

User's total asset value (denominated in USDC), including assets that cannot be used as collateral.

#### Parameters

| Name     | Type                                                                                       |
| :------- | :----------------------------------------------------------------------------------------- |
| `inputs` | [`TotalValueInputs`](/sdks/tech-doc/modules/orderly_network_perp.account#totalvalueinputs) |

#### Returns

`Decimal`

#### Defined in

[account.ts:28](https://github.com/OrderlyNetwork/js-sdk/blob/ba995f2/packages/perp/src/account.ts#L28)
