Logo

TTC API Documentation

Login to create your api-keys: Dashboard

Authentication Endpoints

GET/api/auth/check-user

Parameters:

userId (string)*

User's unique identifier

Example Response:

{
  "exists": true,
  "username": "john_doe",
  "roles": [
    "user"
  ]
}
POST/api/auth/login

Parameters:

email (string)*

User's email address

password (string)*

User's password

Example Response:

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "123",
    "email": "john@example.com",
    "username": "john_doe"
  }
}
POST/api/auth/register

Parameters:

email (string)*

User's email address

pubkey (string)*

User's Wallet Address

Example Response:

{
  "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"
}
POST/api/auth/challenge

Parameters:

pubkey (string)*

User's public key

Example Response:

{
  "success": true,
  "challenge": "a1b2c3d4e5f6...",
  "message": "Sign this message to verify wallet ownership: a1b2c3d4e5f6..."
}
POST/api/auth/login-wallet

Parameters:

pubkey (string)*

User's public key

signature (string)*

Signed challenge message

challenge (string)*

Challenge string provided earlier

Example Response:

{
  "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"
}
POST/api/auth/new-keys

Example Response:

{
  "success": true,
  "newApiKey": "generated_api_key"
}
GET/api/auth/search-email

Parameters:

email (string)*

User's email address

Example Response:

{
  "success": true,
  "data": "pubkey_string",
  "pubkey": "pubkey_string",
  "timestamp": 123456789
}
GET/api/auth/search-pubkey

Parameters:

pubkey (string)*

User's public key

Example Response:

{
  "success": true,
  "message": "User found"
}
GETPOST/api/auth/user-data

Parameters:

pubkey (string)*

User's public key

Parameters:

newApiKey (string)*

New API key to set

Example Response:

{
  "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"
  }
}

Conversation Endpoints

GET/api/conversation

Parameters:

limit (number)

Number of conversations to return

offset (number)

Number of conversations to skip

Example Response:

{
  "conversations": [
    {
      "id": "conv_123",
      "title": "Trading Strategy Discussion",
      "lastMessage": "What do you think about this setup?",
      "timestamp": "2024-02-06T04:03:46Z"
    }
  ],
  "total": 50
}
GET/api/conversation/agents/[id]

Parameters:

id (string)*

Agent conversation ID

Example Response:

{
  "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"
    }
  ]
}
GET/api/conversation/coach/[id]

Parameters:

id (string)*

Coach conversation ID

Example Response:

{
  "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"
    }
  ]
}
GET/api/conversation/coder/[id]

Parameters:

id (string)*

Coder conversation ID

Example Response:

{
  "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"
    }
  ]
}
GET/api/conversation/manager/[id]

Parameters:

id (string)*

Manager conversation ID

Example Response:

{
  "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"
    }
  ]
}
GET/api/conversation/oracle/[id]

Parameters:

id (string)*

Oracle conversation ID

Example Response:

{
  "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"
    }
  ]
}
GET/api/conversations/[id]

Parameters:

id (string)*

Specific conversation ID

Example Response:

{
  "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"
    }
  ]
}

DAO: /all-positions | USER: /position

GETPOST/api/dao/trading/all-positions

Parameters:

x-user-identifier (string)*

User identifier

x-user-identifier-type (string)*

User identifier type

Parameters:

position (object)*

Position object

Example Response:

{
  "positions": [
    {
      "symbol": "BTCUSDT",
      "side": "buy",
      "size": 0.01,
      "entryPrice": 22000,
      "markPrice": 22500,
      "pnl": 5,
      "timestamp": "2024-02-06T04:09:15Z"
    }
  ]
}

Exchange Endpoints

POST/api/exchange/market-order

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)*

Trading symbol (e.g., BTCUSDT)

side (string)*

Order side (buy or sell)

quantity (number)*

Order quantity

Example Response:

{
  "orderId": "123456",
  "symbol": "BTCUSDT",
  "side": "buy",
  "quantity": 0.01,
  "status": "FILLED",
  "timestamp": "2024-02-06T04:03:46Z"
}
POST/api/exchange/limit-order

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)*

Trading symbol (e.g., BTCUSDT)

side (string)*

Order side (buy or sell)

quantity (number)*

Order quantity

price (number)*

Limit price

Example Response:

{
  "orderId": "789012",
  "symbol": "BTCUSDT",
  "side": "sell",
  "quantity": 0.005,
  "price": 22500,
  "status": "NEW",
  "timestamp": "2024-02-06T04:05:12Z"
}
POST/api/exchange/stop-order

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)*

Trading symbol (e.g., BTCUSDT)

side (string)*

Order side (buy or sell)

quantity (number)*

Order quantity

stopPrice (number)*

Stop price

Example Response:

{
  "orderId": "345678",
  "symbol": "BTCUSDT",
  "side": "buy",
  "quantity": 0.01,
  "stopPrice": 23000,
  "status": "TRIGGERED",
  "timestamp": "2024-02-06T04:06:30Z"
}
DELETE/api/exchange/cancel-order

Example Response:

{
  "success": true,
  "message": "Order cancelled successfully",
  "timestamp": "2024-02-06T04:07:45Z"
}
DELETE/api/exchange/cancel-all-orders

Example Response:

{
  "success": true,
  "message": "All orders cancelled successfully",
  "timestamp": "2024-02-06T04:08:00Z"
}
GET/api/exchange/get-orders

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)

Trading symbol (e.g., BTCUSDT)

Example Response:

{
  "orders": [
    {
      "orderId": "123456",
      "symbol": "BTCUSDT",
      "side": "buy",
      "quantity": 0.01,
      "status": "FILLED",
      "timestamp": "2024-02-06T04:03:46Z"
    }
  ]
}
GET/api/exchange/get-positions

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)

Trading symbol (e.g., BTCUSDT)

Example Response:

{
  "positions": [
    {
      "symbol": "BTCUSDT",
      "side": "buy",
      "size": 0.01,
      "entryPrice": 22000,
      "markPrice": 22500,
      "pnl": 5,
      "timestamp": "2024-02-06T04:09:15Z"
    }
  ]
}
GET/api/exchange/get-balance

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)

Trading symbol (e.g., BTCUSDT)

Example Response:

{
  "balance": 1.5,
  "currency": "BTC"
}
POST/api/exchange/set-leverage

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)*

Trading symbol (e.g., BTCUSDT)

leverage (number)*

Leverage amount

Example Response:

{
  "success": true,
  "message": "Leverage set successfully",
  "timestamp": "2024-02-06T04:10:30Z"
}
POST/api/exchange/set-hedge-mode

Parameters:

exchange (string)*

Exchange name (e.g., aevo, binance, bybit, bitmex, hyperliqui)

symbol (string)*

Trading symbol (e.g., BTCUSDT)

isHedged (boolean)*

Hedge mode (true or false)

Example Response:

{
  "success": true,
  "message": "Hedge mode set successfully",
  "timestamp": "2024-02-06T04:11:45Z"
}

Jupiter Protocol Endpoints

GETPOST/api/jupiter

Parameters:

pair (string)*

Trading pair

Example Response:

{
  "inputMint": "SOL",
  "outputMint": "USDC",
  "bestRoute": {
    "inAmount": 1,
    "outAmount": 101.52,
    "priceImpact": 0.1
  }
}
POST/api/jupiter/submit

Parameters:

route (object)*

Selected route object

userPublicKey (string)*

User's public key

Example Response:

{
  "signature": "5KtPn3...",
  "status": "confirmed",
  "timestamp": "2024-02-06T04:03:46Z"
}
POST/api/jupiter/swap

Parameters:

inputMint (string)*

Input token mint address

outputMint (string)*

Output token mint address

amount (number)*

Amount to swap

slippage (number)*

Maximum slippage percentage

Example Response:

{
  "txId": "4zJg7...",
  "inputAmount": 1,
  "outputAmount": 101.52,
  "executedPrice": 101.52
}

Market Data Endpoints

GETPOST/api/market/calendar

Parameters:

date (string)

Date in YYYY-MM-DD format

importance (string)

Event importance (high/medium/low)

Example Response:

{
  "events": [
    {
      "time": "2024-02-06T14:30:00Z",
      "event": "NFP Report",
      "importance": "high",
      "forecast": "180K",
      "previous": "175K"
    }
  ]
}
GETPOST/api/market/fx

Parameters:

pair (string)*

Currency pair (e.g., EURUSD)

Example Response:

{
  "pair": "EURUSD",
  "bid": 1.0754,
  "ask": 1.0756,
  "timestamp": "2024-02-06T04:03:46Z"
}
GETPOST/api/market/volume

Parameters:

symbol (string)*

Trading symbol

timeframe (string)

Time period (1h/4h/1d)

Example Response:

{
  "symbol": "BTCUSDT",
  "volume": 12345.67,
  "timeframe": "1h",
  "timestamp": "2024-02-06T04:03:46Z"
}
GETPOST/api/market/tickers

Parameters:

type (string)

Market type filter (futures or spot)

minimumVolume (number)

Minimum volume filter (USD)

up (number)

Markets up by at least X% (e.g., up=10 for markets up 10%+)

down (number)

Markets down by at least X% (e.g., down=10 for markets down 10%+)

minimumPrice (number)

Minimum price filter

maximumPrice (number)

Maximum price filter

exchange (string)

Filter by specific exchange (e.g., binance, bybit, okx)

health (boolean)

Health check endpoint

Example Response:

{
  "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
}
GETPOST/api/market/tickers/similar

Parameters:

symbol (string)*

Base symbol to find similar tickers

limit (number)

Number of similar tickers to return

Example Response:

{
  "similar": [
    {
      "symbol": "MSFT",
      "similarity": 0.85,
      "sector": "Technology"
    }
  ]
}

LocalStorage Redis Keys

LocalStorage Keys

KeyData Description
isDarkModeTheme setting for dark mode.
user_notificationsSetting for enabling/disabling notifications.
user_settingsGeneral user settings.
user_debug_onSetting for enabling/disabling debugging.
user_login_statusBoolean indicating if the user has logged in.
user_api_keyUser's API key.
wallet_public_keyUser's public key for the wallet.
wallet_private_keyUser's private key for the wallet.
rpc_solana_urlRPC URL for Solana.
rpc_custom_onSetting for using a custom RPC.
rpc_slippage_bpsSlippage basis points for jumps.
encryption_keyKey used for encryption.
encryption_api_keysEncrypted API keys.
market_creation_timeTimes when markets were created.
market_last_checkLast time markets were checked.
market_volume_ssSnapshots of market volumes.
trading_selected_exchangeSelected exchange for trading.
trading_hedge_modeHedge mode setting for trading.
trading_leverageLeverage setting for trading.
trading_selected_symbolSelected trading symbol.
BINANCEAPI keys and secrets for Binance exchange.
BYBITAPI keys and secrets for BYBIT exchange.
BITMEXAPI keys and secrets for BITMEX exchange.
COINBASEAPI keys and secrets for COINBASE exchange.
KRAKENAPI keys and secrets for KRAKEN exchange.
KUCOINAPI keys and secrets for KUCOIN exchange.
PHEMEXAPI keys and secrets for PHEMEX exchange.
HYPERLIQUIDAPI keys and secrets for HYPERLIQUID exchange.
AEVOAPI keys and secrets for AEVO exchange.
DYDXAPI keys and secrets for DYDX exchange.
MERKLEAPI keys and secrets for MERKLE exchange.
GMXAPI keys and secrets for GMX exchange.
SYNFUTURESAPI keys and secrets for SYNFUTURES exchange.

Redis Keys

KeyData Description
system:maintenance_modeMaintenance mode status.
orderly:orderbookOrder book data with bids, asks, and timestamp.
orderly:positionsPositions data with symbol, size, entry price, mark price, PNL, liquidation price, and timestamp.
binance:tickers:spotSpot tickers data for Binance.
binance:tickers:futuresFutures tickers data for Binance.
binance:futures:open-interestOpen interest data for Binance futures.
pubkey:{pubkey}User profile data for a specific public key.
conversation:{id}Details for a specific conversation ID.