Skip to main content

Trading Accounts

A Trading Account represents a connected exchange account that you can use to trade, view portfolios, and receive real-time updates.

Overview

A Trading Account is the link between your Cadenza account and a specific account on an exchange. Each trading account:

  • Uses a Credential - Authenticates with the exchange using stored API keys
  • Has a Type - Corresponds to an account type on the exchange (spot, margin, futures)
  • Tracks Portfolio - Monitors balances and positions in real-time
  • Executes Orders - Submits and manages trade orders

Trading Account Lifecycle

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Credential │────▶│ Connect │────▶│ Active │
│ (verified) │ │ (CONNECTED) │ │ (trading) │
└─────────────┘ └─────────────┘ └─────────────┘

┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Disable │ │ Enable │ │Disconnect │
│ (DISABLED)│◀─────▶│ (ENABLED) │ │(REMOVED) │
└───────────┘ └───────────┘ └───────────┘

The Trading Account Object

FieldTypeDescription
tradingAccountIdUUIDUnique identifier for the trading account
externalTradingAccountIdstringAccount identifier on the exchange (e.g., "spot", "futures")
venueVenueExchange venue (BINANCE, OKX, BYBIT)
nicknamestringDisplay name for the account
accountTypeAccountTypeType of account (SPOT, MARGIN, FUTURES)
externalAccountTypestringAccount type as reported by the exchange
credentialsCredential[]Associated credentials
statusTradingAccountStatusCurrent status
positionModePositionModePosition mode for derivatives (ONE_WAY, HEDGE)
marginModeMarginModeMargin mode (CROSS, ISOLATED)
createdAttimestampWhen the account was connected
updatedAttimestampWhen the account was last updated

Trading Account Status

StatusDescription
CONNECTEDAccount is connected and ready
ENABLEDAccount is enabled for trading
DISABLEDAccount is temporarily disabled
DISCONNECTEDAccount has been disconnected
ERRORAccount encountered an error

Account Types

TypeDescriptionVenues
SPOTSpot trading accountAll
MARGINMargin trading accountBINANCE, OKX
FUTURESUSDT-margined futuresBINANCE, OKX, BYBIT
COIN_FUTURESCoin-margined futuresBINANCE
UNIFIEDUnified trading accountOKX, BYBIT

Relationship Diagram

┌─────────────────────────────────────────────────────────────┐
│ User │
└─────────────────────────────────────────────────────────────┘

│ owns

┌─────────────────────────────────────────────────────────────┐
│ Credentials │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Binance │ │ OKX │ │ Bybit │ │
│ │ API Keys │ │ API Keys │ │ API Keys │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘

│ authenticates

┌─────────────────────────────────────────────────────────────┐
│ Trading Accounts │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Binance │ │ Binance │ │ OKX │ │
│ │ Spot │ │ Futures │ │ Unified │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘

│ contains

┌─────────────────────────────────────────────────────────────┐
│ Portfolio │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Balances │ │ Positions │ │ Orders │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘

Next Steps

Prerequisites

Before connecting a trading account, you must:

  1. Create a Credential with your exchange API keys
  2. Verify the Credential to discover available accounts