Fund Management
All methods on this page require trading-account permission, use the configured account, and return web::json::value. Successful responses generally contain records or an operation ID; failures contain server error details. 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | int | No | SDK default 0; sent only when positive |
Return
web::json::value containing unmodeled transfer records.
Example
auto result = trade_client.get_segment_fund_history(20);Response provenance: this endpoint returns unmodeled web::json::value, and the SDK repository has no verified fixture; no synthetic record is shown.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| from_segment | utility::string_t | Yes | Source segment, such as U("SEC") or U("FUT") |
| currency | utility::string_t | No | SDK default U("USD") |
Return
web::json::value; the SDK does not define a fixed response model.
Example
auto result = trade_client.get_segment_fund_available(U("SEC"), U("USD"));Response provenance: the SDK has no fixed response model or verified fixture. Fields follow the runtime server response.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| from_segment | utility::string_t | Yes | Source segment |
| to_segment | utility::string_t | Yes | Different target segment |
| amount | double | Yes | Positive and no greater than transferable funds |
| currency | utility::string_t | No | SDK default U("USD") |
Return
web::json::value submission result.
Example
auto result = trade_client.transfer_segment_fund(U("SEC"), U("FUT"), 1000.0);Response provenance: the submission result is raw web::json::value; no repository fixture is available.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | long long | Yes | Transfer ID returned by get_segment_fund_history |
Return
web::json::value cancellation result.
Example
auto result = trade_client.cancel_segment_fund(12345);Response provenance: the cancellation result is not modeled in the SDK, so no status payload is inferred.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| seg_type | utility::string_t | Yes | Account segment, such as U("SEC") |
| source_currency | utility::string_t | Yes | Three-letter source currency |
| target_currency | utility::string_t | Yes | Different three-letter target currency |
| source_amount | double | Yes | Positive and no greater than available funds |
Return
web::json::value FX submission result.
Example
auto result = trade_client.place_forex_order(U("SEC"), U("USD"), U("HKD"), 100.0);Response provenance: the FX result is not modeled in the SDK and no verified fixture exists.
Permissions and Limits
The account must support both currencies and FX. The server determines the rate and execution result.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | utility::string_t | No | Empty uses the configured account |
| seg_type | utility::string_t | No | SDK default is empty for server handling |
| base_currency | utility::string_t | No | SDK default is empty for server handling |
Return
web::json::value; fields vary by account capability.
Example
auto result = trade_client.get_aggregate_assets(U(""), U("SEC"), U("USD"));Response provenance: this overload returns raw web::json::value; fields follow the server response.
Permissions and Limits
Asset-query permission is required. Fields depend on account type and segment capability.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| seg_type | utility::string_t | No | SDK default is empty for server handling |
Return
web::json::value containing unmodeled funding records.
Example
auto result = trade_client.get_funding_history(U("SEC"));Response provenance: the SDK repository has no funding-history response model or verified fixture.
Permissions and Limits
Only records visible to the configured account are returned. The server controls range and count.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| seg_types | const value& | No | JSON segment array; SDK default value::null() |
| account | utility::string_t | No | Empty uses the configured account |
| fund_type | utility::string_t | No | Fund type; SDK default is empty |
| currency | utility::string_t | No | Three-letter currency; SDK default is empty |
| start | int | No | Pagination start; SDK default 0 |
| limit | int | No | Count; SDK default 0 for server handling |
| start_date | utility::string_t | No | yyyy-MM-dd; SDK default is empty |
| end_date | utility::string_t | No | yyyy-MM-dd; must not precede start |
Return
web::json::value; detail and pagination fields are server-defined.
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"));Response provenance: the SDK returns unmodeled JSON; detail and pagination fields are server-defined.
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.
Source: trade_client.h; request construction is in src/trade_client.cpp.
Updated 3 days ago
