API Documentation
All authenticated API requests must include the following headers:
ttc-auth-tokenYour auth token (obtained on login)ttc-public-keyYour wallet public key (Solana address){
"ttc-auth-token": "your_auth_token_here",
"ttc-public-key": "your_wallet_public_key_here"
}curl -X POST https://ttc.box/api/v1/exchanges \
-H "ttc-auth-token: your_auth_token_here" \
-H "ttc-public-key: your_wallet_public_key_here" \
-H "Content-Type: application/json" \
-d '{
"exchangeName": "binance",
"method": "placeMarketOrder",
"params": {
"symbol": "BTCUSDT",
"side": "buy",
"quantity": 0.01
},
"credentials": {
"apiKey": "your_exchange_api_key",
"apiSecret": "your_exchange_api_secret"
}
}'/api/auth/check-userUser's unique identifier
{
"exists": true,
"username": "john_doe",
"roles": [
"user"
]
}/api/auth/loginUser's email address
User's password
User's generated wallet address
{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "123",
"email": "john@example.com",
"username": "john_doe"
}
}/api/auth/registerUser's email address
User's Wallet Address
{
"success": true,
"user": {
"email": "test@gmail.com",
"passKey": "d2c8f1b692539fe028371c0354da7ee094b3245e0121ebb0de0f2352c0067762",
"login": "2025-02-18T07:43:45.586Z",
"publicKey": "CgzKjTLrNgi9B6iCzLKfcLasYTuuEUibsei97qjmm7t5",
"privateKey": "00b10cd.....bf7e2",
"type": "email",
"apiKey": "fb1c2747505ab845c3dfaa22b7cb64cd48d087c0670aacbd9c5ad6593dae0683"
},
"message": "Registration successful"
}/api/auth/challengeUser's public key
{
"success": true,
"challenge": "a1b2c3d4e5f6...",
"message": "Sign this message to verify wallet ownership: a1b2c3d4e5f6..."
}/api/auth/login-walletUser's public key
Signed challenge message
Challenge string provided earlier
{
"success": true,
"message": "Wallet verified successfully",
"user": {
"email": "user@example.com",
"lastLogin": "2023-01-01T00:00:00Z",
"publicKey": "pubKey_string",
"apiKey": "api_key",
"privateKey": "private_key"
},
"authToken": "auth_token_string"
}/api/auth/search-emailUser's email address
{
"success": true,
"data": "pubKey_string",
"pubKey": "pubKey_string",
"timestamp": 123456789
}/api/auth/search-pubKeyUser's public key
{
"success": true,
"message": "User found"
}/api/auth/user-dataUser's public key
New API key to set
{
"success": true,
"message": "User data retrieved successfully",
"user": {
"email": "user@example.com",
"lastLogin": "2023-01-01T00:00:00Z",
"publicKey": "pubKey_string",
"apiKey": "api_key",
"privateKey": "private_key"
}
}/api/conversationNumber of conversations to return
Number of conversations to skip
{
"conversations": [
{
"id": "conv_123",
"title": "Trading Strategy Discussion",
"lastMessage": "What do you think about this setup?",
"timestamp": "2024-02-06T04:03:46Z"
}
],
"total": 50
}/api/conversation/agents/[id]Agent conversation ID
{
"id": "agent_123",
"messages": [
{
"role": "user",
"content": "Can you analyze this market?",
"timestamp": "2024-02-06T04:03:46Z"
},
{
"role": "assistant",
"content": "Based on the current indicators...",
"timestamp": "2024-02-06T04:03:47Z"
}
]
}/api/conversation/coach/[id]Coach conversation ID
{
"id": "coach_123",
"messages": [
{
"role": "user",
"content": "How can I improve my trading?",
"timestamp": "2024-02-06T04:03:46Z"
},
{
"role": "coach",
"content": "Let's analyze your recent trades...",
"timestamp": "2024-02-06T04:03:47Z"
}
]
}/api/conversation/coder/[id]Coder conversation ID
{
"id": "coder_123",
"messages": [
{
"role": "user",
"content": "How do I implement this strategy?",
"timestamp": "2024-02-06T04:03:46Z"
},
{
"role": "coder",
"content": "Here's a code implementation...",
"timestamp": "2024-02-06T04:03:47Z"
}
]
}/api/conversation/manager/[id]Manager conversation ID
{
"id": "manager_123",
"messages": [
{
"role": "user",
"content": "How should I manage my portfolio?",
"timestamp": "2024-02-06T04:03:46Z"
},
{
"role": "manager",
"content": "Based on your risk profile...",
"timestamp": "2024-02-06T04:03:47Z"
}
]
}/api/conversation/oracle/[id]Oracle conversation ID
{
"id": "oracle_123",
"messages": [
{
"role": "user",
"content": "What's your market prediction?",
"timestamp": "2024-02-06T04:03:46Z"
},
{
"role": "oracle",
"content": "The market indicators suggest...",
"timestamp": "2024-02-06T04:03:47Z"
}
]
}/api/conversations/[id]Specific conversation ID
{
"id": "conv_123",
"title": "Strategy Discussion",
"messages": [
{
"role": "user",
"content": "Let's discuss this strategy",
"timestamp": "2024-02-06T04:03:46Z"
},
{
"role": "assistant",
"content": "I see several key points...",
"timestamp": "2024-02-06T04:03:47Z"
}
]
}/api/agentsNumber of agents to return
{
"agents": [
{
"id": 123,
"name": "TradingBot",
"description": "AI-powered trading assistant",
"x402Support": true
},
{
"id": 456,
"name": "PriceOracle",
"description": "Real-time price oracle",
"x402Support": true
}
],
"total": 2
}/api/agents/[id]Agent ID
{
"id": 123,
"name": "TradingBot",
"description": "AI-powered trading assistant",
"services": [
{
"name": "ERC-8008 Messaging",
"endpoint": "https://agent.example.com/messaging",
"version": "1.0.0"
},
{
"name": "PriceOracle",
"endpoint": "https://agent.example.com/api",
"version": "1.2.0"
}
],
"x402Support": true,
"supportedTrust": [
"reputation",
"erc-8008"
],
"active": true
}/api/agents/[id]Agent name
Agent description
Array of service objects
Whether agent accepts x402 payments
Supported trust mechanisms
{
"success": true,
"message": "Agent registered successfully",
"agentId": 123
}/api/agents/eight-zero-zero-four/statsAgent ID to get stats for
{
"agentId": 123,
"totalAgents": 1500,
"activeAgents": 1420,
"totalFeedback": 12500,
"averageReputation": 78.5
}/api/dao/trading/all-positionsUser's wallet public key)
User's auth token for session authentication
Position object
{
"positions": [
{
"symbol": "BTCUSDT",
"side": "buy",
"size": 0.01,
"entryPrice": 22000,
"markPrice": 22500,
"pnl": 5,
"timestamp": "2024-02-06T04:09:15Z"
}
]
}| Method Name | Description |
|---|---|
placeMarketOrder | Execute a market order (filled immediately at current price) |
placeLimitOrder | Execute a limit order (filled when price reaches specified level) |
placeStopOrder | Execute a stop order (triggered when price reaches stop level) |
getPositions | Get all open positions |
getBalance | Get account balance |
getOrders | Get all open orders |
cancelOrder | Cancel a specific order |
cancelAllOrders | Cancel all orders (optionally for specific symbol) |
setLeverage | Set leverage for a specific symbol |
setHedgeMode | Set hedge mode (one-way or two-way trading) |
closeAllPositions | Close all open positions |
getTickers | Get ticker information |
getBestBidAsk | Get best bid/ask prices for a symbol |
getUserTradeHistory | Get user's trade history |
createWithdrawal | Create a withdrawal request |
getDepositAddress | Get deposit address for a currency |
See method-details endpoint below for complete parameter documentation for each method.
/api/v1/exchanges{
"success": true,
"status": "ok",
"supportedExchanges": [
"asterdex",
"apex",
"binance",
"bingx",
"bitget",
"bitmex",
"blofin",
"bybit",
"kucoin",
"okx",
"phemex",
"orderly",
"woocex"
],
"code": 200
}/api/v1/exchangesMethod name (must be 'getBestBidAsk')
Exchange name (e.g., binance, bybit, okx, phemex)
Trading symbol (e.g., BTCUSDT)
Exchange API key
Exchange API secret
API passphrase (for exchanges like OKX)
User wallet address (required for orderly exchange)
{
"success": true,
"bid": 43250.5,
"ask": 43251,
"spread": 0.5,
"exchange": "binance"
}/api/v1/exchangesSet to 'true' to get list of all available methods
{
"success": true,
"methods": [
{
"name": "placeMarketOrder",
"description": "Execute a market order (filled immediately at current price)"
},
{
"name": "placeLimitOrder",
"description": "Execute a limit order (filled when price reaches specified level)"
},
{
"name": "placeStopOrder",
"description": "Execute a stop order (triggered when price reaches stop level)"
},
{
"name": "getPositions",
"description": "Get all open positions"
},
{
"name": "getBalance",
"description": "Get account balance"
},
{
"name": "getOrders",
"description": "Get all open orders"
},
{
"name": "cancelOrder",
"description": "Cancel a specific order"
},
{
"name": "cancelAllOrders",
"description": "Cancel all orders (optionally for specific symbol)"
},
{
"name": "setLeverage",
"description": "Set leverage for a specific symbol"
},
{
"name": "setHedgeMode",
"description": "Set hedge mode (one-way or two-way trading)"
},
{
"name": "closeAllPositions",
"description": "Close all open positions"
},
{
"name": "getTickers",
"description": "Get ticker information"
},
{
"name": "getBestBidAsk",
"description": "Get best bid/ask prices for a symbol"
},
{
"name": "getUserTradeHistory",
"description": "Get user's trade history"
},
{
"name": "createWithdrawal",
"description": "Create a withdrawal request"
},
{
"name": "getDepositAddress",
"description": "Get deposit address for a currency"
}
],
"code": 200
}/api/v1/exchangesExchange name (e.g., binance, bybit, okx, phemex, orderly)
Method to execute. Available: placeMarketOrder, placeLimitOrder, placeStopOrder, getPositions, getBalance, getOrders, cancelOrder, cancelAllOrders, setLeverage, setHedgeMode, closeAllPositions, getTickers, getBestBidAsk, getUserTradeHistory, createWithdrawal, getDepositAddress
API credentials object with apiKey and apiSecret properties
{
"success": true,
"code": 200,
"data": {},
"exchange": "binance"
}Execute a market order (filled immediately at current price)
Trading symbol (e.g., BTCUSDT)
Order side: 'buy' or 'sell'
Order quantity
Position side: 'long' or 'short' (optional)
Reduce existing position only (optional)
{
"symbol": "BTCUSDT",
"side": "buy",
"quantity": 0.01,
"positionSide": "long"
}{
"success": true,
"data": {
"orderId": "1234567890",
"symbol": "BTCUSDT",
"side": "buy",
"positionSide": "long",
"type": "market",
"price": "97450.50",
"quantity": 0.01,
"status": "filled",
"filledQuantity": 0.01,
"avgFilledPrice": "97450.50",
"timestamp": 1738435234567
},
"code": 200,
"exchange": "binance"
}Execute a limit order (filled when price reaches specified level)
Trading symbol (e.g., BTCUSDT)
Order side: 'buy' or 'sell'
Order quantity
Limit price
Position side: 'long' or 'short' (optional)
Reduce existing position only (optional)
{
"symbol": "BTCUSDT",
"side": "buy",
"quantity": 0.01,
"price": 42500,
"positionSide": "long"
}{
"success": true,
"data": {
"orderId": "1234567890",
"symbol": "BTCUSDT",
"side": "buy",
"positionSide": "long",
"type": "limit",
"price": 95000,
"quantity": 0.001,
"status": "new",
"timestamp": 1738435234567
},
"code": 200,
"exchange": "phemex"
}Execute a stop order (triggered when price reaches stop level)
Trading symbol (e.g., BTCUSDT)
Order side: 'buy' or 'sell'
Order quantity
Stop trigger price
Position side: 'long' or 'short' (optional)
Reduce existing position only (optional)
{
"symbol": "BTCUSDT",
"side": "sell",
"quantity": 0.01,
"stopPrice": 42000,
"positionSide": "long"
}{
"success": true,
"data": {
"orderId": "1234567891",
"symbol": "BTCUSDT",
"side": "sell",
"positionSide": "long",
"type": "stop",
"stopPrice": 42000,
"quantity": 0.01,
"status": "triggered",
"timestamp": 1738435234567
},
"code": 200,
"exchange": "binance"
}Get all open positions
{
"success": true,
"data": [
{
"symbol": "BTCUSDT",
"side": "buy",
"positionSide": "long",
"size": 0.001,
"entryPrice": 95000,
"markPrice": 97500,
"pnl": 2.5,
"leverage": 10,
"liquidationPrice": 86500,
"marginType": "cross",
"unrealizedPnl": 25,
"notional": 95
}
],
"code": 200,
"exchange": "phemex"
}Get account balance
{
"success": true,
"data": [
{
"asset": "USDT",
"balance": "1000.00",
"available": "950.00",
"locked": "50.00"
},
{
"asset": "BTC",
"balance": "0.05",
"available": "0.05",
"locked": "0"
}
],
"code": 200,
"exchange": "binance"
}Get all open orders
{
"success": true,
"data": [
{
"orderId": "1234567890",
"symbol": "BTCUSDT",
"side": "buy",
"positionSide": "long",
"type": "limit",
"price": "95000",
"quantity": 0.001,
"filledQuantity": 0,
"status": "open",
"timestamp": 1738435234567
}
],
"code": 200,
"exchange": "binance"
}Cancel a specific order
Order ID to cancel
Trading symbol (e.g., BTCUSDT)
{
"orderID": "123456",
"symbol": "BTCUSDT"
}{
"success": true,
"data": {
"orderId": "123456",
"symbol": "BTCUSDT",
"status": "canceled",
"timestamp": 1738435234567
},
"code": 200,
"exchange": "bybit"
}Cancel all orders (optionally for specific symbol)
Trading symbol (optional - if not provided, cancels all orders)
{
"symbol": "BTCUSDT"
}{
"success": true,
"data": {
"canceledOrders": [
{
"orderId": "123456",
"symbol": "BTCUSDT",
"status": "canceled"
},
{
"orderId": "123457",
"symbol": "BTCUSDT",
"status": "canceled"
}
],
"totalCanceled": 2
},
"code": 200,
"exchange": "binance"
}Set leverage for a specific symbol
Trading symbol (e.g., BTCUSDT)
Leverage multiplier (e.g., 10 for 10x)
Set isolated margin mode (optional)
Set hedge mode (optional)
{
"symbol": "BTCUSDT",
"leverage": 10,
"isIsolated": false
}{
"success": true,
"data": {
"symbol": "BTCUSDT",
"leverage": 10,
"marginMode": "cross",
"timestamp": 1738435234567
},
"code": 200,
"exchange": "binance"
}Set hedge mode (one-way or two-way trading)
Trading symbol (e.g., BTCUSDT)
Enable hedge mode (true = two-way, false = one-way)
{
"symbol": "BTCUSDT",
"isHedged": true
}{
"success": true,
"data": {
"symbol": "BTCUSDT",
"hedgeMode": true,
"timestamp": 1738435234567
},
"code": 200,
"exchange": "bybit"
}Close all open positions
{
"success": true,
"data": {
"closedPositions": [
{
"symbol": "BTCUSDT",
"side": "buy",
"positionSide": "long",
"closedSize": 0.001,
"realizedPnl": 2.5,
"closePrice": 97500
}
],
"totalClosed": 1,
"totalRealizedPnl": 2.5
},
"code": 200,
"exchange": "phemex"
}Get ticker information
{
"success": true,
"data": [
{
"symbol": "BTCUSDT",
"lastPrice": "97500.00",
"bidPrice": "97495.00",
"askPrice": "97505.00",
"priceChange": "2500.00",
"priceChangePercent": "2.63",
"highPrice": "98500.00",
"lowPrice": "94500.00",
"volume": "50000",
"quoteVolume": "4850000000",
"timestamp": 1738435234567
},
{
"symbol": "ETHUSDT",
"lastPrice": "2650.75",
"bidPrice": "2650.50",
"askPrice": "2651.00",
"priceChange": "-25.25",
"priceChangePercent": "-0.94",
"highPrice": "2700.00",
"lowPrice": "2600.00",
"volume": "150000",
"quoteVolume": "397500000",
"timestamp": 1738435234567
}
],
"code": 200,
"exchange": "binance"
}Get best bid/ask prices for a symbol
Trading symbol (e.g., BTCUSDT)
{
"symbol": "BTCUSDT"
}{
"success": true,
"data": {
"bestBid": {
"price": "97495.00",
"quantity": 1.5
},
"bestAsk": {
"price": "97505.00",
"quantity": 2.3
},
"spread": 10,
"timestamp": 1738435234567
},
"code": 200,
"exchange": "phemex"
}Create a withdrawal request
Currency to withdraw (e.g., USDT)
Destination wallet address
Amount to withdraw
Blockchain network (e.g., ETH, SOL)
Address tag/memo (optional)
{
"currency": "USDT",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"amount": "100",
"chainName": "ETH"
}{
"success": true,
"data": {
"withdrawalId": "wd_abc123",
"currency": "USDT",
"amount": "100",
"address": "0x1234567890abcdef1234567890abcdef12345678",
"chainName": "ETH",
"status": "pending",
"timestamp": 1738435234567
},
"code": 200,
"exchange": "binance"
}Get deposit address for a currency
Currency to deposit (e.g., USDT)
Blockchain network (e.g., ETH, SOL)
{
"currency": "USDT",
"chainName": "ETH"
}{
"success": true,
"data": {
"currency": "USDT",
"address": "0xabcdef1234567890abcdef1234567890abcdef12",
"chainName": "ETH",
"tag": null,
"memo": null
},
"code": 200,
"exchange": "binance"
}Get user's trade history
Maximum number of trades to return (default: 1000)
{
"limit": 100
}{
"success": true,
"data": [
{
"tradeId": "trade_001",
"symbol": "BTCUSDT",
"side": "buy",
"quantity": 0.01,
"price": "97450.50",
"total": "974.51",
"fee": "0.97",
"timestamp": 1738435234567,
"orderId": "1234567890"
},
{
"tradeId": "trade_002",
"symbol": "ETHUSDT",
"side": "sell",
"quantity": 0.5,
"price": "2650.75",
"total": "1325.38",
"fee": "1.33",
"timestamp": 1738435200000,
"orderId": "1234567891"
}
],
"total": 2,
"code": 200,
"exchange": "bybit"
}/api/jupiterTrading pair
{
"inputMint": "SOL",
"outputMint": "USDC",
"bestRoute": {
"inAmount": 1,
"outAmount": 101.52,
"priceImpact": 0.1
}
}/api/jupiter/submitSelected route object
User's public key
{
"signature": "5KtPn3...",
"status": "confirmed",
"timestamp": "2024-02-06T04:03:46Z"
}/api/jupiter/swapInput token mint address
Output token mint address
Amount to swap
Maximum slippage percentage
{
"txId": "4zJg7...",
"inputAmount": 1,
"outputAmount": 101.52,
"executedPrice": 101.52
}/api/v1/markets/calendarDate in YYYY-MM-DD format
Event importance (high/medium/low)
{
"events": [
{
"time": "2024-02-06T14:30:00Z",
"event": "NFP Report",
"importance": "high",
"forecast": "180K",
"previous": "175K"
}
]
}/api/v1/markets/volumeTrading symbol
Time period (1h/4h/1d)
{
"symbol": "BTCUSDT",
"volume": 12345.67,
"timeframe": "1h",
"timestamp": "2024-02-06T04:03:46Z"
}/api/v1/markets/hybrid-tickersMarket type filter (futures or spot)
Minimum volume filter (USD)
Markets up by at least X% (e.g., up=10 for markets up 10%+)
Markets down by at least X% (e.g., down=10 for markets down 10%+)
Minimum price filter
Maximum price filter
Filter by specific exchange (e.g., binance, bybit, okx)
Health check endpoint
{
"success": true,
"data": {
"spot": {
"data": [
{
"symbol": "BTCUSDT",
"lastPrice": "43250.50",
"priceChangePercent": "2.45",
"quoteVolume": "1250000.00",
"source": "binance",
"sources": [
"binance",
"bybit"
]
}
]
},
"futures": {
"data": [
{
"symbol": "ETHUSDT",
"lastPrice": "2650.75",
"priceChangePercent": "-1.25",
"quoteVolume": "850000.00",
"source": "bybit",
"sources": [
"bybit"
]
}
]
}
},
"cached": {
"spot": true,
"futures": true
},
"timestamp": 1642345678901
}/api/v1/markets/hybrid-tickers/similarBase symbol to find similar tickers
Number of similar tickers to return
{
"similar": [
{
"symbol": "MSFT",
"similarity": 0.85,
"sector": "Technology"
}
]
}