COYTX Developer & Algorithmic API

High-performance REST API and ultra-low latency WebSocket streams for algorithmic trading bots, quantitative funds, and market-making strategies.

Base Endpoints

REST API: https://coytx.com/api
WebSocket Server: wss://coytx.com/ws/

Authentication & Request Signing

All private endpoints require cryptographic request signatures. You must pass your API Key and a computed HMAC-SHA256 signature in the HTTP headers:

Header FieldTypeDescription
X-COYTX-APIKEYStringYour public API key generated in the COYTX Security Center.
X-COYTX-TIMESTAMPIntegerCurrent UNIX timestamp in milliseconds (e.g. 1789249000000).
X-COYTX-SIGNATUREHex StringHMAC-SHA256 signature of timestamp + method + request_path + body.

Rate Limits & Request Weight

COYTX enforces an institutional sliding window rate limiter:

  • Public Endpoints: Up to 1,200 request weight per minute per IP address.
  • Private Trading Endpoints: Up to 2,400 weight per minute per API key.
  • WebSocket Connections: Up to 5 concurrent persistent socket connections per IP.

GET/api/crypto_rates

Retrieves real-time mark prices, 24-hour turnover, percentage change, and high/low values for all actively traded markets.

GET https://coytx.com/api/crypto_rates
Example Response (200 OK)
{
  "status": "success",
  "data": {
    "BTC_USDT": {
      "price": 89450.20,
      "change_24h": 2.45,
      "high_24h": 90120.00,
      "low_24h": 87310.50,
      "volume_24h": 14205.82
    },
    "ETH_USDT": {
      "price": 3210.50,
      "change_24h": -0.85,
      "high_24h": 3260.00,
      "low_24h": 3175.20,
      "volume_24h": 45890.10
    }
  }
}

GET/api/orderbook

Returns aggregated bids and asks depth for a given perpetual symbol.

GET https://coytx.com/api/orderbook?symbol=BTC_USDT&depth=20
Example Response (200 OK)
{
  "symbol": "BTC_USDT",
  "timestamp": 1789249000,
  "bids": [
    ["89450.00", "1.245"],
    ["89448.50", "0.850"],
    ["89445.00", "3.120"]
  ],
  "asks": [
    ["89450.50", "2.100"],
    ["89452.00", "0.450"],
    ["89455.00", "5.800"]
  ]
}

GET/api/terminal/trades

Returns execution history of recent public market trades.

GET https://coytx.com/api/terminal/trades?symbol=BTC_USDT&limit=50

POST/api/terminal/order

Submits a new limit or market order into the matching engine.

POST https://coytx.com/api/terminal/order
FieldTypeMandatoryValues
symbolStringYese.g. BTC_USDT
sideStringYesBUY (Long) or SELL (Short)
typeStringYesLIMIT or MARKET
priceFloatIf LIMITLimit execution price
amountFloatYesContract order quantity
leverageIntegerYesBetween 1 and 100
Example JSON Payload
{
  "symbol": "BTC_USDT",
  "side": "BUY",
  "type": "LIMIT",
  "price": 89400.00,
  "amount": 0.05,
  "leverage": 10
}

POST/api/terminal/order/cancel

Cancels an active resting limit order from the book.

Payload
{
  "order_id": "ord_983194021"
}

GET/api/terminal/open_orders

Returns all pending limit orders for the authenticated account.

WSSReal-Time WebSocket Streams

Subscribe to live price ticker updates, real-time depth updates, and instant trade executions:

Subscribe Payload
// Connect to wss://coytx.com/ws/
{
  "action": "subscribe",
  "channels": [
    "ticker@BTC_USDT",
    "depth20@BTC_USDT",
    "trades@BTC_USDT"
  ]
}

SDK & Code Samples (Python)

Python 3 Algorithmic Bot Example
import requests
import json
import time
import hmac
import hashlib

API_KEY = "your_api_key"
API_SECRET = "your_secret_key"
BASE_URL = "https://coytx.com/api"

def place_order(symbol, side, order_type, price, amount, leverage=10):
    path = "/terminal/order"
    timestamp = str(int(time.time() * 1000))
    payload = {
        "symbol": symbol,
        "side": side,
        "type": order_type,
        "price": price,
        "amount": amount,
        "leverage": leverage
    }
    body = json.dumps(payload)
    sign_str = f"{timestamp}POST{path}{body}"
    signature = hmac.new(API_SECRET.encode(), sign_str.encode(), hashlib.sha256).hexdigest()
    
    headers = {
        "X-COYTX-APIKEY": API_KEY,
        "X-COYTX-TIMESTAMP": timestamp,
        "X-COYTX-SIGNATURE": signature,
        "Content-Type": "application/json"
    }
    
    response = requests.post(BASE_URL + path, json=payload, headers=headers)
    return response.json()

# Example: Buy 0.05 BTC at $89,400 with 10x leverage
res = place_order("BTC_USDT", "BUY", "LIMIT", 89400.0, 0.05, 10)
print(res)