API 3Commas

3Commas

 

APIs supported

 

WebSockets API

The websocket feed provides real-time market data updates for Trades and Deals

 

You can subscribe to the following Public channels:

 

Method Arguments Description
SubscribeSmartTrades    
SubscribeDeals    

 

These channels require Authentication against 3Commas servers. So first request your API keys in your 3Commas Account and then set the values in the property ThreeComas of the component:

 

 

If the subscription is successful, the event OnThreeCommasConfirmSubscription will be called. If not, the event OnThreeCommasRejectSubscription is called, you can get the reason of the rejection using the aRawMessage parameter.

 

REST API

Test Connectivity

Method Arguments Description
GetPing    
GetServerTime   Returns the server time

 

Account

Method Arguments Description
GetAccounts   User connected exchanges list
GetMarketList   Supported Market List
GetMarketPairs aMarketCode: code of the market All market pairs
GetCurrencyRatesWithLeverageData aMarketCode: code of the market aPair: pair name Currency rates and limits with leverage data
GetCurrencyRates aMarketCode: code of the market aPair: pair name Currency rates and limits
GetBalances aAccountId: id of the account Load balances for specified exchange
GetAccountTableData aAccountId: id of the account Information about all user balances on specified exchange
GetAccountLeverage aAccountId: id of the account aPair: pair name Information about account leverage
GetAccountInfo aAccountId: id of the account Single Account Info

 

 

Smart Trades

Method Arguments Description
GetSmartTradeHistory   Get the Trade History
PlaceMarketOrder aAccountId: id of the account aOrderSide: buy or sell aPair: pair name aQuantity: amount Places a Market Order
PlaceLimitOrder aAccountId: id of the account aOrderSide: buy or sell aPair: pair name aQuantity: amount aPrice: limit price Places a Limit Order
GetSmartTrade aId: id of the trade Get a Smart Trade by the Id of the Trade
CancelSmartTrade aId: id of the trade Cancel a Smart Trade by the Id of the Trade
CloseByMarketSmartTrade aId: id of the trade  
EditSmartTrade aId: id of the trade Edit an existing Smart Trade
ForceStartSmartTrade aId: id of the trade Force start a Smart Trade
AddFundsSmartTrade aId: id of the trade Add funds to a Smart Trade
GetSmartTradeTrades aId: id of the trade Get trades of a Smart Trade

 

DCA Bot

Method Arguments Description
CreateDCABot Create a new DCA Bot
GetDCABot aId: id of the bot Get a DCA Bot by Id
GetDCABots Get all DCA Bots
EnableDCABot aId: id of the bot Enable a DCA Bot
DisableDCABot aId: id of the bot Disable a DCA Bot
DeleteDCABot aId: id of the bot Delete a DCA Bot
CancelDCABot aId: id of the bot Cancel a DCA Bot
GetDCABotStats Get DCA Bot statistics
GetAvailableStrategyList Get available strategy list
GetBlacklistPairs Get blacklist pairs
AddBlacklistPairs Add blacklist pairs

 

Deals

Method Arguments Description
GetDeals Get all deals
GetDeal aId: id of the deal Get a deal by Id
UpdateDeal aId: id of the deal Update a deal
CancelDeal aId: id of the deal Cancel a deal
CloseAtMarketDeal aId: id of the deal Close a deal at market price

 

Grid Bot

Method Arguments Description
CreateGridBot Create a new Grid Bot
GetGridBot aId: id of the bot Get a Grid Bot by Id
GetGridBots Get all Grid Bots
EnableGridBot aId: id of the bot Enable a Grid Bot
DisableGridBot aId: id of the bot Disable a Grid Bot
DeleteGridBot aId: id of the bot Delete a Grid Bot

 

Events

OnConnect

 

When a new WebSocket connection is open

 

OnDisconnect

 

When a WebSocket connection is closed

 

OnThreeCommasConnect

 

When the client receives a Welcome message from 3Commas server, means the connection is ready.

 

OnThreeCommasConfirmSubscription

 

Confirms a previous subscription sent by the client.

 

OnThreeCommasRejectSubscription

 

There is an error trying to subscribe to a 3Commas channel

 

OnThreeCommasMessage

 

Here the client receives the data sent by server related to the channels subscribed

 

OnThreeCommasPing

 

Ping sent by server to the client.

 

OnThreeCommasHTTPException

 

If there is any error while calling HTTP REST methods, this event will be called.