Accounts and Positions
get_managed_accounts
get_managed_accountsSignature
pub async fn get_managed_accounts( &self, req: ManagedAccountsRequest, ) -> Result<Vec<ManagedAccount>, TigerError>
Description
Institutional master account.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Vec<ManagedAccount>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| account | String | Account |
| account_type | String | Account type |
| capability | String | Account capability |
| status | String | Account status |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_managed_accounts(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_managed_accounts(ManagedAccountsRequest { ..Default::default() }).await?;
Ok(())
}
Response example
[
{
"account": "402901",
"accountType": "GLOBAL",
"capability": "RegTMargin",
"status": "TRADING"
}
]Rate limit
The base rate limit is 60 requests/min.
get_assets
get_assetsSignature
pub async fn get_assets(&self, req: AssetsRequest) -> Result<Vec<Asset>, TigerError>
Description
Account injected; segment and market value omitted by default.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.sub_accounts | Option<Vec<String>> | Optional | None (omitted) |
| req.segment | Option<bool> | Optional | None (omitted) |
| req.market_value | Option<bool> | Optional | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Vec<Asset>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| account | String | Account |
| capability | String | Account capability |
| currency | String | Currency |
| buying_power | f64 | Buying power |
| cash_value | f64 | Cash value |
| net_liquidation | f64 | Net liquidation value |
| realized_pnl | f64 | Realized P&L |
| unrealized_pnl | f64 | Unrealized P&L |
| segments | Vec<AssetSegment> | Asset segments |
AssetSegment fields:
| Field | Rust type | Description |
|---|---|---|
| account | String | Account |
| category | String | Segment category |
| title | String | Segment title |
| net_liquidation | f64 | Net liquidation value |
| cash_value | f64 | Cash value |
| available_funds | f64 | Available funds |
| equity_with_loan | f64 | Equity with loan |
| excess_liquidity | f64 | Excess liquidity |
| accrued_cash | f64 | Accrued cash |
| accrued_dividend | f64 | Accrued dividend |
| init_margin_req | f64 | Initial margin requirement |
| maint_margin_req | f64 | Maintenance margin requirement |
| gross_position_value | f64 | Gross position value |
| leverage | f64 | Leverage |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_assets(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_assets(AssetsRequest { ..Default::default() }).await?;
Ok(())
}
Response example
[
{
"account": "402901",
"capability": "RegTMargin",
"currency": "USD",
"buyingPower": 150000.0,
"cashValue": 85000.0,
"netLiquidation": 250000.0,
"realizedPnl": 3200.5,
"unrealizedPnl": 1850.75
}
]Rate limit
The base rate limit is 60 requests/min.
get_prime_assets
get_prime_assetsSignature
pub async fn get_prime_assets( &self, req: AssetsRequest, ) -> Result<Option<PrimeAsset>, TigerError>
Description
Prime accounts; same request.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.sub_accounts | Option<Vec<String>> | Optional | None (omitted) |
| req.segment | Option<bool> | Optional | None (omitted) |
| req.market_value | Option<bool> | Optional | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Option<PrimeAsset>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| account_id | String | Account ID |
| update_timestamp | i64 | Update timestamp |
| segments | Vec<PrimeAssetSegment> | Asset segments |
PrimeAssetSegment fields:
| Field | Rust type | Description |
|---|---|---|
| capability | String | Account capability |
| category | String | Segment category |
| currency | String | Currency |
| cash_balance | f64 | Cash balance |
| cash_available_for_trade | f64 | Cash available for trading |
| gross_position_value | f64 | Gross position value |
| equity_with_loan | f64 | Equity with loan |
| net_liquidation | f64 | Net liquidation value |
| init_margin | f64 | Initial margin |
| maintain_margin | f64 | Maintenance margin |
| overnight_margin | f64 | Overnight margin |
| unrealized_pl | f64 | Unrealized P&L |
| unrealized_pl_by_cost_of_carry | f64 | Unrealized P&L by cost of carry |
| realized_pl | f64 | Realized P&L |
| total_today_pl | f64 | Total P&L today |
| excess_liquidation | f64 | Excess liquidity |
| overnight_liquidation | f64 | Overnight liquidity |
| buying_power | f64 | Buying power |
| locked_funds | f64 | Locked funds |
| leverage | f64 | Leverage |
| uncollected | f64 | Uncollected funds |
| currency_assets | Vec<CurrencyAsset> | Per-currency assets |
| consolidated_seg_types | Vec<String> | Consolidated segment types |
CurrencyAsset fields:
| Field | Rust type | Description |
|---|---|---|
| currency | String | Currency |
| cash_balance | f64 | Cash balance |
| cash_available_for_trade | f64 | Cash available for trading |
| forex_rate | f64 | FX rate |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_prime_assets(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_prime_assets(AssetsRequest { ..Default::default() }).await?;
Ok(())
}
Response example
{
"accountId": "402901",
"updateTimestamp": 1738180800000,
"segments": [
{
"category": "S",
"currency": "USD",
"buyingPower": 150000.0,
"cash": 85000.0,
"grossPositionValue": 165000.0
}
]
}Rate limit
The base rate limit is 60 requests/min.
get_aggregate_assets
get_aggregate_assetsSignature
pub async fn get_aggregate_assets( &self, req: AggregateAssetsRequest, ) -> Result<Option<AggregateAssets>, TigerError>
Description
Base currency/segment optional; supported aggregate/institutional accounts only.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.base_currency | Option<String> | Optional | None (omitted) |
| req.seg_type | Option<String> | Optional | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Option<AggregateAssets>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| account_id | String | Account ID |
| net_liquidation | f64 | Net liquidation value |
| gross_position_value | f64 | Gross position value |
| cash_balance | f64 | Cash balance |
| base_currency | String | Base currency |
| currency_assets | Vec<CurrencyAsset> | Per-currency assets; see Get Prime Assets |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_aggregate_assets(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_aggregate_assets(AggregateAssetsRequest { ..Default::default() }).await?;
Ok(())
}
Response example
{
"accountId": "402901",
"netLiquidation": 250000.0,
"grossPositionValue": 165000.0,
"cashBalance": 85000.0,
"baseCurrency": "USD",
"currencyAssets": [
{
"currency": "USD",
"cashBalance": 85000.0,
"cashAvailableForTrade": 85000.0,
"forexRate": 1.0
}
]
}Rate limit
The base rate limit is 60 requests/min.
get_analytics_asset
get_analytics_assetSignature
pub async fn get_analytics_asset( &self, req: AnalyticsAssetRequest, ) -> Result<Vec<AnalyticsAsset>, TigerError>
Description
Dates are YYYY-MM-DD; segment optional.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.seg_type | Option<String> | Optional | None (omitted) |
| req.start_date | Option<String> | Optional | None (omitted) |
| req.end_date | Option<String> | Optional | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Vec<AnalyticsAsset>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| date | String | Date |
| holding_value | f64 | Holding value |
| cash_balance | f64 | Cash balance |
| pnl | f64 | P&L |
| pnl_rate | f64 | P&L rate |
| net_value_index | f64 | Net value index |
| currency | String | Currency |
| seg_type | String | Segment type |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_analytics_asset(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_analytics_asset(AnalyticsAssetRequest { ..Default::default() }).await?;
Ok(())
}
Response example
[
{
"date": "2025-01-29",
"holdingValue": 165000.0,
"cashBalance": 85000.0,
"pnl": 2350.8,
"pnlRate": 0.0142,
"netValueIndex": 1.0142,
"currency": "USD",
"segType": "SEC"
}
]get_positions
get_positionsSignature
pub async fn get_positions(&self, req: PositionsRequest) -> Result<Vec<Position>, TigerError>
Description
Account injected; filter by type, currency, market, symbol, subaccounts, and option attributes. The request object has no pagination controls.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.sec_type | Option<String> | Optional | None (omitted) |
| req.currency | Option<String> | Optional | None (omitted) |
| req.market | Option<String> | Optional | None (omitted) |
| req.symbol | Option<String> | Optional | None (omitted) |
| req.sub_accounts | Option<Vec<String>> | Optional | None (omitted) |
| req.expiry | Option<String> | Optional | None (omitted) |
| req.strike | Option<String> | Optional | None (omitted) |
| req.right | Option<String> | Optional | None (omitted) |
| req.asset_quote_type | Option<String> | Optional | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Vec<Position>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| account | Option<String> | Account |
| symbol | Option<String> | Symbol |
| sec_type | Option<String> | Security type |
| market | Option<String> | Market |
| currency | Option<String> | Currency |
| position | Option<i64> | Position quantity |
| average_cost | Option<f64> | Average cost |
| market_value | Option<f64> | Market value |
| realized_pnl | Option<f64> | Realized P&L |
| unrealized_pnl | Option<f64> | Unrealized P&L |
| unrealized_pnl_percent | Option<f64> | Unrealized P&L percentage |
| contract_id | Option<i64> | Contract ID |
| identifier | Option<String> | Contract identifier |
| name | Option<String> | Contract name |
| latest_price | Option<f64> | Latest price |
| multiplier | Option<f64> | Contract multiplier |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_positions(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_positions(PositionsRequest { ..Default::default() }).await?;
Ok(())
}
Response example
[
{
"account": "402901",
"symbol": "AAPL",
"secType": "STK",
"market": "US",
"currency": "USD",
"position": 100,
"averageCost": 178.35,
"marketValue": 19550.0
}
]Rate limit
The base rate limit is 60 requests/min.
get_estimate_tradable_quantity
get_estimate_tradable_quantitySignature
pub async fn get_estimate_tradable_quantity( &self, req: EstimateTradableQuantityRequest, ) -> Result<Option<EstimateTradableQuantity>, TigerError>
Description
Symbol/type/action required; limit price conditional; derivative fields conditional.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.symbol | Option<String> | Required by the server; not prevalidated by the SDK | None (omitted) |
| req.sec_type | Option<String> | Required by the server; not prevalidated by the SDK | None (omitted) |
| req.action | Option<String> | Required by the server; not prevalidated by the SDK | None (omitted) |
| req.order_type | Option<String> | Optional | None (omitted) |
| req.limit_price | Option<f64> | Optional | None (omitted) |
| req.market | Option<String> | Optional | None (omitted) |
| req.currency | Option<String> | Optional | None (omitted) |
| req.expiry | Option<String> | Optional | None (omitted) |
| req.strike | Option<String> | Optional | None (omitted) |
| req.right | Option<String> | Optional | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Option<EstimateTradableQuantity>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| tradable_quantity | f64 | Tradable quantity |
| max_cash_buy_quantity | f64 | Maximum cash-buy quantity |
| max_margin_buy_quantity | f64 | Maximum margin-buy quantity |
| max_short_sell_quantity | f64 | Maximum short-sell quantity |
| max_position_sell_quantity | f64 | Maximum position-sell quantity |
| cash_buying_power | f64 | Cash buying power |
| currency | String | Currency |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_estimate_tradable_quantity(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_estimate_tradable_quantity(EstimateTradableQuantityRequest { symbol: Some("AAPL".into()), sec_type: Some("STK".into()), action: Some("BUY".into()), ..Default::default() }).await?;
Ok(())
}
Response example
{
"tradableQuantity": 500,
"maxCashBuyQuantity": 430,
"maxMarginBuyQuantity": 760,
"maxShortSellQuantity": 300,
"maxPositionSellQuantity": 100,
"cashBuyingPower": 85000.0,
"currency": "USD"
}Rate limit
The base rate limit is 60 requests/min.
get_derivative_contracts
get_derivative_contractsSignature
pub async fn get_derivative_contracts( &self, req: DerivativeContractsRequest, ) -> Result<Vec<Contract>, TigerError>
Description
Symbols/type required; expiry optional.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| req.account | Option<String> | Optional; most TradeClient methods inject the default account when None | None (omitted) |
| req.symbols | Option<Vec<String>> | Optional | None (omitted) |
| req.sec_type | Option<String> | Optional | None (omitted) |
| req.expiry | Option<String> | Optional | None (omitted) |
| req.lang | Option<String> | Optional | None (omitted) |
Return
TradeClient:Result<Vec<Contract>, TigerError>.
| Field | Rust type | Description |
|---|---|---|
| contract_id | Option<i64> | Contract ID |
| symbol | String | Symbol |
| sec_type | String | Security type |
| currency | Option<String> | Currency |
| exchange | Option<String> | Exchange |
| primary_exchange | Option<String> | Primary exchange |
| expiry | Option<String> | Expiration date |
| strike | Option<f64> | Strike price |
| right | Option<String> | PUT/CALL |
| multiplier | Option<f64> | Contract multiplier |
| identifier | Option<String> | Contract identifier |
| name | Option<String> | Contract name |
| market | Option<String> | Market |
| tradeable | Option<bool> | Whether tradeable |
| conid | Option<i64> | Internal contract ID |
| short_margin | Option<f64> | Short margin ratio |
| short_initial_margin | Option<f64> | Short initial margin ratio |
| short_maintenace_margin | Option<f64> | Short maintenance margin ratio; Rust field spelling is retained from the SDK |
| long_initial_margin | Option<f64> | Long initial margin |
| long_maintenace_margin | Option<f64> | Long maintenance margin; Rust field spelling is retained from the SDK |
| tick_sizes | Option<Vec<TickSize>> | Minimum tick-size ranges |
| lot_size | Option<f64> | Lot size |
TickSize fields:
| Field | Rust type | Description |
|---|---|---|
| begin | Option<String> | Range start price |
| end | Option<String> | Range end price |
| tick_size | Option<f64> | Minimum tick size |
| r#type | Option<String> | Range type |
Example
use std::sync::Arc;
use tigeropen::client::http_client::HttpClient;
use tigeropen::config::ClientConfig;
use tigeropen::error::TigerError;
use tigeropen::model::order::*;
use tigeropen::model::quote::*;
use tigeropen::model::quote_requests::*;
use tigeropen::model::trade_requests::*;
use tigeropen::push::*;
use tigeropen::quote::QuoteClient;
use tigeropen::trade::TradeClient;
async fn example_get_derivative_contracts(config: ClientConfig, quote: &QuoteClient, trade: &TradeClient, push: &Arc<PushClient>) -> Result<(), TigerError> {
let result_0 = trade.get_derivative_contracts(DerivativeContractsRequest { ..Default::default() }).await?;
Ok(())
}
Response example
[
{
"contractId": 265598,
"symbol": "AAPL",
"secType": "OPT",
"currency": "USD",
"exchange": "CBOE",
"primaryExchange": "CBOE",
"expiry": "2025-02-21",
"strike": 195.0
}
]Rate limit
The base rate limit is 60 requests/min. get_quote_contract and get_derivative_contracts both use quote_contract and share this quota.
Updated about 1 month ago
