3Commas Trading Bot API

Manage automated trading bots, deals, and smart trades across multiple exchanges through the 3Commas WebSocket gateway.

TsgcWSAPI_ThreeCommas

Streams deals and smart-trade updates from the 3Commas trading-bot platform over its WebSocket gateway. Pairs with TsgcWebSocketClient for the transport.

Component class

TsgcWSAPI_ThreeCommas

Platforms

Windows, macOS, Linux, iOS, Android

Edition

Standard / Professional / Enterprise

Drop the component, set keys, subscribe

Plug a TsgcWebSocketClient into the API component, set ApiKey / ApiSecret in the ThreeCommas group, then SubscribeDeals or SubscribeSmartTrades.

uses
  sgcWebSocket, sgcWebSocket_API_ThreeCommas;

var
  WSClient: TsgcWebSocketClient;
  ThreeCommas: TsgcWSAPI_ThreeCommas;
begin
  WSClient := TsgcWebSocketClient.Create(nil);

  ThreeCommas := TsgcWSAPI_ThreeCommas.Create(nil);
  ThreeCommas.Client := WSClient;
  ThreeCommas.ThreeCommas.ApiKey    := 'your-api-key';
  ThreeCommas.ThreeCommas.ApiSecret := 'your-api-secret';

  WSClient.Active := True;

  ThreeCommas.SubscribeDeals;
  ThreeCommas.SubscribeSmartTrades;
end;
// uses: sgcWebSocket, sgcWebSocket_API_ThreeCommas
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);

TsgcWSAPI_ThreeCommas *ThreeCommas = new TsgcWSAPI_ThreeCommas(this);
ThreeCommas->Client = WSClient;
ThreeCommas->ThreeCommas->ApiKey    = "your-api-key";
ThreeCommas->ThreeCommas->ApiSecret = "your-api-secret";

WSClient->Active = true;

ThreeCommas->SubscribeDeals();
ThreeCommas->SubscribeSmartTrades();

What's inside

A typed wrapper around the 3Commas WebSocket gateway with HMAC-signed subscriptions and event-driven payload delivery.

Deals stream

SubscribeDeals / UnSubscribeDeals open the DealsChannel server-side. The component delivers deal create/update/close events as new bots fire across connected exchanges.

Smart trades stream

SubscribeSmartTrades / UnSubscribeSmartTrades open SmartTradesChannel for status changes (filling, finished, cancelled) of every active smart-trade order.

Authentication

Set ThreeCommas.ApiKey and ThreeCommas.ApiSecret — the component computes the per-channel HMAC-SHA256 identifier 3Commas requires for private streams.

WebSocket transport

Bind to any TsgcWebSocketClient via Client. WatchDog, HeartBeat, Authentication and TLS settings live on the WebSocket client — this component focuses on protocol framing.

Lifecycle events

OnConnect, OnDisconnect, OnException propagate from the underlying client. OnMessage exposes every raw frame for logging or custom routing.

Combine with exchanges

Drop sibling components like TsgcWSAPI_Binance or TsgcWSAPI_Coinbase on the same form to correlate 3Commas bot events with underlying exchange ticks.

Specifications & references

Authoritative sources for the APIs this component implements.

Documentation & Demos

Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.

Online Help — API_3Commas Full property, method and event reference for this component.
Demo Project — Demos\05.Crypto\10.ThreeCommas Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below.
Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only.
User Manual (PDF) Comprehensive manual covering every component in the library.

Ready to Automate 3Commas Trading?

Download the free trial and stream deals and smart trades into your Delphi applications.