Phemex
Coming SoonCrypto — Derivatives
connectorType: "phemex"High-performance crypto derivatives exchange
Connection Architecture
Phemex
WebSocket / REST→
Connector
libs/exchange-phemex→
Provider
:8081/api→
Detector
Advisor
Studio
The connector receives data from the exchange and feeds it to Provider (port 8081). From there — to Detector, Advisor, and Studio.
Technologies
Transport
WebSocketREST
Authentication
API Key + SecretData Format
JSONBest for
- High-frequency and latency-sensitive algorithmic traders who need a low-latency matching engine.
- Strategies combining perpetual futures with spot positions for delta-neutral or basis-trading approaches.
- Traders diversifying execution across Bybit, OKX, and Phemex to reduce single-venue concentration risk.
- Developers stress-testing order throughput who want an exchange built to institutional engineering standards.
Connect via code
1Environment variables (.env)
PHEMEX_API_KEY=your_key_here PHEMEX_API_SECRET=your_secret_here
2Connector configuration
// config/config.provider.json
{
"provider": {
"connectors": [
{
"connectorType": "phemex",
"enabled": true,
"key": "${PHEMEX_API_KEY}",
"secret": "${PHEMEX_API_SECRET}",
"markets": [
{ "marketType": "spot", "symbols": [{ "name": "BTCUSDT" }] }
],
"subscriptions": [
{ "type": "PROVIDER_MARKETDATA_CANDLE", "symbols": ["BTCUSDT"], "intervals": ["min1", "h1"], "active": true },
{ "type": "PROVIDER_MARKETDATA_TRADE", "symbols": ["BTCUSDT"], "active": true },
{ "type": "PROVIDER_MARKETDATA_ORDERBOOK", "symbols": ["BTCUSDT"], "active": true }
]
}
]
}
}3Verify and query data
# Verify connection curl -H "Authorization: Bearer $PROVIDER_API_TOKEN" \ https://localhost:8081/api/exchanges/runtime-proof # Candles (last 7 days) curl -H "Authorization: Bearer $PROVIDER_API_TOKEN" \ "https://localhost:8081/api/candles/phemex/spot/BTCUSDT/h1?days=7"
Available via Barfinex API
/api/candles/phemex/...
/api/trades/phemex/...
/api/orderbook/phemex/...
/api/account/phemex/...
/api/symbols/phemex/...
/api/assets/phemex/...
Studio graphical setup — in development, coming in the next release.
Important
Phemex uses separate API key permissions for trading, read-only data, and withdrawals — create a trading-only key to limit exposure.
Perpetual contract symbols on Phemex use an uppercase format (e.g., BTCUSD for inverse, BTCUSDT for linear) — confirm the symbol convention before configuring subscriptions.
The testnet environment is available at testnet.phemex.com with separate credentials; use it to validate your strategy configuration before going live.
Rate limits differ between REST and WebSocket endpoints; real-time data streaming via WebSocket is preferred for order-book subscriptions.
Supported Markets
SpotFutures
Websitewww.phemex.com
Connect in Studio(soon)
Exchange Website