Fund Management

All methods on this page require trading-account permission, use the configured account, and return the response data as web::json::value. Transfers and FX orders affect the live account, so query available funds first.

Get Segment Transfer History

value TradeClient::get_segment_fund_history(int limit = 0)

Description

Returns fund-transfer records between account segments.

Parameters

ParameterTypeRequiredDescription
limitintNoSDK default 0; sent only when positive

Return

web::json::value array. Each record contains id, fromSegment, toSegment, currency, amount, status, statusDesc, settledAt, createdAt, and updatedAt.

Example

auto result = trade_client.get_segment_fund_history(20);

Permissions and Limits

Uses the configured account. With limit = 0, the server selects the record count. Fund-query permission is required.


Get Transferable Funds

value TradeClient::get_segment_fund_available(utility::string_t from_segment, utility::string_t currency = U("USD"))

Description

Returns currently transferable funds for one segment and currency.

Parameters

ParameterTypeRequiredDescription
from_segmentutility::string_tYesSource segment, such as U("SEC") or U("FUT")
currencyutility::string_tNoSDK default U("USD")

Return

web::json::value array. Each item contains fromSegment, currency, and amount.

Example

auto result = trade_client.get_segment_fund_available(U("SEC"), U("USD"));

Permissions and Limits

The account must support the source segment. Available funds change with positions and margin.


Transfer Segment Funds

value TradeClient::transfer_segment_fund(utility::string_t from_segment, utility::string_t to_segment, double amount, utility::string_t currency = U("USD"))

Description

Submits a fund transfer between two segments of the configured account.

Parameters

ParameterTypeRequiredDescription
from_segmentutility::string_tYesSource segment
to_segmentutility::string_tYesDifferent target segment
amountdoubleYesPositive and no greater than transferable funds
currencyutility::string_tNoSDK default U("USD")

Return

web::json::value object with id, fromSegment, toSegment, currency, amount, status, statusDesc, message, settledAt, createdAt, and updatedAt.

Example

auto result = trade_client.transfer_segment_fund(U("SEC"), U("FUT"), 1000.0);

Permissions and Limits

This changes live funds. Call get_segment_fund_available first and query history for final status.


Cancel a Segment Transfer

value TradeClient::cancel_segment_fund(long long id)

Description

Cancels a segment transfer that remains pending.

Parameters

ParameterTypeRequiredDescription
idlong longYesTransfer ID returned by get_segment_fund_history

Return

web::json::value object with the same fields as the segment-transfer result.

Example

auto result = trade_client.cancel_segment_fund(12345);

Permissions and Limits

Only records the server still marks cancelable can be canceled.


Place an FX Order

value TradeClient::place_forex_order(utility::string_t seg_type, utility::string_t source_currency, utility::string_t target_currency, double source_amount)

Description

Submits an account-segment FX order by source amount.

Parameters

ParameterTypeRequiredDescription
seg_typeutility::string_tYesAccount segment, such as U("SEC")
source_currencyutility::string_tYesThree-letter source currency
target_currencyutility::string_tYesDifferent three-letter target currency
source_amountdoubleYesPositive and no greater than available funds

Return

web::json::value object with id, status, sourceCurrency, targetCurrency, sourceAmount, targetAmount, rate, and submitTime.

Example

auto result = trade_client.place_forex_order(U("SEC"), U("USD"), U("HKD"), 100.0);

Permissions and Limits

The account must support both currencies and FX. The response contains the resulting rate and execution status.


Get Aggregate Assets

value TradeClient::get_aggregate_assets(utility::string_t account = U(""), utility::string_t seg_type = U(""), utility::string_t base_currency = U(""))

Description

Returns aggregate assets by account, segment, and base currency.

Parameters

ParameterTypeRequiredDescription
accountutility::string_tNoEmpty uses the configured account
seg_typeutility::string_tNoSDK default is an empty string; omitted when empty
base_currencyutility::string_tNoSDK default is an empty string; omitted when empty

Return

web::json::value object with currency, cashBalance, cashBalanceWithInTransit, equityWithLoan, netLiquidation, initMargin, maintainMargin, tradeCurrencyMargin, intradayRiskRatio, grossPositionValue, optionMarketValue, stockMarketValue, cashAvailableForTrade, availableCash, lockedFunds, lockedCash, creditLimit, excessEquity, and excessLiquidity.

Example

auto result = trade_client.get_aggregate_assets(U(""), U("SEC"), U("USD"));

Permissions and Limits

Asset-query permission is required. Fields depend on account type and segment capability.

Rate Limit


Get Funding History

value TradeClient::get_funding_history(utility::string_t seg_type = U(""))

Description

Returns deposit and withdrawal records for the configured account.

Parameters

ParameterTypeRequiredDescription
seg_typeutility::string_tNoSDK default is an empty string; omitted when empty

Return

web::json::value array. Each record contains id, refId, type, typeDesc, currency, amount, businessDate, status, statusDesc, completedStatus, createdAt, and updatedAt.

Example

auto result = trade_client.get_funding_history(U("SEC"));

Permissions and Limits

Only records visible to the configured account are returned.

Rate Limit


Get Fund Details

value TradeClient::get_fund_details(const value &seg_types = value::null(), utility::string_t account = U(""), utility::string_t fund_type = U(""), utility::string_t currency = U(""), int start = 0, int limit = 0, utility::string_t start_date = U(""), utility::string_t end_date = U(""))

Description

Returns paginated fund details filtered by segments, type, currency, and date.

Parameters

ParameterTypeRequiredDescription
seg_typesconst value&NoJSON segment array; SDK default value::null()
accountutility::string_tNoEmpty uses the configured account
fund_typeutility::string_tNoFund type; SDK default is empty
currencyutility::string_tNoThree-letter currency; SDK default is empty
startintNoPagination start; SDK default 0
limitintNoCount; SDK default 0 for server handling
start_dateutility::string_tNoyyyy-MM-dd; SDK default is empty
end_dateutility::string_tNoyyyy-MM-dd; must not precede start

Return

web::json::value pagination object with page, limit, itemCount, pageCount, timestamp, and items. Each item contains id, account, segType, fundType, currency, amount, balance, occurTime, remark, and externalId.

Example

web::json::value segments = web::json::value::array();
segments[0] = web::json::value::string(U("SEC"));
auto result = trade_client.get_fund_details(
    segments, U(""), U("DEPOSIT"), U("USD"), 0, 50,
    U("2025-01-01"), U("2025-12-31"));

Permissions and Limits

The server validates account, segments, date range, and pagination limits.

Limits and Links

The server validates account type, currency, segment, and cancellation state. See API Rate Limits and Assets and Positions.

See the public C++ SDK repository for API definitions and release updates.

Rate Limit


Did this page help you?