command.trading_account.connect
Connect a trading account.
Method
command.trading_account.connect
Description
Connects a new trading account to Cadenza using provided API credentials. Upon successful connection, the account will be available for trading operations and real-time updates.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
credentialId | string | Yes | Credential ID to use for connection |
nickname | string | No | User-friendly account name |
Result
Returns the connected trading account object.
Trading Account Object
| Field | Type | Description |
|---|---|---|
tradingAccountId | string | Unique account identifier (UUID) |
externalTradingAccountId | string | Exchange account ID |
venue | string | Exchange venue |
nickname | string | Account name |
accountType | string | Account type |
status | string | Account status (CONNECTED) |
credentials | array | Associated credentials |
createdAt | integer | Creation timestamp (ms) |
updatedAt | integer | Last update timestamp (ms) |
Usage
result = await client.rpc("command.trading_account.connect", {
"credentialId": "660e8400-e29b-41d4-a716-446655440001",
"nickname": "Main Binance Account"
})
Example Response
{
"tradingAccountId": "550e8400-e29b-41d4-a716-446655440000",
"externalTradingAccountId": "123456789",
"venue": "BINANCE",
"nickname": "Main Binance Account",
"accountType": "SPOT",
"status": "CONNECTED",
"credentials": [
{
"credentialId": "660e8400-e29b-41d4-a716-446655440001",
"venue": "BINANCE",
"status": "VERIFIED"
}
],
"createdAt": 1703052635110,
"updatedAt": 1703052635110
}
Notes
- Credentials must be verified before connecting an account
- Each credential can only be connected to one trading account
- The account type is determined by the credential permissions