Accounts, Positions, and Assets

Example context

import { createClientConfig, TradeClient } from '@tigeropenapi/tigeropen';

const config = createClientConfig();
const tradeClient = TradeClient.fromConfig(config, config.account, config.secretKey);

getPositions

Signature

async getPositions(req?: PositionsRequest): Promise<Position[]>

Purpose

Gets positions.

Parameters, defaults, and constraints

ParameterTypeRequiredSDK defaultConstraints
reqPositionsRequestNoNoneNone.
req.accountstring | undefinedNoTradeClient account when omitted or emptyNone.
req.secretKeystring | undefinedNoNoneInstitution account secret key. Overrides the default set in ClientConfig; omit to use the config default.
req.secTypestring | undefinedNoNoneNone.
req.currencystring | undefinedNoNoneNone.
req.marketstring | undefinedNoNoneNone.
req.symbolstring | undefinedNoNoneNone.
req.subAccountsstring[] | undefinedNoNoneNone.
req.expirystring | undefinedNoNoneNone.
req.strikestring | undefinedNoNoneNone.
req.rightstring | undefinedNoNoneNone.
req.assetQuoteTypestring | undefinedNoNoneNone.
req.langstring | undefinedNoNoneNone.

Returns

Promise<Position[]>

FieldTypeDescription
accountstringAccount
symbolstringSymbol code
secTypestringSecurity type
marketstringMarket
currencystringCurrency
positionnumberPosition quantity
positionScalenumberPosition scale
positionQtynumberPosition share quantity
salableQtynumberSalable quantity
averageCostnumberAverage cost
averageCostByAveragenumberAverage cost (average method)
averageCostOfCarrynumberAverage cost (cost of carry method)
marketValuenumberMarket value
realizedPnlnumberRealized P&L
realizedPnlByAveragenumberRealized P&L (average method)
unrealizedPnlnumberUnrealized P&L
unrealizedPnlByAveragenumberUnrealized P&L (average method)
unrealizedPnlByCostOfCarrynumberUnrealized P&L (cost of carry)
unrealizedPnlPercentnumberUnrealized P&L %
unrealizedPnlPercentByAveragenumberUnrealized P&L % (average method)
unrealizedPnlPercentByCostOfCarrynumberUnrealized P&L % (cost of carry)
contractIdnumberContract ID
identifierstringIdentifier
namestringName
latestPricenumberLatest price
lastClosePricenumberLast close price
multipliernumberContract multiplier
statusnumberTrading status
updateTimestampnumberUpdate timestamp
mmPercentnumberMaintenance margin %
mmValuenumberMaintenance margin value
todayPnlnumberToday's P&L
todayPnlPercentnumberToday's P&L %
comboTypesstring[]Combo types
categoriesstring[]Categories

Type-checked example

const result = await tradeClient.getPositions({ market: 'US', secType: 'STK' });
console.log(result);

Response example

[
  {
    "account": "string",
    "symbol": "string",
    "secType": "string",
    "market": "string",
    "currency": "string",
    "position": 0,
    "positionScale": 0,
    "positionQty": 0,
    "salableQty": 0,
    "averageCost": 0,
    "averageCostByAverage": 0,
    "averageCostOfCarry": 0,
    "marketValue": 0,
    "realizedPnl": 0,
    "realizedPnlByAverage": 0,
    "unrealizedPnl": 0,
    "unrealizedPnlByAverage": 0,
    "unrealizedPnlByCostOfCarry": 0,
    "unrealizedPnlPercent": 0,
    "unrealizedPnlPercentByAverage": 0,
    "unrealizedPnlPercentByCostOfCarry": 0,
    "contractId": 0,
    "identifier": "string",
    "name": "string",
    "latestPrice": 0,
    "lastClosePrice": 0,
    "multiplier": 0,
    "status": 0,
    "updateTimestamp": 0,
    "mmPercent": 0,
    "mmValue": 0,
    "todayPnl": 0,
    "todayPnlPercent": 0,
    "comboTypes": [
      "string"
    ],
    "categories": [
      "string"
    ]
  }
]

Rate limit: The base limit is 60 requests per minute.


getAssets

Signature

async getAssets(req?: AssetsRequest): Promise<Asset[]>

Purpose

Gets assets.

Parameters, defaults, and constraints

ParameterTypeRequiredSDK defaultConstraints
reqAssetsRequestNoNoneNone.
req.accountstring | undefinedNoTradeClient account when omitted or emptyNone.
req.secretKeystring | undefinedNoNoneInstitution account secret key. Overrides the default set in ClientConfig; omit to use the config default.
req.subAccountsstring[] | undefinedNoNoneNone.
req.segmentboolean | undefinedNoNoneNone.
req.marketValueboolean | undefinedNoNoneNone.
req.langstring | undefinedNoNoneNone.

Returns

Promise<Asset[]>

FieldTypeDescription
accountstringAccount
capabilitystringAccount capability (e.g. RegTMargin)
currencystringCurrency
buyingPowernumberBuying power
cashValuenumberCash value
netLiquidationnumberNet liquidation value
realizedPnLnumberRealized P&L
unrealizedPnLnumberUnrealized P&L
segmentsAssetSegment[]Account segments

Type-checked example

const result = await tradeClient.getAssets({ segment: true, marketValue: true });
console.log(result);

Response example

[
  {
    "account": "string",
    "capability": "string",
    "currency": "string",
    "buyingPower": 0,
    "cashValue": 0,
    "netLiquidation": 0,
    "realizedPnL": 0,
    "unrealizedPnL": 0,
    "segments": [
      {
        "account": "string",
        "category": "string",
        "title": "string",
        "netLiquidation": 0,
        "cashValue": 0,
        "availableFunds": 0,
        "equityWithLoan": 0,
        "excessLiquidity": 0,
        "accruedCash": 0,
        "accruedDividend": 0,
        "initMarginReq": 0,
        "maintMarginReq": 0,
        "grossPositionValue": 0,
        "leverage": 0
      }
    ]
  }
]

Rate limit: The base limit is 60 requests per minute.


getPrimeAssets

Signature

async getPrimeAssets(req?: AssetsRequest): Promise<PrimeAsset | undefined>

Purpose

Gets prime assets.

Parameters, defaults, and constraints

ParameterTypeRequiredSDK defaultConstraints
reqAssetsRequestNoNoneNone.
req.accountstring | undefinedNoTradeClient account when omitted or emptyNone.
req.secretKeystring | undefinedNoNoneInstitution account secret key. Overrides the default set in ClientConfig; omit to use the config default.
req.subAccountsstring[] | undefinedNoNoneNone.
req.segmentboolean | undefinedNoNoneNone.
req.marketValueboolean | undefinedNoNoneNone.
req.langstring | undefinedNoNoneNone.

Returns

Promise<PrimeAsset | undefined>

FieldTypeDescription
accountIdstringAccount ID
updateTimestampnumberUpdate timestamp
segmentsPrimeAssetSegment[]Account segments

Type-checked example

const result = await tradeClient.getPrimeAssets({ segment: true, marketValue: true });
console.log(result);

Response example

{
  "accountId": "string",
  "updateTimestamp": 0,
  "segments": [
    {
      "capability": "string",
      "category": "string",
      "currency": "string",
      "cashBalance": 0,
      "cashAvailableForTrade": 0,
      "grossPositionValue": 0,
      "equityWithLoan": 0,
      "netLiquidation": 0,
      "initMargin": 0,
      "maintainMargin": 0,
      "overnightMargin": 0,
      "unrealizedPL": 0,
      "unrealizedPLByCostOfCarry": 0,
      "realizedPL": 0,
      "totalTodayPL": 0,
      "excessLiquidation": 0,
      "overnightLiquidation": 0,
      "buyingPower": 0,
      "lockedFunds": 0,
      "leverage": 0,
      "uncollected": 0,
      "currencyAssets": [
        {
          "currency": "string",
          "cashBalance": 0,
          "cashAvailableForTrade": 0,
          "forexRate": 0
        }
      ],
      "consolidatedSegTypes": [
        "string"
      ]
    }
  ]
}

Rate limit: The base limit is 60 requests per minute.


getManagedAccounts

Signature

async getManagedAccounts(req?: ManagedAccountsRequest): Promise<ManagedAccount[]>

Purpose

Gets managed accounts.

Parameters, defaults, and constraints

ParameterTypeRequiredSDK defaultConstraints
reqManagedAccountsRequestNoNoneNone.
req.accountstring | undefinedNoTradeClient account when omitted or emptyNone.
req.secretKeystring | undefinedNoNoneInstitution account secret key. Overrides the default set in ClientConfig; omit to use the config default.
req.langstring | undefinedNoNoneNone.

Returns

Promise<ManagedAccount[]>

FieldTypeDescription
accountstringAccount
accountTypestringAccount type
capabilitystringAccount capability (e.g. RegTMargin)
statusstringTrading status

Type-checked example

const result = await tradeClient.getManagedAccounts({ lang: 'en_US' });
console.log(result);

Response example

[
  {
    "account": "string",
    "accountType": "string",
    "capability": "string",
    "status": "string"
  }
]

Rate limit: The base limit is 60 requests per minute.


getAnalyticsAsset

Signature

async getAnalyticsAsset(req: AnalyticsAssetRequest): Promise<AnalyticsAsset[]>

Purpose

Gets analytics asset.

Parameters, defaults, and constraints

ParameterTypeRequiredSDK defaultConstraints
reqAnalyticsAssetRequestYesNoneNone.
req.accountstring | undefinedNoTradeClient account when omitted or emptyNone.
req.secretKeystring | undefinedNoNoneInstitution account secret key. Overrides the default set in ClientConfig; omit to use the config default.
req.segTypestring | undefinedNoNoneNone.
req.startDatestring | undefinedNoNoneFormat: YYYY-MM-DD
req.endDatestring | undefinedNoNoneNone.
req.langstring | undefinedNoNoneNone.

Returns

Promise<AnalyticsAsset[]>

FieldTypeDescription
datestringDate
holdingValuenumberHolding value
cashBalancenumberCash balance
pnlnumberP&L
pnlRatenumberP&L rate
netValueIndexnumberNet value index
currencystringCurrency
segTypestringSegment type

Type-checked example

const result = await tradeClient.getAnalyticsAsset({ segType: 'SEC', startDate: '2026-01-01', endDate: '2026-01-31' });
console.log(result);

Response example

[
  {
    "date": "string",
    "holdingValue": 0,
    "cashBalance": 0,
    "pnl": 0,
    "pnlRate": 0,
    "netValueIndex": 0,
    "currency": "string",
    "segType": "string"
  }
]

getAggregateAssets

Signature

async getAggregateAssets(req?: AggregateAssetsRequest): Promise<AggregateAssets | undefined>

Purpose

Gets aggregate assets.

Parameters, defaults, and constraints

ParameterTypeRequiredSDK defaultConstraints
reqAggregateAssetsRequestNoNoneNone.
req.accountstring | undefinedNoTradeClient account when omitted or emptyNone.
req.secretKeystring | undefinedNoNoneInstitution account secret key. Overrides the default set in ClientConfig; omit to use the config default.
req.baseCurrencystring | undefinedNoNoneNone.
req.segTypestring | undefinedNoNoneNone.
req.langstring | undefinedNoNoneNone.

Returns

Promise<AggregateAssets | undefined>

FieldTypeDescription
accountIdstringAccount ID
netLiquidationnumberNet liquidation value
grossPositionValuenumberGross position value
cashBalancenumberCash balance
baseCurrencystringBase currency
currencyAssetsCurrencyAsset[]Currency assets

Type-checked example

const result = await tradeClient.getAggregateAssets({ baseCurrency: 'USD' });
console.log(result);

Response example

{
  "accountId": "string",
  "netLiquidation": 0,
  "grossPositionValue": 0,
  "cashBalance": 0,
  "baseCurrency": "string",
  "currencyAssets": [
    {
      "currency": "string",
      "cashBalance": 0,
      "cashAvailableForTrade": 0,
      "forexRate": 0
    }
  ]
}

Rate limit: The base limit is 60 requests per minute.


getEstimateTradableQuantity

Signature

async getEstimateTradableQuantity(req: EstimateTradableQuantityRequest): Promise<EstimateTradableQuantity | undefined>

Purpose

Gets estimate tradable quantity.

Parameters, defaults, and constraints

ParameterTypeRequiredSDK defaultConstraints
reqEstimateTradableQuantityRequestYesNoneNone.
req.accountstring | undefinedNoTradeClient account when omitted or emptyNone.
req.secretKeystring | undefinedNoNoneInstitution account secret key. Overrides the default set in ClientConfig; omit to use the config default.
req.symbolstringYesNoneNone.
req.secTypestringYesNoneNone.
req.actionstringYesNoneNone.
req.orderTypestring | undefinedNoNoneNone.
req.limitPricenumber | undefinedNoNoneNone.
req.marketstring | undefinedNoNoneNone.
req.currencystring | undefinedNoNoneNone.
req.expirystring | undefinedNoNoneNone.
req.strikestring | undefinedNoNoneNone.
req.rightstring | undefinedNoNoneNone.
req.langstring | undefinedNoNoneNone.

Returns

Promise<EstimateTradableQuantity | undefined>

FieldTypeDescription
tradableQuantitynumberTradable quantity
maxCashBuyQuantitynumberMax cash buy quantity
maxMarginBuyQuantitynumberMax margin buy quantity
maxShortSellQuantitynumberMax short sell quantity
maxPositionSellQuantitynumberMax position sell quantity
cashBuyingPowernumberCash buying power
currencystringCurrency

Type-checked example

const result = await tradeClient.getEstimateTradableQuantity({ symbol: 'AAPL', secType: 'STK', action: 'BUY' });
console.log(result);

Response example

{
  "tradableQuantity": 0,
  "maxCashBuyQuantity": 0,
  "maxMarginBuyQuantity": 0,
  "maxShortSellQuantity": 0,
  "maxPositionSellQuantity": 0,
  "cashBuyingPower": 0,
  "currency": "string"
}

Rate limit: The base limit is 60 requests per minute.


Did this page help you?