Skip to main content

Sell all to BTC

POST
/ver1/accounts/:account_id/sell_all_to_btc
Permission: ACCOUNTS_WRITE
Security: SIGNED

Sells all assets on the exchange account in BTC, creating orders on the exchange.

This endpoint works for the following exchanges: Binance Spot, Binance Margin, Binance US, Coinbase Advanced Spot, Gemini Spot, Kraken Spot, Bybit Spot, GateIo, OKX Spot, Huobi Spot, Bitfinex Spot, Kucoin Spot, Bitstamp Spot.

When executing this request, all trading entities (bots, SmartTrade, trades, deals, and orders—except for Signal Bot) will be stopped and closed both in 3Commas and on the exchange.


Path Parameter

account_idintegerrequired

Unique 3Commas ID of this exchange account entity.

Example Request

POST
/ver1/accounts/32833909/sell_all_to_btc

Response Parameters

If successful, the response includes a copy of the updated Account entity.

Example Responses

{
"id": 32402783,
"auto_balance_period": 12,
"auto_balance_portfolio_id": null,
"auto_balance_currency_change_limit": null,
"autobalance_enabled": false,
"hedge_mode_available": false,
"hedge_mode_enabled": false,
"is_locked": false,
"smart_trading_supported": true,
"smart_selling_supported": true,
"available_for_trading": {},
"stats_supported": true,
"trading_supported": true,
"market_buy_supported": true,
"market_sell_supported": true,
"conditional_buy_supported": true,
"bots_allowed": true,
"bots_ttp_allowed": true,
"bots_tsl_allowed": true,
"gordon_bots_available": true,
"multi_bots_allowed": true,
"created_at": "2023-06-19T16:50:57.303Z",
"updated_at": "2023-06-19T17:16:29.008Z",
"last_auto_balance": null,
"fast_convert_available": true,
"grid_bots_allowed": true,
"api_key_invalid": false,
"market_icon": "https://3commas.io/img/exchanges/binance.png",
"deposit_enabled": true,
"include_in_summary": true,
"supported_market_types": [
"spot"
],
"primary_display_currency_profit_percentage": {
"currency": "USD",
"amount": "4.08"
},
"primary_display_currency_profit": {
"currency": "USD",
"amount": "1.1904074327111530753265032408092397310973795168"
},
"day_profit_primary_display_currency_percentage": {
"currency": "USD",
"amount": "1.0106"
},
"day_profit_primary_display_currency": {
"currency": "USD",
"amount": "0.303798359197846162240938425994424916390118897162"
},
"primary_display_currency_amount": {
"currency": "USD",
"amount": "30.3654836868311530753265032408092397310973795168"
},
"total_primary_display_currency_profit": {
"currency": "USD",
"amount": 6.365483686831153
},
"available_include_in_summary": true,
"name": "My Binance US",
"auto_balance_method": null,
"auto_balance_error": null,
"customer_id": null,
"subaccount_name": null,
"lock_reason": null,
"btc_amount": "0.00048354921680019174575329053051358334806752",
"usd_amount": "30.3654836868311530753265032408092397310973795168",
"day_profit_btc": "0.000004484441392636909809798397735805570289805668147599",
"day_profit_usd": "0.303798359197846162240938425994424916390118897162",
"day_profit_btc_percentage": "0.94",
"day_profit_usd_percentage": "1.01",
"btc_profit": "-0.00000742390628421825424670946948641665193248",
"usd_profit": "1.1904074327111530753265032408092397310973795168",
"usd_profit_percentage": "4.08",
"btc_profit_percentage": "-1.51",
"total_btc_profit": "-0.0003449895239452033",
"total_usd_profit": "6.365483686831153",
"pretty_display_type": "BinanceUs",
"exchange_name": "Binance US Spot",
"market_code": "binance_us",
"api_keys_state": "ok"
}