diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
new file mode 100644
index 0000000..ec70354
--- /dev/null
+++ b/.github/workflows/python-publish.yml
@@ -0,0 +1,39 @@
+# This workflow will upload a Python Package using Twine when a release is created
+# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
+
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+name: Upload Python Package
+
+on:
+ release:
+ types: [published]
+
+permissions:
+ contents: read
+
+jobs:
+ deploy:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v3
+ with:
+ python-version: '3.x'
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install build
+ - name: Build package
+ run: python -m build
+ - name: Publish package
+ uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
+ with:
+ user: __token__
+ password: ${{ secrets.PYPI_API_TOKEN }}
diff --git a/Pipfile b/Pipfile
index 602b9fd..174993c 100644
--- a/Pipfile
+++ b/Pipfile
@@ -10,7 +10,7 @@ py3cw = "*"
python-dotenv = "*"
aenum = "*"
websockets = "*"
-twine = "*"
+prodict = "*"
[dev-packages]
diff --git a/Pipfile.lock b/Pipfile.lock
index dad5eeb..60044f0 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "97f7f3ba70f61cd719057d01358f85531f5c2ebb3af50564f7b2fee9315df5b9"
+ "sha256": "ccfe5bd9e151c60b64fa6265003c7a644984ea8b7e35c55f3e6db28557a0b606"
},
"pipfile-spec": 6,
"requires": {
@@ -33,14 +33,6 @@
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
"version": "==21.4.0"
},
- "bleach": {
- "hashes": [
- "sha256:08a1fe86d253b5c88c92cc3d810fd8048a16d15762e1e5b74d502256e5926aa1",
- "sha256:c6d6cc054bdc9c83b48b8083e236e5f00f238428666d2ce2e083eaa5fd568565"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==5.0.0"
- },
"cachetools": {
"hashes": [
"sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757",
@@ -59,26 +51,11 @@
},
"charset-normalizer": {
"hashes": [
- "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597",
- "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"
- ],
- "markers": "python_version >= '3.5'",
- "version": "==2.0.12"
- },
- "commonmark": {
- "hashes": [
- "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60",
- "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"
+ "sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5",
+ "sha256:575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413"
],
- "version": "==0.9.1"
- },
- "docutils": {
- "hashes": [
- "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c",
- "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"
- ],
- "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
- "version": "==0.18.1"
+ "markers": "python_version >= '3.6'",
+ "version": "==2.1.0"
},
"idna": {
"hashes": [
@@ -88,14 +65,6 @@
"markers": "python_version >= '3.5'",
"version": "==3.3"
},
- "importlib-metadata": {
- "hashes": [
- "sha256:5d26852efe48c0a32b0509ffbc583fda1a2266545a78d104a6f4aff3db17d700",
- "sha256:c58c8eb8a762858f49e18436ff552e83914778e50e9d2f1660535ffb364552ec"
- ],
- "markers": "python_version < '3.10'",
- "version": "==4.11.4"
- },
"iniconfig": {
"hashes": [
"sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3",
@@ -103,14 +72,6 @@
],
"version": "==1.1.1"
},
- "keyring": {
- "hashes": [
- "sha256:372ff2fc43ab779e3f87911c26e6c7acc8bb440cbd82683e383ca37594cb0617",
- "sha256:3ac00c26e4c93739e19103091a9986a9f79665a78cf15a4df1dba7ea9ac8da2f"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==23.6.0"
- },
"packaging": {
"hashes": [
"sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb",
@@ -119,14 +80,6 @@
"markers": "python_version >= '3.6'",
"version": "==21.3"
},
- "pkginfo": {
- "hashes": [
- "sha256:848865108ec99d4901b2f7e84058b6e7660aae8ae10164e015a6dcf5b242a594",
- "sha256:a84da4318dd86f870a9447a8c98340aa06216bfc6f2b7bdc4b8766984ae1867c"
- ],
- "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
- "version": "==1.8.3"
- },
"pluggy": {
"hashes": [
"sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159",
@@ -135,6 +88,13 @@
"markers": "python_version >= '3.6'",
"version": "==1.0.0"
},
+ "prodict": {
+ "hashes": [
+ "sha256:7a4dfa0f9d361b34fc0f7367ec67923f97595f79917730f19fda7ec078dd1d77"
+ ],
+ "index": "pypi",
+ "version": "==0.8.18"
+ },
"py": {
"hashes": [
"sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719",
@@ -151,14 +111,6 @@
"index": "pypi",
"version": "==0.0.39"
},
- "pygments": {
- "hashes": [
- "sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb",
- "sha256:dc9c10fb40944260f6ed4c688ece0cd2048414940f1cea51b8b226318411c519"
- ],
- "markers": "python_version >= '3.6'",
- "version": "==2.12.0"
- },
"pyparsing": {
"hashes": [
"sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb",
@@ -183,52 +135,13 @@
"index": "pypi",
"version": "==0.20.0"
},
- "readme-renderer": {
- "hashes": [
- "sha256:73b84905d091c31f36e50b4ae05ae2acead661f6a09a9abb4df7d2ddcdb6a698",
- "sha256:a727999acfc222fc21d82a12ed48c957c4989785e5865807c65a487d21677497"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==35.0"
- },
"requests": {
"hashes": [
- "sha256:bc7861137fbce630f17b03d3ad02ad0bf978c844f3536d0edda6499dafce2b6f",
- "sha256:d568723a7ebd25875d8d1eaf5dfa068cd2fc8194b2e483d7b1f7c81918dbec6b"
- ],
- "markers": "python_version >= '3.7' and python_full_version < '4.0.0'",
- "version": "==2.28.0"
- },
- "requests-toolbelt": {
- "hashes": [
- "sha256:380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f",
- "sha256:968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
- ],
- "version": "==0.9.1"
- },
- "rfc3986": {
- "hashes": [
- "sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd",
- "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==2.0.0"
- },
- "rich": {
- "hashes": [
- "sha256:4c586de507202505346f3e32d1363eb9ed6932f0c2f63184dea88983ff4971e2",
- "sha256:d2bbd99c320a2532ac71ff6a3164867884357da3e3301f0240090c5d2fdac7ec"
+ "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983",
+ "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"
],
- "markers": "python_full_version >= '3.6.3' and python_full_version < '4.0.0'",
- "version": "==12.4.4"
- },
- "six": {
- "hashes": [
- "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
- "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
- ],
- "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
- "version": "==1.16.0"
+ "markers": "python_version >= '3.7' and python_version < '4'",
+ "version": "==2.28.1"
},
"tomli": {
"hashes": [
@@ -238,37 +151,14 @@
"markers": "python_version >= '3.7'",
"version": "==2.0.1"
},
- "twine": {
- "hashes": [
- "sha256:42026c18e394eac3e06693ee52010baa5313e4811d5a11050e7d48436cf41b9e",
- "sha256:96b1cf12f7ae611a4a40b6ae8e9570215daff0611828f5fe1f37a16255ab24a0"
- ],
- "index": "pypi",
- "version": "==4.0.1"
- },
- "typing-extensions": {
- "hashes": [
- "sha256:6657594ee297170d19f67d55c05852a874e7eb634f4f753dbd667855e07c1708",
- "sha256:f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376"
- ],
- "markers": "python_version < '3.9'",
- "version": "==4.2.0"
- },
"urllib3": {
"hashes": [
"sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14",
"sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"
],
- "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_full_version < '4.0.0'",
+ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'",
"version": "==1.26.9"
},
- "webencodings": {
- "hashes": [
- "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78",
- "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"
- ],
- "version": "==0.5.1"
- },
"websockets": {
"hashes": [
"sha256:07cdc0a5b2549bcfbadb585ad8471ebdc7bdf91e32e34ae3889001c1c106a6af",
@@ -322,14 +212,6 @@
],
"index": "pypi",
"version": "==10.3"
- },
- "zipp": {
- "hashes": [
- "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad",
- "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099"
- ],
- "markers": "python_version >= '3.7'",
- "version": "==3.8.0"
}
},
"develop": {}
diff --git a/setup.py b/setup.py
index da6e13f..3fb5155 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@
'three_commas.utils',
'three_commas.streams',
],
- version='0.2.2',
+ version='0.2.9',
description='Python api wrapper for 3commas with extended functionality in the api, models, error handling',
url='https://github.com/badass-blockchain/python-three-commas',
author='Sergey Gerodes',
@@ -35,6 +35,7 @@
install_requires=[
'py3cw',
'cachetools',
- 'aenum'
+ 'aenum',
+ 'websockets'
]
)
diff --git a/src/three_commas/api/v2/smart_trades.py b/src/three_commas/api/v2/smart_trades.py
index 7ad3ff5..ffb44d1 100644
--- a/src/three_commas/api/v2/smart_trades.py
+++ b/src/three_commas/api/v2/smart_trades.py
@@ -28,7 +28,7 @@ def get(payload: dict = None) -> Tuple[ThreeCommasApiError, List[SmartTradeV2Ent
@logged
@with_py3cw
-def post(payload: dict = None):
+def post(payload: dict = None) -> Tuple[ThreeCommasApiError, SmartTradeV2Entity]:
"""
POST /v2/smart_trades
Create smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)
@@ -39,7 +39,7 @@ def post(payload: dict = None):
action='new',
payload=payload,
)
- return ThreeCommasApiError(error), data
+ return ThreeCommasApiError(error), SmartTradeV2Entity(data)
@logged
diff --git a/src/three_commas/api/ver1/accounts.py b/src/three_commas/api/ver1/accounts.py
index aabd0e6..b166a17 100644
--- a/src/three_commas/api/ver1/accounts.py
+++ b/src/three_commas/api/ver1/accounts.py
@@ -60,7 +60,7 @@ def get_transfer_data(payload: dict = None):
@logged
@with_py3cw
-def post_new(payload: dict = None):
+def post_new(payload: dict = None) -> Tuple[ThreeCommasApiError, AccountEntity]:
"""
POST /ver1/accounts/new
Add exchange account (Permission: ACCOUNTS_WRITE, Security: SIGNED)
@@ -71,7 +71,7 @@ def post_new(payload: dict = None):
action='new',
payload=payload,
)
- return ThreeCommasApiError(error), data
+ return ThreeCommasApiError(error), AccountEntity(data)
@logged
@@ -399,7 +399,7 @@ def get_leverage_data_by_id(id, payload: dict = None):
@logged
@with_py3cw
-def get_by_id(id, payload: dict = None):
+def get_by_id(id, payload: dict = None) -> Tuple[ThreeCommasApiError, AccountEntity]:
"""
GET /ver1/accounts/{account_id}
Single Account Info (Permission: ACCOUNTS_READ, Security: SIGNED)
@@ -412,6 +412,6 @@ def get_by_id(id, payload: dict = None):
action_id=str(id),
payload=payload,
)
- return ThreeCommasApiError(error), data
+ return ThreeCommasApiError(error), AccountEntity(data)
diff --git a/src/three_commas/error.py b/src/three_commas/error.py
index 9bdf9de..3eb7e49 100644
--- a/src/three_commas/error.py
+++ b/src/three_commas/error.py
@@ -13,8 +13,13 @@ class BaseOrderToSmallErrorElement:
pair: str = None
-class ThreeCommasApiError(ThreeCommasDict):
+def cast_bool(func):
+ def wrapped(*args, **kwargs):
+ return bool(func(*args, **kwargs))
+ return wrapped
+
+class ThreeCommasApiError(ThreeCommasDict):
BO_TO_SMALL_ERROR_PATTERN = re.compile(r"Base order size is too small\. Min: ([0-9.]*),? ?([\w_]+)?", re.IGNORECASE)
NO_MARKET_PAIR_ERROR_PATTERN = re.compile(r"No market data for this pair: ([^\']*)\'", re.IGNORECASE)
EXTRACT_PY3CW_MESSAGE_PATTERN = re.compile(r"Other error occurred: record_invalid Invalid parameters (\{.*\})\.", re.IGNORECASE)
@@ -22,19 +27,41 @@ class ThreeCommasApiError(ThreeCommasDict):
BOT_DID_NOT_EXISTED_OR_BELONGS_TO_OTHER_ACCOUNT_ERROR_PATTERN = re.compile(r"Other error occurred: not_found Not Found None", re.IGNORECASE)
API_KEY_NOT_ENOUGH_PERMISSION_PATTERN = re.compile(r"access_denied Api key doesn't have enough permissions", re.IGNORECASE)
API_KEY_INVALID_OR_EXPIRED_PATTERN = re.compile(r'api_key_invalid_or_expired Unauthorized. Invalid or expired api key', re.IGNORECASE)
+ API_KEY_NOT_AUTHORIZED_FOR_THIS_ACTION_PATTERN = re.compile(r'key not authorized for this action', re.IGNORECASE)
+ ACCOUNT_ALREADY_CONNECTED_PATTERN = re.compile(r'This account is already connected!', re.IGNORECASE)
+ ACCOUNT_NOT_DELETABLE_PATTERN = re.compile(r"account_not_deletable Can't remove account.", re.IGNORECASE)
+
+ @cast_bool
+ def is_account_not_deletable_error(self) -> bool:
+ if self.get_status_code() and self.get_status_code() != 422:
+ return False
+ return self._has_error_message() and self.ACCOUNT_NOT_DELETABLE_PATTERN.findall(self.get_msg())
+ @cast_bool
+ def is_account_already_connected_error(self) -> bool:
+ return self._has_error_message() and self.ACCOUNT_ALREADY_CONNECTED_PATTERN.findall(self.get_msg())
+
+ @cast_bool
+ def is_api_key_not_authorized_for_this_action_error(self) -> bool:
+ return self._has_error_message() and self.API_KEY_NOT_AUTHORIZED_FOR_THIS_ACTION_PATTERN.findall(self.get_msg())
+
+ @cast_bool
def is_api_key_has_no_permission_error(self) -> bool:
return self._has_error_message() and self.API_KEY_NOT_ENOUGH_PERMISSION_PATTERN.findall(self.get_msg())
+ @cast_bool
def is_api_key_invalid_or_expired(self) -> bool:
return self._has_error_message() and self.API_KEY_INVALID_OR_EXPIRED_PATTERN.findall(self.get_msg())
+ @cast_bool
def is_base_order_to_small_error(self) -> bool:
return self._has_error_message() and self.BO_TO_SMALL_ERROR_PATTERN.findall(self.get_msg())
+ @cast_bool
def is_not_found_error(self) -> bool:
return self._has_error_message() and 'not_found' in self.get_msg() or 'Not found' in self.get_msg()
+ @cast_bool
def is_no_market_pair_error(self) -> List[str]:
return self._has_error_message() and self.NO_MARKET_PAIR_ERROR_PATTERN.findall(self.get_msg())
@@ -65,12 +92,16 @@ def get_base_order_to_small_error(self) -> List[BaseOrderToSmallErrorElement]:
ret.append(BaseOrderToSmallErrorElement(amount=amount, pair=pair))
return ret
- def _has_error_message(self):
- return self and self.get_msg()
+ @cast_bool
+ def _has_error_message(self) -> bool:
+ return bool(self and self.get_msg())
- def get_msg(self):
+ def get_msg(self) -> str:
return self.get('msg')
+ def get_status_code(self) -> int:
+ return self.get('status_code', None)
+
class ThreeCommasException(RuntimeError):
pass
diff --git a/src/three_commas/model/models.py b/src/three_commas/model/models.py
index fc186dd..991e5a5 100644
--- a/src/three_commas/model/models.py
+++ b/src/three_commas/model/models.py
@@ -4,6 +4,7 @@
import functools
import logging
from .. import configuration
+import copy
logger = logging.getLogger(__name__)
@@ -125,11 +126,20 @@ def wrapper(*args, parsed: bool = True, **kwargs):
class ThreeCommasDict(dict):
+ # TODO probably switch to prodict https://github.com/ramazanpolat/prodict
def __init__(self, *args, **kwargs):
if not args and not kwargs or (args and args[0] is None):
return
super().__init__(*args, **kwargs)
+ @classmethod
+ def deepcopy(cls, copy_from: dict):
+ cp = copy.deepcopy(copy_from)
+ return cls(cp)
+
+ def __deepcopy__(self, memo=None):
+ return self.__class__(copy.deepcopy(dict(self), memo=memo))
+
@classmethod
def of_list(cls, list_of_d: List[dict]) -> List[cls]:
if list_of_d is None:
diff --git a/type_generators/3commas_swaggerdoc.json b/type_generators/3commas_swaggerdoc.json
index f13c217..1dc3b34 100644
--- a/type_generators/3commas_swaggerdoc.json
+++ b/type_generators/3commas_swaggerdoc.json
@@ -1,6 +1,6 @@
{
"info": {
- "title": "3commas API",
+ "title": "3Commas Public API",
"version": "0.0.1"
},
"swagger": "2.0",
@@ -18,17 +18,13 @@
"name": "deals",
"description": "Operations about deals"
},
- {
- "name": "users",
- "description": "Operations about users"
- },
{
"name": "accounts",
"description": "Operations about accounts"
},
{
- "name": "smart_trades",
- "description": "Operations about smart_trades"
+ "name": "users",
+ "description": "Operations about users"
},
{
"name": "marketplace",
@@ -42,6 +38,10 @@
"name": "loose_accounts",
"description": "Operations about loose_accounts"
},
+ {
+ "name": "mini_apps",
+ "description": "Operations about mini_apps"
+ },
{
"name": "ping",
"description": "Operations about pings"
@@ -53,9 +53,65 @@
{
"name": "smart_trades_v2",
"description": "Operations about smart_trades_v2s"
+ },
+ {
+ "name": "accounts",
+ "description": "Operations about accounts"
}
],
"paths": {
+ "/ver1/bots/account_trade_info_smart_sell": {
+ "get": {
+ "description": "Smart Sell Account Table Info (Permission: NONE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Smart Sell Account Table Info (Permission: NONE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1BotsAccountTradeInfoSmartSell"
+ }
+ },
+ "/ver1/bots/account_trade_info": {
+ "get": {
+ "description": "Account Trade Info (Permission: NONE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Account Trade Info (Permission: NONE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1BotsAccountTradeInfo"
+ }
+ },
"/ver1/bots/strategy_list": {
"get": {
"description": "Available strategy list for bot (Permission: BOTS_READ, Security: SIGNED)",
@@ -133,12 +189,8 @@
{
"in": "formData",
"name": "pairs",
- "type": "array",
- "items": {
- "type": "string"
- },
- "required": true,
- "example": "BTC_USDT"
+ "type": "string",
+ "required": true
}
],
"responses": {
@@ -180,10 +232,7 @@
"in": "formData",
"name": "pairs",
"description": "Pass single pair to create SingleBot or any other number of pairs to create MultiBot",
- "type": "array",
- "items": {
- "type": "string"
- },
+ "type": "string",
"required": true
},
{
@@ -346,7 +395,7 @@
{
"in": "formData",
"name": "strategy_list",
- "description": "For manual signals: [{\"strategy\":\"manual\"}] or []
\n For non-stop(1 pair only): [{\"strategy\":\"nonstop\"}]
\n QFL: {\"options\": {\"type\": \"original\"}, {\"percent\": 3}, \"strategy\": \"qfl\"}]
\n TradingView: [{\"options\": {\"time\": \"5m\", \"type\": \"buy_or_strong_buy\"}, \"strategy\": \"trading_view\"} ",
+ "description": "For manual signals: [{\"strategy\":\"manual\"}] or []
For non-stop(1 pair only): [{\"strategy\":\"nonstop\"}]
QFL: [{\"options\": {\"type\": \"original\"}, {\"percent\": 3}, \"strategy\": \"qfl\"}]
TradingView: [{\"options\": {\"time\": \"5m\", \"type\": \"buy_or_strong_buy\"}, \"strategy\": \"trading_view\"}]
RSI: [{\"options\": {\"time\": \"5m\", \"points\": 30, \"trigger_condition\": \"less\", \"time_period\": 7}, \"strategy\": \"rsi\"}]",
"type": "array",
"items": {
"type": "json"
@@ -537,6 +586,7 @@
"in": "query",
"name": "scope",
"type": "string",
+ "default": null,
"enum": [
"enabled",
"disabled"
@@ -547,6 +597,7 @@
"in": "query",
"name": "strategy",
"type": "string",
+ "default": null,
"enum": [
"long",
"short"
@@ -582,6 +633,17 @@
"description": "Quote currency",
"type": "string",
"required": false
+ },
+ {
+ "in": "query",
+ "name": "form_type",
+ "description": "Param for a filter by bot form type (gordon/advanced)",
+ "type": "string",
+ "enum": [
+ "gordon",
+ "advanced"
+ ],
+ "required": false
}
],
"responses": {
@@ -698,10 +760,7 @@
{
"in": "formData",
"name": "pairs",
- "type": "array",
- "items": {
- "type": "string"
- },
+ "type": "string",
"required": true
},
{
@@ -853,7 +912,7 @@
{
"in": "formData",
"name": "strategy_list",
- "description": "For manual signals: [{\"strategy\":\"manual\"}] or []
\n For non-stop(1 pair only): [{\"strategy\":\"nonstop\"}]
\n QFL: {\"options\": {\"type\": \"original\"}, {\"percent\": 3}, \"strategy\": \"qfl\"}]
\n TradingView: [{\"options\": {\"time\": \"5m\", \"type\": \"buy_or_strong_buy\", \"strategy\": \"trading_view\"} ",
+ "description": "For manual signals: [{\"strategy\":\"manual\"}] or []
For non-stop(1 pair only): [{\"strategy\":\"nonstop\"}]
QFL: [{\"options\": {\"type\": \"original\"}, {\"percent\": 3}, \"strategy\": \"qfl\"}]
TradingView: [{\"options\": {\"time\": \"5m\", \"type\": \"buy_or_strong_buy\"}, \"strategy\": \"trading_view\"}]
RSI: [{\"options\": {\"time\": \"5m\", \"points\": 30, \"trigger_condition\": \"less\", \"time_period\": 7}, \"strategy\": \"rsi\"}]",
"type": "array",
"items": {
"type": "json"
@@ -981,6 +1040,14 @@
"format": "int32",
"required": false
},
+ {
+ "in": "formData",
+ "name": "close_deals_timeout",
+ "description": "Close bot deals after given number of seconds. Must be greater than 60.",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
{
"in": "path",
"name": "bot_id",
@@ -1089,6 +1156,14 @@
"type": "boolean",
"required": false
},
+ {
+ "in": "formData",
+ "name": "only_for_enabled",
+ "description": "If set true and bot disabled will return error(422 code), if false and bot disabled then enable it",
+ "type": "boolean",
+ "default": false,
+ "required": false
+ },
{
"in": "path",
"name": "bot_id",
@@ -1232,6 +1307,7 @@
"in": "query",
"name": "include_events",
"type": "boolean",
+ "default": false,
"required": false
},
{
@@ -1284,6 +1360,13 @@
"type": "string",
"required": false
},
+ {
+ "in": "query",
+ "name": "to",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "required": false
+ },
{
"in": "query",
"name": "account_id",
@@ -1372,6 +1455,7 @@
"in": "formData",
"name": "stop_bot",
"type": "boolean",
+ "default": false,
"required": false
},
{
@@ -1810,7 +1894,7 @@
},
"/ver1/deals/{deal_id}/data_for_adding_funds": {
"get": {
- "description": "Info required to add funds correctly: available amounts, exchange limitations etc (Permission: BOTS_READ, Security: SIGNED)",
+ "description": "Info required to add funds correctly: available amounts, exchange limitations etc (Permission: BOTS_READ, Security: SIGNED)",
"produces": [
"application/json"
],
@@ -1825,7 +1909,7 @@
],
"responses": {
"200": {
- "description": "Info required to add funds correctly: available amounts, exchange limitations etc (Permission: BOTS_READ, Security: SIGNED)"
+ "description": "Info required to add funds correctly: available amounts, exchange limitations etc (Permission: BOTS_READ, Security: SIGNED)"
}
},
"tags": [
@@ -1834,55 +1918,6 @@
"operationId": "getVer1DealsDealIdDataForAddingFunds"
}
},
- "/ver1/users/current_mode": {
- "get": {
- "description": "Current User Mode (Paper or Real) (Permission: ACCOUNTS_READ, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "responses": {
- "200": {
- "description": "Current User Mode (Paper or Real) (Permission: ACCOUNTS_READ, Security: SIGNED)"
- }
- },
- "tags": [
- "users"
- ],
- "operationId": "getVer1UsersCurrentMode"
- }
- },
- "/ver1/users/change_mode": {
- "post": {
- "description": "Change User Mode (Paper or Real) (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "mode",
- "type": "string",
- "enum": [
- "paper",
- "real"
- ],
- "required": true
- }
- ],
- "responses": {
- "201": {
- "description": "Change User Mode (Paper or Real) (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "users"
- ],
- "operationId": "postVer1UsersChangeMode"
- }
- },
"/ver1/accounts/transfer": {
"post": {
"description": "Transfer coins between accounts (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
@@ -2063,6 +2098,13 @@
"type": "string",
"required": false
},
+ {
+ "in": "formData",
+ "name": "subaccount_name",
+ "description": "For FTX",
+ "type": "string",
+ "required": false
+ },
{
"in": "formData",
"name": "how_connect",
@@ -2156,6 +2198,13 @@
"type": "string",
"required": false
},
+ {
+ "in": "formData",
+ "name": "subaccount_name",
+ "description": "For FTX",
+ "type": "string",
+ "required": false
+ },
{
"in": "formData",
"name": "address",
@@ -2190,6 +2239,13 @@
"name": "mnemonic_phrase",
"type": "string",
"required": false
+ },
+ {
+ "in": "formData",
+ "name": "include_in_summary",
+ "description": "Should the account be included in the summary statistics?",
+ "type": "boolean",
+ "required": false
}
],
"responses": {
@@ -2209,6 +2265,25 @@
"produces": [
"application/json"
],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "page",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "description": "Page size, from 1 to 100",
+ "type": "integer",
+ "format": "int32",
+ "minimum": 1,
+ "maximum": 100,
+ "required": false
+ }
+ ],
"responses": {
"200": {
"description": "User connected exchanges(and EthereumWallet) list (Permission: ACCOUNTS_READ, Security: SIGNED)"
@@ -2310,6 +2385,13 @@
"application/json"
],
"parameters": [
+ {
+ "in": "query",
+ "name": "limit_type",
+ "description": "Type of limits - bot or smart_trade",
+ "type": "string",
+ "required": false
+ },
{
"in": "query",
"name": "pretty_display_type",
@@ -2553,8 +2635,7 @@
"name": "date_from",
"type": "string",
"format": "date-time",
- "required": true,
- "example": "2021-10-01"
+ "required": true
},
{
"in": "query",
@@ -2677,7 +2758,7 @@
},
"/ver1/accounts/{account_id}/account_table_data": {
"post": {
- "description": "Information about all user balances on specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "description": "Information about all user balances on specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)",
"produces": [
"application/json"
],
@@ -2695,7 +2776,7 @@
],
"responses": {
"201": {
- "description": "Information about all user balances on specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ "description": "Information about all user balances on specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)"
}
},
"tags": [
@@ -2791,9 +2872,9 @@
"operationId": "getVer1AccountsAccountId"
}
},
- "/ver1/smart_trades/create_simple_sell": {
- "post": {
- "description": "Create SimpleSell (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "/ver1/users/locale": {
+ "put": {
+ "description": "Change user locale (Security: SIGNED)",
"produces": [
"application/json"
],
@@ -2803,1580 +2884,69 @@
"parameters": [
{
"in": "formData",
- "name": "account_id",
- "description": "id from GET /ver1/accounts",
- "type": "integer",
- "format": "int32",
- "required": true
- },
- {
- "in": "formData",
- "name": "pair",
- "type": "string",
- "required": true
- },
- {
- "in": "formData",
- "name": "units_to_buy",
- "description": "Amount of units to buy",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "buy_price",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "conditional_limit_price",
- "description": "Order price for conditional SimpleSell with limit order",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "buy_method",
+ "name": "locale",
"type": "string",
- "default": "limit",
"enum": [
- "limit",
- "market",
- "conditional"
+ "ru",
+ "en",
+ "pt",
+ "zh",
+ "es",
+ "fr",
+ "tr",
+ "de"
],
"required": true
}
],
"responses": {
- "201": {
- "description": "Create SimpleSell (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ "200": {
+ "description": "Change user locale (Security: SIGNED)"
}
},
"tags": [
- "smart_trades"
+ "users"
],
- "operationId": "postVer1SmartTradesCreateSimpleSell"
+ "operationId": "putVer1UsersLocale"
}
},
- "/ver1/smart_trades/create_simple_buy": {
- "post": {
- "description": "Create SimpleBuy (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "/ver1/users/permissions_info": {
+ "get": {
+ "description": "Api Key Permissions (Permission: NONE, Security: SIGNED)",
"produces": [
"application/json"
],
- "consumes": [
+ "responses": {
+ "200": {
+ "description": "Api Key Permissions (Permission: NONE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "users"
+ ],
+ "operationId": "getVer1UsersPermissionsInfo"
+ }
+ },
+ "/ver1/users/current_mode": {
+ "get": {
+ "description": "Current User Mode (Paper or Real) (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
"application/json"
],
- "parameters": [
- {
- "in": "formData",
- "name": "account_id",
- "description": "id from GET /ver1/accounts",
- "type": "integer",
- "format": "int32",
- "required": true
- },
- {
- "in": "formData",
- "name": "pair",
- "type": "string",
- "required": true
- },
- {
- "in": "formData",
- "name": "units_to_buy",
- "description": "Amount of units to buy",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "buy_price",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "conditional_limit_price",
- "description": "Order price for conditional SimpleBuy with limit order",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "buy_method",
- "type": "string",
- "default": "limit",
- "enum": [
- "limit",
- "market",
- "conditional"
- ],
- "required": true
- }
- ],
- "responses": {
- "201": {
- "description": "Create SimpleBuy (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesCreateSimpleBuy"
- }
- },
- "/ver1/smart_trades/create_smart_sell": {
- "post": {
- "description": "Create SmartSale (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "account_id",
- "description": "id from GET /ver1/accounts",
- "type": "integer",
- "format": "int32",
- "required": true
- },
- {
- "in": "formData",
- "name": "pair",
- "type": "string",
- "required": true
- },
- {
- "in": "formData",
- "name": "units_to_buy",
- "description": "Bought amount",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "average_buy_price",
- "description": "Bought price",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "take_profit_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "take_profit_type",
- "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
- "type": "string",
- "enum": [
- "classic",
- "step_sell"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_price_condition",
- "description": "Required if take_profit_type = classic",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_percentage_condition",
- "description": "Required if take_profit_type = classic AND trailing_buy_enabled. Must be positive",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[percent]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": true,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "double"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_method]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "default": "bid",
- "required": true,
- "items": {
- "type": "string",
- "enum": [
- "bid",
- "ask",
- "last"
- ]
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_percentage]",
- "description": "Required if take_profit_step_orders AND trailing_buy_enabled. Must be positive",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_price_method",
- "description": "Price type for take profit(bid,asl,last)",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit_step",
- "description": "Required if trailing_take_profit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "stop_loss_price_condition",
- "description": "Required if stop_loss_enabled",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_percentage_condition",
- "description": "Required if stop_loss_enabled AND trailing_buy_enabled. Must be negative",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_price_method",
- "description": "Price type for stop loss",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_stop_loss",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_enabled",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_seconds",
- "description": "Timeout in seconds",
- "type": "integer",
- "format": "int32",
- "default": 300,
- "required": false
- },
- {
- "in": "formData",
- "name": "note",
- "type": "string",
- "required": false
- }
- ],
- "responses": {
- "201": {
- "description": "Create SmartSale (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesCreateSmartSell"
- }
- },
- "/ver1/smart_trades/create_smart_cover": {
- "post": {
- "description": "Create SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "account_id",
- "description": "id from GET /ver1/accounts",
- "type": "integer",
- "format": "int32",
- "required": true
- },
- {
- "in": "formData",
- "name": "pair",
- "type": "string",
- "required": true
- },
- {
- "in": "formData",
- "name": "units_to_buy",
- "description": "Amount of units to buy",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "buy_price",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "conditional_limit_price",
- "description": "Order price for conditional SmartCover with limit order",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "buy_method",
- "type": "string",
- "default": "limit",
- "enum": [
- "limit",
- "market",
- "conditional"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_buy_enabled",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_buy_step",
- "description": "Required if trailing_buy_enabled",
- "type": "number",
- "format": "float",
- "default": 5.0,
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "take_profit_type",
- "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
- "type": "string",
- "enum": [
- "classic",
- "step_sell"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_price_condition",
- "description": "Required if take_profit_type = classic",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_percentage_condition",
- "description": "Required if take_profit_type = classic AND trailing_buy_enabled. Must be negative",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[percent]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": true,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "double"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_method]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "default": "bid",
- "required": true,
- "items": {
- "type": "string",
- "enum": [
- "bid",
- "ask",
- "last"
- ]
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_percentage]",
- "description": "Required if take_profit_step_orders AND trailing_buy_enabled. Must be negative",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_price_method",
- "description": "Price type for take profit",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit_step",
- "description": "Required if trailing_take_profit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "stop_loss_price_condition",
- "description": "Required if stop_loss_enabled",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_percentage_condition",
- "description": "Required if stop_loss_enabled AND trailing_buy_enabled. Must Be positive",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_price_method",
- "description": "Price type for stop loss",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_stop_loss",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_enabled",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_seconds",
- "description": "timeout in seconds",
- "type": "integer",
- "format": "int32",
- "default": 300,
- "required": false
- },
- {
- "in": "formData",
- "name": "note",
- "type": "string",
- "required": false
- }
- ],
- "responses": {
- "201": {
- "description": "Create SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesCreateSmartCover"
- }
- },
- "/ver1/smart_trades/create_smart_trade": {
- "post": {
- "description": "Create SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "account_id",
- "description": "id from GET /ver1/accounts",
- "type": "integer",
- "format": "int32",
- "required": true
- },
- {
- "in": "formData",
- "name": "pair",
- "type": "string",
- "required": true
- },
- {
- "in": "formData",
- "name": "units_to_buy",
- "description": "Amount of units to buy",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "buy_price",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "conditional_limit_price",
- "description": "Order price for conditional SmartTrade with limit order",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "buy_method",
- "type": "string",
- "default": "limit",
- "enum": [
- "limit",
- "market",
- "conditional"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_buy_enabled",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_buy_step",
- "description": "Required if trailing_buy_enabled",
- "type": "number",
- "format": "float",
- "default": 5.0,
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "take_profit_type",
- "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
- "type": "string",
- "enum": [
- "classic",
- "step_sell"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_price_condition",
- "description": "Required if take_profit_type = classic",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_percentage_condition",
- "description": "Required if take_profit_type = classic AND trailing_buy_enabled. Must be positive",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[percent]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": true,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "double"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_method]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "default": "bid",
- "required": true,
- "items": {
- "type": "string",
- "enum": [
- "bid",
- "ask",
- "last"
- ]
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_percentage]",
- "description": "Required if take_profit_step_orders AND trailing_buy_enabled. Must be positive",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_price_method",
- "description": "Price type for take profit",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit_step",
- "description": "Required if trailing_take_profit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "stop_loss_price_condition",
- "description": "Required if stop_loss_enabled",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_percentage_condition",
- "description": "Required if stop_loss_enabled AND trailing_buy_enabled. Must be negative",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_price_method",
- "description": "Price type for stop loss",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_stop_loss",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_enabled",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_seconds",
- "description": "timeout in seconds",
- "type": "integer",
- "format": "int32",
- "default": 300,
- "required": false
- },
- {
- "in": "formData",
- "name": "note",
- "type": "string",
- "required": false
- }
- ],
- "responses": {
- "201": {
- "description": "Create SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesCreateSmartTrade"
- }
- },
- "/ver1/smart_trades": {
- "get": {
- "description": "Get SmartTrade history (Permission: SMART_TRADE_READ, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "query",
- "name": "limit",
- "description": "Limit records",
- "type": "integer",
- "format": "int32",
- "required": false
- },
- {
- "in": "query",
- "name": "offset",
- "description": "Offset records",
- "type": "integer",
- "format": "int32",
- "required": false
- },
- {
- "in": "query",
- "name": "account_id",
- "description": "Account to show smart_trades on. Pass null (default) - show all",
- "type": "integer",
- "format": "int32",
- "required": false
- },
- {
- "in": "query",
- "name": "scope",
- "description": "active - show only active trades, finished - history of closed trades, cancelled - cancelled trades, failed - failed trades, any other value or null (default) - all trades",
- "type": "string",
- "required": false
- },
- {
- "in": "query",
- "name": "type",
- "description": "SmartTrade::SmartSale , SmartTrade::Classic , SmartTrade::ConditionalBuy",
- "type": "string",
- "required": false
- },
- {
- "in": "query",
- "name": "order",
- "type": "string",
- "default": "created_at",
- "enum": [
- "created_at",
- "closed_at",
- "updated_at"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "pairs",
- "description": "Array of pairs",
- "type": "array",
- "items": {
- "type": "string"
- },
- "required": false
- }
- ],
- "responses": {
- "200": {
- "description": "Get SmartTrade history (Permission: SMART_TRADE_READ, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "getVer1SmartTrades"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/cancel_order": {
- "post": {
- "description": "Manual cancel order (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "step_id",
- "description": "SmartTrade step id to cancel",
- "type": "string",
- "required": true
- },
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
- "responses": {
- "201": {
- "description": "Manual cancel order (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesSmartTradeIdCancelOrder"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/add_funds": {
- "post": {
- "description": "Smart Trade add funds (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "quantity",
- "description": "buy order quantity",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "formData",
- "name": "is_market",
- "description": "true - use MARKET order, false - use LIMIT order",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "response_type",
- "type": "string",
- "default": "empty",
- "enum": [
- "smart_trade",
- "empty",
- "order",
- "step"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "rate",
- "description": "buy order rate. Required if LIMIT order used",
- "type": "number",
- "format": "double",
- "required": true
- },
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
- "responses": {
- "201": {
- "description": "Smart Trade add funds (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesSmartTradeIdAddFunds"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/step_panic_sell": {
- "post": {
- "description": "Step panic sell (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "step_id",
- "type": "integer",
- "format": "int32",
- "required": true
- },
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
- "responses": {
- "201": {
- "description": "Step panic sell (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesSmartTradeIdStepPanicSell"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/update": {
- "patch": {
- "description": "Edit SmartTrade/SmartSale/SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "formData",
- "name": "buy_price",
- "description": "Available if Conditional SmartTrade",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "conditional_limit_price",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "average_buy_price",
- "description": "Available if SmartSale",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_buy_enabled",
- "description": "Available if Conditional SmartTrade",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_buy_step",
- "description": "Available if trailing_buy_enabled",
- "type": "number",
- "format": "float",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "take_profit_type",
- "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
- "type": "string",
- "enum": [
- "classic",
- "step_sell"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_price_condition",
- "description": "Required if take_profit_type = classic",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_percentage_condition",
- "description": "Required if take_profit_type = classic AND trailing_buy_enabled",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[percent]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": true,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "double"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[position]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "required": true,
- "items": {
- "type": "integer",
- "format": "int32"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_method]",
- "description": "Required if take_profit_step_orders",
- "type": "array",
- "default": "bid",
- "required": true,
- "items": {
- "type": "string",
- "enum": [
- "bid",
- "ask",
- "last"
- ]
- }
- },
- {
- "in": "formData",
- "name": "take_profit_step_orders[price_percentage]",
- "description": "Required if take_profit_step_orders AND trailing_buy_enabled",
- "type": "array",
- "required": false,
- "items": {
- "type": "number",
- "format": "float"
- }
- },
- {
- "in": "formData",
- "name": "take_profit_price_method",
- "description": "Price type for take profit(bid,asl,last)",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "take_profit_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_take_profit_step",
- "description": "Required if trailing_take_profit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_enabled",
- "type": "boolean",
- "required": true
- },
- {
- "in": "formData",
- "name": "stop_loss_price_condition",
- "description": "Required if stop_loss_enabled",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_percentage_condition",
- "description": "Required if stop_loss_enabled AND trailing_buy_enabled",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_price_method",
- "description": "Price type for stop loss",
- "type": "string",
- "default": "bid",
- "enum": [
- "bid",
- "ask",
- "last"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_method",
- "type": "string",
- "default": "market",
- "enum": [
- "market",
- "limit"
- ],
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_sell_order_price",
- "description": "Required if limit",
- "type": "number",
- "format": "double",
- "required": false
- },
- {
- "in": "formData",
- "name": "trailing_stop_loss",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_enabled",
- "type": "boolean",
- "required": false
- },
- {
- "in": "formData",
- "name": "stop_loss_timeout_seconds",
- "description": "Timeout in seconds",
- "type": "integer",
- "format": "int32",
- "default": 300,
- "required": false
- },
- {
- "in": "formData",
- "name": "note",
- "type": "string",
- "required": false
- },
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "Edit SmartTrade/SmartSale/SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "patchVer1SmartTradesSmartTradeIdUpdate"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/cancel": {
- "post": {
- "description": "Cancel SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
- "responses": {
- "201": {
- "description": "Cancel SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesSmartTradeIdCancel"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/panic_sell": {
- "post": {
- "description": "Sell currency immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
- "responses": {
- "201": {
- "description": "Sell currency immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesSmartTradeIdPanicSell"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/force_start": {
- "post": {
- "description": "Process BuyStep immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
- "produces": [
- "application/json"
- ],
- "consumes": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
"responses": {
- "201": {
- "description": "Process BuyStep immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ "200": {
+ "description": "Current User Mode (Paper or Real) (Permission: ACCOUNTS_READ, Security: SIGNED)"
}
},
"tags": [
- "smart_trades"
+ "users"
],
- "operationId": "postVer1SmartTradesSmartTradeIdForceStart"
+ "operationId": "getVer1UsersCurrentMode"
}
},
- "/ver1/smart_trades/{smart_trade_id}/force_process": {
+ "/ver1/users/change_mode": {
"post": {
- "description": "Refresh SmartTrade state (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "description": "Change User Mode (Paper or Real) (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
"produces": [
"application/json"
],
@@ -4385,47 +2955,25 @@
],
"parameters": [
{
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
+ "in": "formData",
+ "name": "mode",
+ "type": "string",
+ "enum": [
+ "paper",
+ "real"
+ ],
"required": true
}
],
"responses": {
"201": {
- "description": "Refresh SmartTrade state (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades"
- ],
- "operationId": "postVer1SmartTradesSmartTradeIdForceProcess"
- }
- },
- "/ver1/smart_trades/{smart_trade_id}/show": {
- "get": {
- "produces": [
- "application/json"
- ],
- "parameters": [
- {
- "in": "path",
- "name": "smart_trade_id",
- "type": "integer",
- "format": "int32",
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "get Show(s)"
+ "description": "Change User Mode (Paper or Real) (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
}
},
"tags": [
- "smart_trades"
+ "users"
],
- "operationId": "getVer1SmartTradesSmartTradeIdShow"
+ "operationId": "postVer1UsersChangeMode"
}
},
"/ver1/marketplace/presets": {
@@ -4573,7 +3121,7 @@
"200": {
"description": "Marketplace presets (Permission: NONE, Security: SIGNED)",
"schema": {
- "$ref": "#/definitions/IndexEntity"
+ "$ref": "#/definitions/MarketplacePresets_IndexEntity"
}
}
},
@@ -4646,7 +3194,9 @@
"pt",
"ko",
"fr",
- "cs"
+ "cs",
+ "tr",
+ "de"
],
"required": false
}
@@ -4724,7 +3274,9 @@
"pt",
"ko",
"fr",
- "cs"
+ "cs",
+ "tr",
+ "de"
],
"required": false
},
@@ -4807,6 +3359,12 @@
"type": "number",
"format": "double",
"required": false
+ },
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
}
],
"responses": {
@@ -4880,6 +3438,60 @@
"format": "double",
"required": true
},
+ {
+ "in": "formData",
+ "name": "upper_stop_loss_price",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "upper_stop_loss_enabled",
+ "type": "boolean",
+ "default": false,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "upper_stop_loss_action",
+ "type": "string",
+ "default": "stop_bot",
+ "enum": [
+ "stop_bot",
+ "stop_bot_and_buy",
+ "stop_bot_and_sell",
+ "stop_bot_and_close_position"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "lower_stop_loss_price",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "lower_stop_loss_enabled",
+ "type": "boolean",
+ "default": false,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "lower_stop_loss_action",
+ "type": "string",
+ "default": "stop_bot",
+ "enum": [
+ "stop_bot",
+ "stop_bot_and_buy",
+ "stop_bot_and_sell",
+ "stop_bot_and_close_position"
+ ],
+ "required": false
+ },
{
"in": "formData",
"name": "leverage_type",
@@ -4909,6 +3521,38 @@
"type": "boolean",
"default": true,
"required": false
+ },
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "max_active_buy_lines",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "max_active_sell_lines",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "order_currency_type",
+ "description": "Order currency type",
+ "type": "string",
+ "default": "base",
+ "enum": [
+ "base",
+ "quote"
+ ],
+ "required": false
}
],
"responses": {
@@ -4941,6 +3585,14 @@
"description": "Market code from /accounts/market_list",
"type": "string",
"required": true
+ },
+ {
+ "in": "query",
+ "name": "total_quantity",
+ "description": "Total amount for bot usage",
+ "type": "number",
+ "format": "double",
+ "required": false
}
],
"responses": {
@@ -4962,24 +3614,17 @@
],
"parameters": [
{
- "in": "formData",
+ "in": "query",
"name": "account_ids",
"description": "Filter by account id",
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int32"
- },
+ "type": "string",
"required": false
},
{
- "in": "formData",
+ "in": "query",
"name": "account_types",
"description": "Filter by account type",
- "type": "array",
- "items": {
- "type": "string"
- },
+ "type": "string",
"required": false
},
{
@@ -5004,7 +3649,8 @@
"bot_id",
"pair",
"created_at",
- "updated_at"
+ "updated_at",
+ "name"
],
"required": false
},
@@ -5068,6 +3714,85 @@
"operationId": "getVer1GridBots"
}
},
+ "/ver1/grid_bots/{id}/note": {
+ "post": {
+ "description": "Grid Bot Note (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Grid Bot Note (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "postVer1GridBotsIdNote"
+ }
+ },
+ "/ver1/grid_bots/{id}/events": {
+ "get": {
+ "description": "Grid Bot Events (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "page",
+ "type": "integer",
+ "format": "int32",
+ "default": 1,
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "type": "integer",
+ "format": "int32",
+ "default": 100,
+ "minimum": 1,
+ "maximum": 100,
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Grid Bot Events (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "getVer1GridBotsIdEvents"
+ }
+ },
"/ver1/grid_bots/{id}/market_orders": {
"get": {
"description": "Grid Bot Market Orders (Permission: BOTS_READ, Security: SIGNED)",
@@ -5075,6 +3800,24 @@
"application/json"
],
"parameters": [
+ {
+ "in": "query",
+ "name": "limit",
+ "type": "integer",
+ "format": "int32",
+ "default": 100,
+ "minimum": 1,
+ "maximum": 1000,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "type": "integer",
+ "format": "int32",
+ "default": 0,
+ "required": false
+ },
{
"in": "path",
"name": "id",
@@ -5101,6 +3844,22 @@
"application/json"
],
"parameters": [
+ {
+ "in": "query",
+ "name": "from",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "format": "date-time",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "to",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "format": "date-time",
+ "required": false
+ },
{
"in": "path",
"name": "id",
@@ -5113,7 +3872,7 @@
"200": {
"description": "Grid Bot Profits (Permission: BOTS_READ, Security: SIGNED)",
"schema": {
- "$ref": "#/definitions/Profit"
+ "$ref": "#/definitions/GridBotProfitsEntity"
}
}
},
@@ -5176,6 +3935,12 @@
"format": "double",
"required": false
},
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ },
{
"in": "path",
"name": "id",
@@ -5216,8 +3981,9 @@
{
"in": "formData",
"name": "pair",
+ "description": "Deprecated",
"type": "string",
- "required": true
+ "required": false
},
{
"in": "formData",
@@ -5247,6 +4013,56 @@
"format": "double",
"required": true
},
+ {
+ "in": "formData",
+ "name": "upper_stop_loss_price",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "upper_stop_loss_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "upper_stop_loss_action",
+ "type": "string",
+ "enum": [
+ "stop_bot",
+ "stop_bot_and_buy",
+ "stop_bot_and_sell",
+ "stop_bot_and_close_position"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "lower_stop_loss_price",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "lower_stop_loss_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "lower_stop_loss_action",
+ "type": "string",
+ "enum": [
+ "stop_bot",
+ "stop_bot_and_buy",
+ "stop_bot_and_sell",
+ "stop_bot_and_close_position"
+ ],
+ "required": false
+ },
{
"in": "formData",
"name": "leverage_type",
@@ -5269,6 +4085,26 @@
"format": "double",
"required": false
},
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "max_active_buy_lines",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "max_active_sell_lines",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
{
"in": "path",
"name": "id",
@@ -5456,6 +4292,13 @@
"type": "number",
"format": "double"
}
+ },
+ {
+ "in": "formData",
+ "name": "include_in_summary",
+ "type": "boolean",
+ "default": true,
+ "required": false
}
],
"responses": {
@@ -5543,6 +4386,12 @@
"format": "double"
}
},
+ {
+ "in": "formData",
+ "name": "include_in_summary",
+ "type": "boolean",
+ "required": false
+ },
{
"in": "path",
"name": "account_id",
@@ -5562,6 +4411,63 @@
"operationId": "putVer1LooseAccountsAccountId"
}
},
+ "/ver1/mini_apps/storage": {
+ "get": {
+ "description": "Fetch data from storage (Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "key",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Fetch data from storage (Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "mini_apps"
+ ],
+ "operationId": "getVer1MiniAppsStorage"
+ },
+ "post": {
+ "description": "Write data into storage (Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "key",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "data",
+ "type": "json",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Write data into storage (Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "mini_apps"
+ ],
+ "operationId": "postVer1MiniAppsStorage"
+ }
+ },
"/ver1/ping": {
"get": {
"description": "Test connectivity to the Rest API (Permission: NONE, Security: NONE)",
@@ -5701,6 +4607,13 @@
"type": "string",
"required": false
},
+ {
+ "in": "query",
+ "name": "to",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "required": false
+ },
{
"in": "query",
"name": "base",
@@ -5754,6 +4667,7 @@
"name": "instant",
"description": "true for Simple Buy and Simple Sell",
"type": "boolean",
+ "default": false,
"required": false
},
{
@@ -5761,6 +4675,7 @@
"name": "skip_enter_step",
"description": "true only for Smart Sell",
"type": "boolean",
+ "default": false,
"required": false
},
{
@@ -5773,6 +4688,7 @@
"in": "formData",
"name": "leverage[enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -5865,6 +4781,7 @@
"in": "formData",
"name": "position[conditional][trailing][enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -5879,6 +4796,7 @@
"in": "formData",
"name": "take_profit[enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -5912,7 +4830,12 @@
"type": "array",
"required": true,
"items": {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ]
}
},
{
@@ -5922,7 +4845,8 @@
"type": "array",
"required": false,
"items": {
- "type": "string"
+ "type": "number",
+ "format": "double"
}
},
{
@@ -5932,16 +4856,18 @@
"type": "array",
"required": false,
"items": {
- "type": "string"
+ "type": "number",
+ "format": "float"
}
},
{
"in": "formData",
"name": "take_profit[steps][][trailing][enabled]",
"type": "array",
+ "default": false,
"required": true,
"items": {
- "type": "string"
+ "type": "boolean"
}
},
{
@@ -5950,19 +4876,22 @@
"type": "array",
"required": true,
"items": {
- "type": "string"
+ "type": "number",
+ "format": "float"
}
},
{
"in": "formData",
"name": "stop_loss[enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
"in": "formData",
"name": "stop_loss[breakeven]",
"type": "boolean",
+ "default": false,
"required": false
},
{
@@ -6014,12 +4943,14 @@
"in": "formData",
"name": "stop_loss[conditional][trailing][enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
"in": "formData",
"name": "stop_loss[timeout][enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -6041,6 +4972,32 @@
"operationId": "postV2SmartTrades"
}
},
+ "/v2/smart_trades/{id}/reduce_funds_info": {
+ "get": {
+ "description": "Reduce funds for smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Reduce funds for smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "getV2SmartTradesIdReduceFundsInfo"
+ }
+ },
"/v2/smart_trades/{id}": {
"get": {
"description": "Get smart trade v2 by id (Permission: SMART_TRADE_READ, Security: SIGNED)",
@@ -6103,6 +5060,7 @@
"in": "formData",
"name": "leverage[enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -6174,6 +5132,7 @@
"in": "formData",
"name": "position[conditional][trailing][enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -6187,6 +5146,7 @@
"in": "formData",
"name": "take_profit[enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -6218,7 +5178,12 @@
"type": "array",
"required": true,
"items": {
- "type": "string"
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ]
}
},
{
@@ -6227,7 +5192,8 @@
"type": "array",
"required": false,
"items": {
- "type": "string"
+ "type": "number",
+ "format": "double"
}
},
{
@@ -6236,16 +5202,18 @@
"type": "array",
"required": false,
"items": {
- "type": "string"
+ "type": "number",
+ "format": "float"
}
},
{
"in": "formData",
"name": "take_profit[steps][][trailing][enabled]",
"type": "array",
+ "default": false,
"required": true,
"items": {
- "type": "string"
+ "type": "boolean"
}
},
{
@@ -6254,19 +5222,22 @@
"type": "array",
"required": true,
"items": {
- "type": "string"
+ "type": "number",
+ "format": "float"
}
},
{
"in": "formData",
"name": "stop_loss[enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
"in": "formData",
"name": "stop_loss[breakeven]",
"type": "boolean",
+ "default": false,
"required": false
},
{
@@ -6317,12 +5288,14 @@
"in": "formData",
"name": "stop_loss[conditional][trailing][enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
"in": "formData",
"name": "stop_loss[timeout][enabled]",
"type": "boolean",
+ "default": false,
"required": true
},
{
@@ -6668,136 +5641,44 @@
}
],
"responses": {
- "204": {
- "description": "Cancel trade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
- }
- },
- "tags": [
- "smart_trades_v2"
- ],
- "operationId": "deleteV2SmartTradesSmartTradeIdTradesId"
- }
- }
- },
- "definitions": {
- "IndexEntity": {
- "type": "object",
- "properties": {
- "bots": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/MarketplaceBotEntity"
- }
- },
- "total": {
- "type": "integer",
- "format": "int32"
- },
- "page": {
- "type": "integer",
- "format": "int32"
- }
- },
- "description": "Marketplace presets (Permission: NONE, Security: SIGNED)"
- },
- "MarketplaceBotEntity": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "format": "int32"
- },
- "type": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "strategy": {
- "type": "string"
- },
- "secret": {
- "type": "string"
- },
- "marketplace_item": {
- "$ref": "#/definitions/MarketplaceItem"
- },
- "profit": {
- "$ref": "#/definitions/Profit"
- },
- "currencies": {
- "type": "array",
- "items": {
- "type": "string"
+ "204": {
+ "description": "Cancel trade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
}
},
- "copies": {
- "type": "integer",
- "format": "int32",
- "description": "Bot's copies count"
- },
- "is_favorite": {
- "type": "boolean"
- }
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "deleteV2SmartTradesSmartTradeIdTradesId"
}
},
- "MarketplaceItem": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "format": "int32"
- },
- "name": {
- "type": "string"
+ "/v2/accounts/market_pairs": {
+ "get": {
+ "description": "All market pairs (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "market_code",
+ "description": "market_code from account model",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "All market pairs (Permission: NONE, Security: NONE)"
+ }
},
- "icon_url": {
- "type": "string"
- }
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getV2AccountsMarketPairs"
}
- },
- "Profit": {
- "type": "object",
- "properties": {
- "period": {
- "type": "string"
- },
- "amount": {
- "type": "number",
- "format": "double"
- },
- "chart_data": {
- "type": "array",
- "items": {
- "type": "number",
- "format": "double"
- }
- }
- },
- "description": "Grid Bot Profits (Permission: BOTS_READ, Security: SIGNED)"
- },
- "PongEntity": {
- "type": "object",
- "properties": {
- "pong": {
- "type": "string",
- "example": "'pong'"
- }
- },
- "description": "Test connectivity to the Rest API (Permission: NONE, Security: NONE)"
- },
- "TimeEntity": {
- "type": "object",
- "properties": {
- "server_time": {
- "type": "integer",
- "format": "int32",
- "example": "1592769067",
- "description": "UNIX timestamp"
- }
- },
- "description": "Test connectivity to the Rest API and get the current server time (Permission: NONE, Security: NONE)"
- },
+ }
+ },
+ "definitions": {
"BotEntity": {
"type": "object",
"properties": {
@@ -7050,6 +5931,9 @@
"format": "int32",
"example": 452
},
+ "auto_balance_portfolio": {
+ "$ref": "#/definitions/PortfolioEntity"
+ },
"auto_balance_currency_change_limit": {
"type": "integer",
"format": "int32",
@@ -7151,9 +6035,32 @@
"type": "boolean",
"example": "false"
},
+ "include_in_summary": {
+ "type": "boolean",
+ "example": "false",
+ "description": "Include the account in summary or not"
+ },
"supported_market_types": {
"type": "string"
},
+ "primary_display_currency_profit_percentage": {
+ "type": "string"
+ },
+ "primary_display_currency_profit": {
+ "type": "string"
+ },
+ "day_profit_primary_display_currency_percentage": {
+ "type": "string"
+ },
+ "day_profit_primary_display_currency": {
+ "type": "string"
+ },
+ "primary_display_currency_amount": {
+ "type": "string"
+ },
+ "total_primary_display_currency_profit": {
+ "type": "string"
+ },
"api_key": {
"type": "string",
"example": "''"
@@ -7252,6 +6159,34 @@
}
}
},
+ "PortfolioEntity": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "portfolio_entries": {
+ "$ref": "#/definitions/PortfolioEntryEntity"
+ }
+ }
+ },
+ "PortfolioEntryEntity": {
+ "type": "object",
+ "properties": {
+ "target_percentage": {
+ "type": "string"
+ },
+ "currency_code": {
+ "type": "string"
+ }
+ }
+ },
"GridBotEntity": {
"type": "object",
"properties": {
@@ -7289,14 +6224,42 @@
"type": "string",
"example": "'manual'"
},
+ "upper_stop_loss_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "lower_stop_loss_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "note": {
+ "type": "string",
+ "example": "Best pair"
+ },
"lower_price": {
"type": "string",
"example": "'8000'"
},
+ "lower_stop_loss_price": {
+ "type": "string",
+ "example": "'7500'"
+ },
+ "lower_stop_loss_action": {
+ "type": "string",
+ "example": "'stop_bot'"
+ },
"upper_price": {
"type": "string",
"example": "'10000'"
},
+ "upper_stop_loss_price": {
+ "type": "string",
+ "example": "'12000'"
+ },
+ "upper_stop_loss_action": {
+ "type": "string",
+ "example": "'stop_bot'"
+ },
"quantity_per_grid": {
"type": "string",
"example": "'100'"
@@ -7341,70 +6304,217 @@
"type": "string",
"example": "1000"
},
- "sold_volume": {
- "type": "string",
- "example": "1000"
+ "sold_volume": {
+ "type": "string",
+ "example": "1000"
+ },
+ "profit_percentage": {
+ "type": "string",
+ "example": "0.1"
+ },
+ "current_price": {
+ "type": "string",
+ "example": "100.1"
+ },
+ "max_active_buy_lines": {
+ "type": "string",
+ "example": "10"
+ },
+ "max_active_sell_lines": {
+ "type": "string",
+ "example": "10"
+ },
+ "order_currency_type": {
+ "type": "string",
+ "example": "base"
+ },
+ "profit_currency_type": {
+ "type": "string",
+ "example": "quote"
+ },
+ "investment_base_currency": {
+ "type": "string",
+ "example": "100"
+ },
+ "investment_quote_currency": {
+ "type": "string",
+ "example": "100"
+ },
+ "unrealized_profit_loss": {
+ "type": "string",
+ "example": "2500.0"
+ },
+ "grid_lines": {
+ "$ref": "#/definitions/GridLineEntity"
+ }
+ }
+ },
+ "GridLineEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "example": 21,
+ "description": "Uniq id"
+ },
+ "price": {
+ "type": "string",
+ "example": "'8000'"
+ },
+ "side": {
+ "type": "string",
+ "example": "'SELL'"
+ },
+ "order_placed": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "GridBotProfitsEntity": {
+ "type": "object",
+ "properties": {
+ "grid_line_id": {
+ "type": "integer",
+ "format": "int32",
+ "example": "'8000'"
+ },
+ "profit": {
+ "type": "string",
+ "example": "'0.01'"
+ },
+ "usd_profit": {
+ "type": "string",
+ "example": "'100'"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "grid_line": {
+ "$ref": "#/definitions/GridLineEntity"
+ }
+ },
+ "description": "GridBotProfitsEntity model"
+ },
+ "MarketplacePresets_IndexEntity": {
+ "type": "object",
+ "properties": {
+ "bots": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/MarketplacePresets_IndexEntity_MarketplaceBotEntity"
+ }
+ },
+ "total": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "page": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "description": "MarketplacePresets_IndexEntity model"
+ },
+ "MarketplacePresets_IndexEntity_MarketplaceBotEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "type": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "strategy": {
+ "type": "string"
+ },
+ "secret": {
+ "type": "string"
},
- "profit_percentage": {
- "type": "string",
- "example": "0.1"
+ "marketplace_item": {
+ "$ref": "#/definitions/MarketplacePresets_IndexEntity_MarketplaceBotEntity_MarketplaceItem"
},
- "current_price": {
- "type": "string",
- "example": "100.1"
+ "profit": {
+ "$ref": "#/definitions/MarketplacePresets_IndexEntity_MarketplaceBotEntity_Profit"
},
- "investment_base_currency": {
- "type": "string",
- "example": "100"
+ "currencies": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "investment_quote_currency": {
- "type": "string",
- "example": "100"
+ "copies": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Bot's copies count"
},
- "grid_lines": {
- "$ref": "#/definitions/GridLineEntity"
+ "is_favorite": {
+ "type": "boolean"
}
}
},
- "GridLineEntity": {
+ "MarketplacePresets_IndexEntity_MarketplaceBotEntity_MarketplaceItem": {
"type": "object",
"properties": {
- "price": {
- "type": "string",
- "example": "'8000'"
+ "id": {
+ "type": "integer",
+ "format": "int32"
},
- "side": {
- "type": "string",
- "example": "'SELL'"
+ "name": {
+ "type": "string"
},
- "order_placed": {
- "type": "boolean",
- "example": true
+ "icon_url": {
+ "type": "string"
}
}
},
- "GridBotProfitsEntity": {
+ "MarketplacePresets_IndexEntity_MarketplaceBotEntity_Profit": {
"type": "object",
"properties": {
- "grid_line_id": {
- "type": "integer",
- "format": "int32",
- "example": "'8000'"
- },
- "profit": {
- "type": "string",
- "example": "'0.01'"
+ "period": {
+ "type": "string"
},
- "usd_profit": {
- "type": "string",
- "example": "'100'"
+ "amount": {
+ "type": "number",
+ "format": "double"
},
- "created_at": {
- "type": "string",
- "example": "2018-08-08 08:08:08"
+ "chart_data": {
+ "type": "array",
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
}
}
},
+ "PongEntity": {
+ "type": "object",
+ "properties": {
+ "pong": {
+ "type": "string",
+ "example": "'pong'"
+ }
+ },
+ "description": "PongEntity model"
+ },
+ "TimeEntity": {
+ "type": "object",
+ "properties": {
+ "server_time": {
+ "type": "integer",
+ "format": "int32",
+ "example": "1592769067",
+ "description": "UNIX timestamp"
+ }
+ },
+ "description": "TimeEntity model"
+ },
"DealEntity": {
"type": "object",
"properties": {
@@ -7884,9 +6994,93 @@
}
}
},
+ "reduce_funds": {
+ "type": "object",
+ "properties": {
+ "steps": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ReduceFundsStep"
+ }
+ }
+ }
+ },
+ "market_close": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "basic_type": {
+ "type": "string"
+ }
+ }
+ },
+ "units": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "price": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "value_without_commission": {
+ "type": "string"
+ }
+ }
+ },
+ "total": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "filled": {
+ "type": "object",
+ "properties": {
+ "units": {
+ "type": "string"
+ },
+ "total": {
+ "type": "string"
+ },
+ "price": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
"note": {
"type": "string"
},
+ "note_raw": {
+ "type": "string",
+ "nullable": true
+ },
"skip_enter_step": {
"type": "boolean"
},
@@ -8391,6 +7585,101 @@
}
},
"additionalProperties": false
+ },
+ "GridBotEvent": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string",
+ "example": "Bot Message"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2021-07-08 08:08:08"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ReduceFundsStep": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "basic_type": {
+ "type": "string"
+ }
+ }
+ },
+ "units": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "price": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "value_without_commission": {
+ "type": "string"
+ }
+ }
+ },
+ "total": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "filled": {
+ "type": "object",
+ "properties": {
+ "units": {
+ "type": "string"
+ },
+ "total": {
+ "type": "string"
+ },
+ "price": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "cancelable": {
+ "type": "boolean"
+ },
+ "panic_sell_available": {
+ "type": "boolean"
+ }
+ }
+ }
+ },
+ "additionalProperties": false
}
}
-}
\ No newline at end of file
+}
diff --git a/type_generators/3commas_swaggerdoc_2022_01_24.json b/type_generators/3commas_swaggerdoc_2022_01_24.json
new file mode 100644
index 0000000..f13c217
--- /dev/null
+++ b/type_generators/3commas_swaggerdoc_2022_01_24.json
@@ -0,0 +1,8396 @@
+{
+ "info": {
+ "title": "3commas API",
+ "version": "0.0.1"
+ },
+ "swagger": "2.0",
+ "produces": [
+ "application/json"
+ ],
+ "host": "api.3commas.io",
+ "basePath": "/public/api",
+ "tags": [
+ {
+ "name": "bots",
+ "description": "Operations about bots"
+ },
+ {
+ "name": "deals",
+ "description": "Operations about deals"
+ },
+ {
+ "name": "users",
+ "description": "Operations about users"
+ },
+ {
+ "name": "accounts",
+ "description": "Operations about accounts"
+ },
+ {
+ "name": "smart_trades",
+ "description": "Operations about smart_trades"
+ },
+ {
+ "name": "marketplace",
+ "description": "Operations about marketplaces"
+ },
+ {
+ "name": "grid_bots",
+ "description": "Operations about grid_bots"
+ },
+ {
+ "name": "loose_accounts",
+ "description": "Operations about loose_accounts"
+ },
+ {
+ "name": "ping",
+ "description": "Operations about pings"
+ },
+ {
+ "name": "time",
+ "description": "Operations about times"
+ },
+ {
+ "name": "smart_trades_v2",
+ "description": "Operations about smart_trades_v2s"
+ }
+ ],
+ "paths": {
+ "/ver1/bots/strategy_list": {
+ "get": {
+ "description": "Available strategy list for bot (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "type",
+ "type": "string",
+ "enum": [
+ "simple",
+ "composite"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "strategy",
+ "type": "string",
+ "enum": [
+ "long",
+ "short"
+ ],
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Available strategy list for bot (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1BotsStrategyList"
+ }
+ },
+ "/ver1/bots/pairs_black_list": {
+ "get": {
+ "description": "Black List for bot pairs (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "Black List for bot pairs (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1BotsPairsBlackList"
+ }
+ },
+ "/ver1/bots/update_pairs_black_list": {
+ "post": {
+ "description": "Create or Update pairs BlackList for bots (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "pairs",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": true,
+ "example": "BTC_USDT"
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create or Update pairs BlackList for bots (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsUpdatePairsBlackList"
+ }
+ },
+ "/ver1/bots/create_bot": {
+ "post": {
+ "description": "Create bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pairs",
+ "description": "Pass single pair to create SingleBot or any other number of pairs to create MultiBot",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "max_active_deals",
+ "type": "integer",
+ "format": "int32",
+ "default": 1,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "base_order_volume",
+ "description": "Base order size",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "base_order_volume_type",
+ "description": "base order volume currency",
+ "type": "string",
+ "enum": [
+ "quote_currency",
+ "base_currency",
+ "percent",
+ "xbt"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit",
+ "description": "Target profit(percentage)",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "safety_order_volume",
+ "description": "Safety trade size",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "safety_order_volume_type",
+ "description": "safety order volume currency",
+ "type": "string",
+ "enum": [
+ "quote_currency",
+ "base_currency",
+ "percent",
+ "xbt"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "martingale_volume_coefficient",
+ "type": "number",
+ "format": "double",
+ "default": 1,
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "martingale_step_coefficient",
+ "type": "number",
+ "format": "double",
+ "default": 1,
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "max_safety_orders",
+ "description": "Max safety trades count",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "active_safety_orders_count",
+ "description": "Max active safety trades count",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_percentage",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "cooldown",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_enabled",
+ "description": "Enable trailing take profit. Binance only.",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_deviation",
+ "description": "required if trailing_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "btc_price_limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "strategy",
+ "type": "string",
+ "default": "long",
+ "enum": [
+ "short",
+ "long"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "safety_order_step_percentage",
+ "description": "Price deviation to open safety trades(percentage)",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_type",
+ "description": "Percentage: base – from base order, total – from total volume",
+ "type": "string",
+ "default": "base",
+ "enum": [
+ "base",
+ "total"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "strategy_list",
+ "description": "For manual signals: [{\"strategy\":\"manual\"}] or []
\n For non-stop(1 pair only): [{\"strategy\":\"nonstop\"}]
\n QFL: {\"options\": {\"type\": \"original\"}, {\"percent\": 3}, \"strategy\": \"qfl\"}]
\n TradingView: [{\"options\": {\"time\": \"5m\", \"type\": \"buy_or_strong_buy\"}, \"strategy\": \"trading_view\"} ",
+ "type": "array",
+ "items": {
+ "type": "json"
+ },
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage_type",
+ "description": "Used for Bitmex bots only",
+ "type": "string",
+ "default": "not_specified",
+ "enum": [
+ "custom",
+ "cross",
+ "not_specified",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage_custom_value",
+ "description": "required if leverage_type is isolated",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "min_price",
+ "description": "minimum price to open deal",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "max_price",
+ "description": "maximum price to open deal",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_in_seconds",
+ "description": "StopLoss timeout in seconds if StopLoss timeout enabled",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "min_volume_btc_24h",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "tsl_enabled",
+ "description": "Enable trailing stop loss. Bitmex only.",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "deal_start_delay_seconds",
+ "description": "Deal start delay in seconds",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "profit_currency",
+ "description": "Take profit currency",
+ "type": "string",
+ "enum": [
+ "quote_currency",
+ "base_currency"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "start_order_type",
+ "type": "string",
+ "enum": [
+ "limit",
+ "market"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_type",
+ "type": "string",
+ "enum": [
+ "stop_loss",
+ "stop_loss_and_disable_bot"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "disable_after_deals_count",
+ "description": "Bot will be disabled after opening this number of deals",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "allowed_deals_on_same_pair",
+ "description": "Allow specific number of deals on the same pair. Multibot only.",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "close_deals_timeout",
+ "description": "Close bot deals after given number of seconds. Must be greater than 60.",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsCreateBot"
+ }
+ },
+ "/ver1/bots": {
+ "get": {
+ "description": "User bots (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "Limit records. Max: 100",
+ "type": "integer",
+ "format": "int32",
+ "default": 50,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "Offset records",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "from",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "account_id",
+ "description": "Account to show bots on. Return all if not specified. Gather this from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "scope",
+ "type": "string",
+ "enum": [
+ "enabled",
+ "disabled"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "strategy",
+ "type": "string",
+ "enum": [
+ "long",
+ "short"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "sort_by",
+ "type": "string",
+ "default": "created_at",
+ "enum": [
+ "profit",
+ "created_at",
+ "updated_at"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "sort_direction",
+ "type": "string",
+ "default": "desc",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "quote",
+ "description": "Quote currency",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "User bots (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1Bots"
+ }
+ },
+ "/ver1/bots/stats": {
+ "get": {
+ "description": "Get bot stats (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "account_id",
+ "description": "Account to show on. Null - show for all. Gather this from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "bot_id",
+ "description": "Bots to show on. Null - show for all",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Get bot stats (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1BotsStats"
+ }
+ },
+ "/ver1/bots/{bot_id}/copy_and_create": {
+ "post": {
+ "description": "POST /bots/:id/copy_and_create. Permission: BOTS_WRITE, Security: SIGNED",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "secret",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "amount",
+ "description": "Max amount for bot usage (Based on current rate)",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "POST /bots/:id/copy_and_create. Permission: BOTS_WRITE, Security: SIGNED"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsBotIdCopyAndCreate"
+ }
+ },
+ "/ver1/bots/{bot_id}/update": {
+ "patch": {
+ "description": "Edit bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pairs",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "max_active_deals",
+ "type": "integer",
+ "format": "int32",
+ "default": 1,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "base_order_volume",
+ "description": "Base order size",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "base_order_volume_type",
+ "description": "base order volume currency",
+ "type": "string",
+ "enum": [
+ "quote_currency",
+ "base_currency",
+ "percent",
+ "xbt"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit",
+ "description": "Target profit(percentage)",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "safety_order_volume",
+ "description": "Safety trade size",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "safety_order_volume_type",
+ "description": "safety order volume currency",
+ "type": "string",
+ "enum": [
+ "quote_currency",
+ "base_currency",
+ "percent",
+ "xbt"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "martingale_volume_coefficient",
+ "type": "number",
+ "format": "double",
+ "default": 1,
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "martingale_step_coefficient",
+ "type": "number",
+ "format": "double",
+ "default": 1,
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "max_safety_orders",
+ "description": "Max safety trades count",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "active_safety_orders_count",
+ "description": "Max active safety trades count",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_percentage",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "cooldown",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_enabled",
+ "description": "Enable trailing take profit. Binance only.",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_deviation",
+ "description": "required if trailing_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "btc_price_limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "safety_order_step_percentage",
+ "description": "Price deviation to open safety trades(percentage)",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_type",
+ "description": "Percentage: base – from base order, total – from total volume",
+ "type": "string",
+ "default": "total",
+ "enum": [
+ "total",
+ "base"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "strategy_list",
+ "description": "For manual signals: [{\"strategy\":\"manual\"}] or []
\n For non-stop(1 pair only): [{\"strategy\":\"nonstop\"}]
\n QFL: {\"options\": {\"type\": \"original\"}, {\"percent\": 3}, \"strategy\": \"qfl\"}]
\n TradingView: [{\"options\": {\"time\": \"5m\", \"type\": \"buy_or_strong_buy\", \"strategy\": \"trading_view\"} ",
+ "type": "array",
+ "items": {
+ "type": "json"
+ },
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage_type",
+ "description": "Used for Bitmex bots only",
+ "type": "string",
+ "default": "not_specified",
+ "enum": [
+ "custom",
+ "cross",
+ "not_specified",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage_custom_value",
+ "description": "required if leverage_type is isolated",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "min_price",
+ "description": "minimum price to open deal",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "max_price",
+ "description": "maximum price to open deal",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_in_seconds",
+ "description": "StopLoss timeout in seconds if StopLoss timeout enabled",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "min_volume_btc_24h",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "tsl_enabled",
+ "description": "Enable trailing stop loss. Bitmex only.",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "deal_start_delay_seconds",
+ "description": "Deal start delay in seconds",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "profit_currency",
+ "description": "Take profit currency",
+ "type": "string",
+ "enum": [
+ "quote_currency",
+ "base_currency"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "start_order_type",
+ "type": "string",
+ "enum": [
+ "limit",
+ "market"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_type",
+ "type": "string",
+ "enum": [
+ "stop_loss",
+ "stop_loss_and_disable_bot"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "disable_after_deals_count",
+ "description": "Bot will be disabled after opening this number of deals",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "allowed_deals_on_same_pair",
+ "description": "Allow specific number of deals on the same pair. Multibot only.",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Edit bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "patchVer1BotsBotIdUpdate"
+ }
+ },
+ "/ver1/bots/{bot_id}/disable": {
+ "post": {
+ "description": "Disable bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Disable bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsBotIdDisable"
+ }
+ },
+ "/ver1/bots/{bot_id}/enable": {
+ "post": {
+ "description": "Enable bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Enable bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsBotIdEnable"
+ }
+ },
+ "/ver1/bots/{bot_id}/start_new_deal": {
+ "post": {
+ "description": "Start new deal asap (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "pair",
+ "description": "Can be omited for simple bot",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "skip_signal_checks",
+ "description": "If false or not specified then all paramaters like signals or volume filters will be checked. If true - those checks will be skipped",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "skip_open_deals_checks",
+ "description": "If true then you will be allowed to open more then one deal per pair in composite bot",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Start new deal asap (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsBotIdStartNewDeal"
+ }
+ },
+ "/ver1/bots/{bot_id}/delete": {
+ "post": {
+ "description": "Delete bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Delete bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsBotIdDelete"
+ }
+ },
+ "/ver1/bots/{bot_id}/panic_sell_all_deals": {
+ "post": {
+ "description": "Panic sell all bot deals (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Panic sell all bot deals (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsBotIdPanicSellAllDeals"
+ }
+ },
+ "/ver1/bots/{bot_id}/cancel_all_deals": {
+ "post": {
+ "description": "Cancel all bot deals (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Cancel all bot deals (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "postVer1BotsBotIdCancelAllDeals"
+ }
+ },
+ "/ver1/bots/{bot_id}/deals_stats": {
+ "get": {
+ "description": "Bot deals stats (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Bot deals stats (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1BotsBotIdDealsStats"
+ }
+ },
+ "/ver1/bots/{bot_id}/show": {
+ "get": {
+ "description": "Bot info (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "include_events",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "bot_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Bot info (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "bots"
+ ],
+ "operationId": "getVer1BotsBotIdShow"
+ }
+ },
+ "/ver1/deals": {
+ "get": {
+ "description": "User deals (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "Limit records. Max: 1_000",
+ "type": "integer",
+ "format": "int32",
+ "default": 50,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "Offset records",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "from",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "account_id",
+ "description": "Account to show bots on. Return all if not specified. Gather this from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "bot_id",
+ "description": "Bot show deals on. Return all if not specified",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "scope",
+ "description": "active - active deals, finished - finished deals, completed - successfully completed, cancelled - cancelled deals, failed - failed deals, any other value or null (default) - all deals",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order",
+ "type": "string",
+ "default": "created_at",
+ "enum": [
+ "created_at",
+ "updated_at",
+ "closed_at",
+ "profit",
+ "profit_percentage"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order_direction",
+ "type": "string",
+ "default": "desc",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "base",
+ "description": "Base currency",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "quote",
+ "description": "Quote currency",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "User deals (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "getVer1Deals"
+ }
+ },
+ "/ver1/deals/{deal_id}/convert_to_smart_trade": {
+ "post": {
+ "description": "Convert to smart trade (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "stop_bot",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Convert to smart trade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "postVer1DealsDealIdConvertToSmartTrade"
+ }
+ },
+ "/ver1/deals/{deal_id}/update_max_safety_orders": {
+ "post": {
+ "description": "Update max safety orders (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "max_safety_orders",
+ "description": "New maximum safety orders value",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Update max safety orders (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "postVer1DealsDealIdUpdateMaxSafetyOrders"
+ }
+ },
+ "/ver1/deals/{deal_id}/panic_sell": {
+ "post": {
+ "description": "Panic sell deal (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Panic sell deal (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "postVer1DealsDealIdPanicSell"
+ }
+ },
+ "/ver1/deals/{deal_id}/cancel": {
+ "post": {
+ "description": "Cancel deal (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Cancel deal (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "postVer1DealsDealIdCancel"
+ }
+ },
+ "/ver1/deals/{deal_id}/update_deal": {
+ "patch": {
+ "description": "Update deal (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "take_profit",
+ "description": "New take profit value",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "profit_currency",
+ "type": "string",
+ "enum": [
+ "quote_currency",
+ "base_currency"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_type",
+ "description": "base – from base order, total – from total volume",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_deviation",
+ "description": "New trailing deviation value",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_percentage",
+ "description": "New stop loss percentage value",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "max_safety_orders",
+ "description": "New max safety orders value",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "active_safety_orders_count",
+ "description": "New active safety orders count value",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_in_seconds",
+ "description": "StopLoss timeout in seconds if StopLoss timeout enabled",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "tsl_enabled",
+ "description": "Trailing stop loss enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_type",
+ "type": "string",
+ "enum": [
+ "stop_loss",
+ "stop_loss_and_disable_bot"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "close_timeout",
+ "description": "Close deal after given number of seconds. Must be greater than 60.",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Update deal (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "patchVer1DealsDealIdUpdateDeal"
+ }
+ },
+ "/ver1/deals/{deal_id}/update_tp": {
+ "post": {
+ "description": "DEPRECATED, Update take profit condition. Deal status should be bought (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "new_take_profit_percentage",
+ "description": "New take profit value",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "DEPRECATED, Update take profit condition. Deal status should be bought (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "postVer1DealsDealIdUpdateTp"
+ }
+ },
+ "/ver1/deals/{deal_id}/show": {
+ "get": {
+ "description": "Info about specific deal (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Info about specific deal (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "getVer1DealsDealIdShow"
+ }
+ },
+ "/ver1/deals/{deal_id}/cancel_order": {
+ "post": {
+ "description": "Cancel manual safety orders (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "order_id",
+ "description": "manual safety order id",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Cancel manual safety orders (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "postVer1DealsDealIdCancelOrder"
+ }
+ },
+ "/ver1/deals/{deal_id}/market_orders": {
+ "get": {
+ "description": "Deal safety orders (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Deal safety orders (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "getVer1DealsDealIdMarketOrders"
+ }
+ },
+ "/ver1/deals/{deal_id}/add_funds": {
+ "post": {
+ "description": "Adding manual safety order (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "quantity",
+ "description": "safety order quantity",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "is_market",
+ "description": "true - use MARKET order, false - use LIMIT order",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "response_type",
+ "type": "string",
+ "default": "empty",
+ "enum": [
+ "empty",
+ "deal",
+ "market_order"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "rate",
+ "description": "safety order rate. Required if LIMIT order used",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Adding manual safety order (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "postVer1DealsDealIdAddFunds"
+ }
+ },
+ "/ver1/deals/{deal_id}/data_for_adding_funds": {
+ "get": {
+ "description": "Info required to add funds correctly: available amounts, exchange limitations etc (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "deal_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Info required to add funds correctly: available amounts, exchange limitations etc (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "deals"
+ ],
+ "operationId": "getVer1DealsDealIdDataForAddingFunds"
+ }
+ },
+ "/ver1/users/current_mode": {
+ "get": {
+ "description": "Current User Mode (Paper or Real) (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "Current User Mode (Paper or Real) (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "users"
+ ],
+ "operationId": "getVer1UsersCurrentMode"
+ }
+ },
+ "/ver1/users/change_mode": {
+ "post": {
+ "description": "Change User Mode (Paper or Real) (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "mode",
+ "type": "string",
+ "enum": [
+ "paper",
+ "real"
+ ],
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Change User Mode (Paper or Real) (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "users"
+ ],
+ "operationId": "postVer1UsersChangeMode"
+ }
+ },
+ "/ver1/accounts/transfer": {
+ "post": {
+ "description": "Transfer coins between accounts (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "currency",
+ "description": "Currency code(example: USDT)",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "amount",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "to_account_id",
+ "description": "Recipient account ID (possible values in /transfer_data)",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "from_account_id",
+ "description": "Sender account ID (possible values in /transfer_data)",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Transfer coins between accounts (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsTransfer"
+ }
+ },
+ "/ver1/accounts/transfer_history": {
+ "get": {
+ "description": "Transfers history (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "account_id",
+ "description": "Sender or Recipient account ID (possible values in /transfer_data)",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "currency",
+ "description": "Currency code(example: USDT)",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "page",
+ "description": "Page number",
+ "type": "integer",
+ "format": "int32",
+ "default": 1,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "description": "Elements per page",
+ "type": "integer",
+ "format": "int32",
+ "default": 10,
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Transfers history (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsTransferHistory"
+ }
+ },
+ "/ver1/accounts/transfer_data": {
+ "get": {
+ "description": "Data for transfer between accounts (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "Data for transfer between accounts (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsTransferData"
+ }
+ },
+ "/ver1/accounts/new": {
+ "post": {
+ "description": "Add exchange account (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "type",
+ "description": "check market_code in market_list method",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "name",
+ "description": "Account name (any string)",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "api_key",
+ "description": "Requires unless type = binance_dex",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "secret",
+ "description": "Requires unless type = binance_dex",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "address",
+ "description": "Requires if type = ethereumwallet",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "customer_id",
+ "description": "For Bitstamp",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "passphrase",
+ "description": "For Coinbase Pro (GDAX)",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "how_connect",
+ "type": "string",
+ "enum": [
+ "mnemonic_phrase",
+ "keystore"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "keystore",
+ "description": "keystore file content. Requires if type = binance_dex and how_connect = keystore",
+ "type": "json",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "wallet_password",
+ "description": "Requires if type = binance_dex and how_connect = keystore",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "mnemonic_phrase",
+ "description": "Requires if type = binance_dex and how_connect = mnemonic_phrase",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Add exchange account (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsNew"
+ }
+ },
+ "/ver1/accounts/update": {
+ "post": {
+ "description": "Edit exchange account",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "name",
+ "description": "Account name (any string)",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "api_key",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "secret",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "customer_id",
+ "description": "For Bitstamp",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "passphrase",
+ "description": "For Coinbase Pro (GDAX)",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "address",
+ "description": "For accounts with type = ethereumwallet",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "how_connect",
+ "type": "string",
+ "enum": [
+ "mnemonic_phrase",
+ "keystore"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "keystore",
+ "type": "json",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "wallet_password",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "mnemonic_phrase",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Edit exchange account"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsUpdate"
+ }
+ },
+ "/ver1/accounts": {
+ "get": {
+ "description": "User connected exchanges(and EthereumWallet) list (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "User connected exchanges(and EthereumWallet) list (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1Accounts"
+ }
+ },
+ "/ver1/accounts/market_list": {
+ "get": {
+ "description": "Supported markets list (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "Supported markets list (Permission: NONE, Security: NONE)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsMarketList"
+ }
+ },
+ "/ver1/accounts/market_pairs": {
+ "get": {
+ "description": "All market pairs (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "pretty_display_type",
+ "description": "deprecated. mandatory use market_code instead",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "market_code",
+ "description": "market_code from account model",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "All market pairs (Permission: NONE, Security: NONE)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsMarketPairs"
+ }
+ },
+ "/ver1/accounts/currency_rates_with_leverage_data": {
+ "get": {
+ "description": "Currency rates and limits with leverage data (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "market_code",
+ "description": "market_code from account model",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "pair",
+ "description": "Pair",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Currency rates and limits with leverage data (Permission: NONE, Security: NONE)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsCurrencyRatesWithLeverageData"
+ }
+ },
+ "/ver1/accounts/currency_rates": {
+ "get": {
+ "description": "Currency rates and limits (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "pretty_display_type",
+ "description": "deprecated. use market_code instead",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "market_code",
+ "description": "market_code from account model. If you are retrieving data for pairs, you must also include market_code",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "pair",
+ "description": "Pair",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Currency rates and limits (Permission: NONE, Security: NONE)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsCurrencyRates"
+ }
+ },
+ "/ver1/accounts/{account_id}/deposit_data": {
+ "get": {
+ "description": "User Deposit Data (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "currency",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "network",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "User Deposit Data (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsAccountIdDepositData"
+ }
+ },
+ "/ver1/accounts/{account_id}/networks_info": {
+ "get": {
+ "description": "Deposit/withdraw networks info (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "purpose",
+ "description": "Filter currencies with deposit/withdraw enabled",
+ "type": "string",
+ "enum": [
+ "deposit",
+ "withdraw"
+ ],
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Deposit/withdraw networks info (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsAccountIdNetworksInfo"
+ }
+ },
+ "/ver1/accounts/{account_id}/convert_dust_to_bnb": {
+ "post": {
+ "description": "Convert dust coins to BNB (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "codes",
+ "description": "Array of currency codes",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Convert dust coins to BNB (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdConvertDustToBnb"
+ }
+ },
+ "/ver1/accounts/{account_id}/active_trading_entities": {
+ "get": {
+ "description": "Active trade entities (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Active trade entities (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsAccountIdActiveTradingEntities"
+ }
+ },
+ "/ver1/accounts/{account_id}/sell_all_to_usd": {
+ "post": {
+ "description": "Sell all to USD (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Sell all to USD (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdSellAllToUsd"
+ }
+ },
+ "/ver1/accounts/{account_id}/sell_all_to_btc": {
+ "post": {
+ "description": "Sell all to BTC (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Sell all to BTC (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdSellAllToBtc"
+ }
+ },
+ "/ver1/accounts/{account_id}/balance_chart_data": {
+ "get": {
+ "description": "balance history data (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "date_from",
+ "type": "string",
+ "format": "date-time",
+ "required": true,
+ "example": "2021-10-01"
+ },
+ {
+ "in": "query",
+ "name": "date_to",
+ "type": "string",
+ "format": "date-time",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "balance history data (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsAccountIdBalanceChartData"
+ }
+ },
+ "/ver1/accounts/{account_id}/load_balances": {
+ "post": {
+ "description": "Load balances for specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Load balances for specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdLoadBalances"
+ }
+ },
+ "/ver1/accounts/{account_id}/rename": {
+ "post": {
+ "description": "Rename exchange connection (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Rename exchange connection (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdRename"
+ }
+ },
+ "/ver1/accounts/{account_id}/pie_chart_data": {
+ "post": {
+ "description": "Information about all user balances on specified exchange in pretty for pie chart format (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Information about all user balances on specified exchange in pretty for pie chart format (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdPieChartData"
+ }
+ },
+ "/ver1/accounts/{account_id}/account_table_data": {
+ "post": {
+ "description": "Information about all user balances on specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Information about all user balances on specified exchange (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdAccountTableData"
+ }
+ },
+ "/ver1/accounts/{account_id}/remove": {
+ "post": {
+ "description": "Remove exchange connection (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Remove exchange connection (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "postVer1AccountsAccountIdRemove"
+ }
+ },
+ "/ver1/accounts/{account_id}/leverage_data": {
+ "get": {
+ "description": "Information about account leverage (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Information about account leverage (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsAccountIdLeverageData"
+ }
+ },
+ "/ver1/accounts/{account_id}": {
+ "get": {
+ "description": "Single Account Info (Permission: ACCOUNTS_READ, Security: SIGNED)\nYou can send 'summary' instead of {account_id} to get summary account info",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Single Account Info (Permission: ACCOUNTS_READ, Security: SIGNED)\nYou can send 'summary' instead of {account_id} to get summary account info"
+ }
+ },
+ "tags": [
+ "accounts"
+ ],
+ "operationId": "getVer1AccountsAccountId"
+ }
+ },
+ "/ver1/smart_trades/create_simple_sell": {
+ "post": {
+ "description": "Create SimpleSell (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "units_to_buy",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "buy_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "conditional_limit_price",
+ "description": "Order price for conditional SimpleSell with limit order",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "buy_method",
+ "type": "string",
+ "default": "limit",
+ "enum": [
+ "limit",
+ "market",
+ "conditional"
+ ],
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create SimpleSell (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesCreateSimpleSell"
+ }
+ },
+ "/ver1/smart_trades/create_simple_buy": {
+ "post": {
+ "description": "Create SimpleBuy (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "units_to_buy",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "buy_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "conditional_limit_price",
+ "description": "Order price for conditional SimpleBuy with limit order",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "buy_method",
+ "type": "string",
+ "default": "limit",
+ "enum": [
+ "limit",
+ "market",
+ "conditional"
+ ],
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create SimpleBuy (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesCreateSimpleBuy"
+ }
+ },
+ "/ver1/smart_trades/create_smart_sell": {
+ "post": {
+ "description": "Create SmartSale (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "units_to_buy",
+ "description": "Bought amount",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "average_buy_price",
+ "description": "Bought price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_type",
+ "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
+ "type": "string",
+ "enum": [
+ "classic",
+ "step_sell"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_condition",
+ "description": "Required if take_profit_type = classic",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_percentage_condition",
+ "description": "Required if take_profit_type = classic AND trailing_buy_enabled. Must be positive",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[percent]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_method]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "default": "bid",
+ "required": true,
+ "items": {
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ]
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_percentage]",
+ "description": "Required if take_profit_step_orders AND trailing_buy_enabled. Must be positive",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_method",
+ "description": "Price type for take profit(bid,asl,last)",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit_step",
+ "description": "Required if trailing_take_profit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_condition",
+ "description": "Required if stop_loss_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_percentage_condition",
+ "description": "Required if stop_loss_enabled AND trailing_buy_enabled. Must be negative",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_method",
+ "description": "Price type for stop loss",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_stop_loss",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_seconds",
+ "description": "Timeout in seconds",
+ "type": "integer",
+ "format": "int32",
+ "default": 300,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create SmartSale (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesCreateSmartSell"
+ }
+ },
+ "/ver1/smart_trades/create_smart_cover": {
+ "post": {
+ "description": "Create SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "units_to_buy",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "buy_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "conditional_limit_price",
+ "description": "Order price for conditional SmartCover with limit order",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "buy_method",
+ "type": "string",
+ "default": "limit",
+ "enum": [
+ "limit",
+ "market",
+ "conditional"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_buy_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_buy_step",
+ "description": "Required if trailing_buy_enabled",
+ "type": "number",
+ "format": "float",
+ "default": 5.0,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_type",
+ "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
+ "type": "string",
+ "enum": [
+ "classic",
+ "step_sell"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_condition",
+ "description": "Required if take_profit_type = classic",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_percentage_condition",
+ "description": "Required if take_profit_type = classic AND trailing_buy_enabled. Must be negative",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[percent]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_method]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "default": "bid",
+ "required": true,
+ "items": {
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ]
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_percentage]",
+ "description": "Required if take_profit_step_orders AND trailing_buy_enabled. Must be negative",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_method",
+ "description": "Price type for take profit",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit_step",
+ "description": "Required if trailing_take_profit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_condition",
+ "description": "Required if stop_loss_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_percentage_condition",
+ "description": "Required if stop_loss_enabled AND trailing_buy_enabled. Must Be positive",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_method",
+ "description": "Price type for stop loss",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_stop_loss",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_seconds",
+ "description": "timeout in seconds",
+ "type": "integer",
+ "format": "int32",
+ "default": 300,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesCreateSmartCover"
+ }
+ },
+ "/ver1/smart_trades/create_smart_trade": {
+ "post": {
+ "description": "Create SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "units_to_buy",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "buy_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "conditional_limit_price",
+ "description": "Order price for conditional SmartTrade with limit order",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "buy_method",
+ "type": "string",
+ "default": "limit",
+ "enum": [
+ "limit",
+ "market",
+ "conditional"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_buy_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_buy_step",
+ "description": "Required if trailing_buy_enabled",
+ "type": "number",
+ "format": "float",
+ "default": 5.0,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_type",
+ "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
+ "type": "string",
+ "enum": [
+ "classic",
+ "step_sell"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_condition",
+ "description": "Required if take_profit_type = classic",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_percentage_condition",
+ "description": "Required if take_profit_type = classic AND trailing_buy_enabled. Must be positive",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[percent]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_method]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "default": "bid",
+ "required": true,
+ "items": {
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ]
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_percentage]",
+ "description": "Required if take_profit_step_orders AND trailing_buy_enabled. Must be positive",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_method",
+ "description": "Price type for take profit",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit_step",
+ "description": "Required if trailing_take_profit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_condition",
+ "description": "Required if stop_loss_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_percentage_condition",
+ "description": "Required if stop_loss_enabled AND trailing_buy_enabled. Must be negative",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_method",
+ "description": "Price type for stop loss",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_stop_loss",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_seconds",
+ "description": "timeout in seconds",
+ "type": "integer",
+ "format": "int32",
+ "default": 300,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesCreateSmartTrade"
+ }
+ },
+ "/ver1/smart_trades": {
+ "get": {
+ "description": "Get SmartTrade history (Permission: SMART_TRADE_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "Limit records",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "Offset records",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "account_id",
+ "description": "Account to show smart_trades on. Pass null (default) - show all",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "scope",
+ "description": "active - show only active trades, finished - history of closed trades, cancelled - cancelled trades, failed - failed trades, any other value or null (default) - all trades",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "type",
+ "description": "SmartTrade::SmartSale , SmartTrade::Classic , SmartTrade::ConditionalBuy",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order",
+ "type": "string",
+ "default": "created_at",
+ "enum": [
+ "created_at",
+ "closed_at",
+ "updated_at"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "pairs",
+ "description": "Array of pairs",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Get SmartTrade history (Permission: SMART_TRADE_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "getVer1SmartTrades"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/cancel_order": {
+ "post": {
+ "description": "Manual cancel order (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "step_id",
+ "description": "SmartTrade step id to cancel",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Manual cancel order (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesSmartTradeIdCancelOrder"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/add_funds": {
+ "post": {
+ "description": "Smart Trade add funds (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "quantity",
+ "description": "buy order quantity",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "is_market",
+ "description": "true - use MARKET order, false - use LIMIT order",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "response_type",
+ "type": "string",
+ "default": "empty",
+ "enum": [
+ "smart_trade",
+ "empty",
+ "order",
+ "step"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "rate",
+ "description": "buy order rate. Required if LIMIT order used",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Smart Trade add funds (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesSmartTradeIdAddFunds"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/step_panic_sell": {
+ "post": {
+ "description": "Step panic sell (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "step_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Step panic sell (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesSmartTradeIdStepPanicSell"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/update": {
+ "patch": {
+ "description": "Edit SmartTrade/SmartSale/SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "buy_price",
+ "description": "Available if Conditional SmartTrade",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "conditional_limit_price",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "average_buy_price",
+ "description": "Available if SmartSale",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_buy_enabled",
+ "description": "Available if Conditional SmartTrade",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_buy_step",
+ "description": "Available if trailing_buy_enabled",
+ "type": "number",
+ "format": "float",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_type",
+ "description": "Required if take_profit_enabled. classic - common take profit, step_sell - step sell take profit",
+ "type": "string",
+ "enum": [
+ "classic",
+ "step_sell"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_condition",
+ "description": "Required if take_profit_type = classic",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_percentage_condition",
+ "description": "Required if take_profit_type = classic AND trailing_buy_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[percent]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[position]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_method]",
+ "description": "Required if take_profit_step_orders",
+ "type": "array",
+ "default": "bid",
+ "required": true,
+ "items": {
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ]
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_step_orders[price_percentage]",
+ "description": "Required if take_profit_step_orders AND trailing_buy_enabled",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_price_method",
+ "description": "Price type for take profit(bid,asl,last)",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "take_profit_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_take_profit_step",
+ "description": "Required if trailing_take_profit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_enabled",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_condition",
+ "description": "Required if stop_loss_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_percentage_condition",
+ "description": "Required if stop_loss_enabled AND trailing_buy_enabled",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_price_method",
+ "description": "Price type for stop loss",
+ "type": "string",
+ "default": "bid",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_method",
+ "type": "string",
+ "default": "market",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_sell_order_price",
+ "description": "Required if limit",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "trailing_stop_loss",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_enabled",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss_timeout_seconds",
+ "description": "Timeout in seconds",
+ "type": "integer",
+ "format": "int32",
+ "default": 300,
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Edit SmartTrade/SmartSale/SmartCover (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "patchVer1SmartTradesSmartTradeIdUpdate"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/cancel": {
+ "post": {
+ "description": "Cancel SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Cancel SmartTrade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesSmartTradeIdCancel"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/panic_sell": {
+ "post": {
+ "description": "Sell currency immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Sell currency immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesSmartTradeIdPanicSell"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/force_start": {
+ "post": {
+ "description": "Process BuyStep immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Process BuyStep immediately (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesSmartTradeIdForceStart"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/force_process": {
+ "post": {
+ "description": "Refresh SmartTrade state (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Refresh SmartTrade state (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "postVer1SmartTradesSmartTradeIdForceProcess"
+ }
+ },
+ "/ver1/smart_trades/{smart_trade_id}/show": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "get Show(s)"
+ }
+ },
+ "tags": [
+ "smart_trades"
+ ],
+ "operationId": "getVer1SmartTradesSmartTradeIdShow"
+ }
+ },
+ "/ver1/marketplace/presets": {
+ "get": {
+ "description": "Marketplace presets (Permission: NONE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "profit_per_day_from",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "profit_per_day_to",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "profit_per_month_from",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "profit_per_month_to",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "account_types",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "markets",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "with_all_market_pairs",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "pairs",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "days_running_from",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "days_running_to",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "deal_start_conditions",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "bot_type",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "bot_strategy",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "cmc",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "sort_by",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "sort_direction",
+ "type": "string",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "page",
+ "type": "integer",
+ "format": "int32",
+ "default": 1,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Marketplace presets (Permission: NONE, Security: SIGNED)",
+ "schema": {
+ "$ref": "#/definitions/IndexEntity"
+ }
+ }
+ },
+ "tags": [
+ "marketplace"
+ ],
+ "operationId": "getVer1MarketplacePresets"
+ }
+ },
+ "/ver1/marketplace/items": {
+ "get": {
+ "description": "All marketplace items (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "Limit records. Max: 1_000",
+ "type": "integer",
+ "format": "int32",
+ "default": 50,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "Offset records",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "scope",
+ "description": "paid - show only paid signal providers. free - show only free signal providers",
+ "type": "string",
+ "default": "all",
+ "enum": [
+ "all",
+ "paid",
+ "free"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order",
+ "type": "string",
+ "default": "newest",
+ "enum": [
+ "subscribers",
+ "name",
+ "newest"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "locale",
+ "type": "string",
+ "default": "en",
+ "enum": [
+ "en",
+ "ru",
+ "zh",
+ "zh-CN",
+ "es",
+ "pt",
+ "ko",
+ "fr",
+ "cs"
+ ],
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "All marketplace items (Permission: NONE, Security: NONE)"
+ }
+ },
+ "tags": [
+ "marketplace"
+ ],
+ "operationId": "getVer1MarketplaceItems"
+ }
+ },
+ "/ver1/marketplace/{item_id}/signals": {
+ "get": {
+ "description": "Marketplace Item Signals (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "limit",
+ "description": "Limit records. Max: 1_000",
+ "type": "integer",
+ "format": "int32",
+ "default": 50,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "description": "Offset records",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order",
+ "type": "string",
+ "default": "date",
+ "enum": [
+ "pair",
+ "exchange",
+ "signal_type",
+ "date"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order_direction",
+ "type": "string",
+ "default": "desc",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "locale",
+ "type": "string",
+ "default": "en",
+ "enum": [
+ "en",
+ "ru",
+ "zh",
+ "zh-CN",
+ "es",
+ "pt",
+ "ko",
+ "fr",
+ "cs"
+ ],
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "item_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Marketplace Item Signals (Permission: NONE, Security: NONE)"
+ }
+ },
+ "tags": [
+ "marketplace"
+ ],
+ "operationId": "getVer1MarketplaceItemIdSignals"
+ }
+ },
+ "/ver1/grid_bots/ai": {
+ "post": {
+ "description": "Create AI Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "description": "Grid Bot's name",
+ "type": "string",
+ "default": "GridBot",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "total_quantity",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage_type",
+ "description": "Leverage type for futures accounts",
+ "type": "string",
+ "default": "not_specified",
+ "enum": [
+ "custom",
+ "cross",
+ "not_specified",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage_custom_value",
+ "description": "Required if leverage_type = 'isolated'",
+ "type": "number",
+ "format": "double",
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create AI Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "postVer1GridBotsAi"
+ }
+ },
+ "/ver1/grid_bots/manual": {
+ "post": {
+ "description": "Create Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "description": "Grid Bot's name",
+ "type": "string",
+ "default": "GridBot",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "upper_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "lower_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "quantity_per_grid",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "grids_quantity",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage_type",
+ "description": "Leverage type for futures accounts",
+ "type": "string",
+ "default": "not_specified",
+ "enum": [
+ "custom",
+ "cross",
+ "not_specified",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage_custom_value",
+ "description": "Required if leverage_type = 'isolated'",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "is_enabled",
+ "description": "Turn on or off grid_bot after creation",
+ "type": "boolean",
+ "default": true,
+ "required": false
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "postVer1GridBotsManual"
+ }
+ },
+ "/ver1/grid_bots/ai_settings": {
+ "get": {
+ "description": "Get AI settings (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "query",
+ "name": "market_code",
+ "description": "Market code from /accounts/market_list",
+ "type": "string",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Get AI settings (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "getVer1GridBotsAiSettings"
+ }
+ },
+ "/ver1/grid_bots": {
+ "get": {
+ "description": "Grid bots list (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_ids",
+ "description": "Filter by account id",
+ "type": "array",
+ "items": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "account_types",
+ "description": "Filter by account type",
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "state",
+ "description": "Filter by bot state",
+ "type": "string",
+ "enum": [
+ "enabled",
+ "disabled"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "sort_by",
+ "description": "Sort column",
+ "type": "string",
+ "enum": [
+ "current_profit",
+ "profit",
+ "bot_id",
+ "pair",
+ "created_at",
+ "updated_at"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "sort_direction",
+ "description": "Sort direction",
+ "type": "string",
+ "enum": [
+ "desc",
+ "asc"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "limit",
+ "type": "integer",
+ "format": "int32",
+ "default": 10,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "type": "integer",
+ "format": "int32",
+ "default": 0,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "from",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "base",
+ "description": "Base currency",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "quote",
+ "description": "Quote currency",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Grid bots list (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "getVer1GridBots"
+ }
+ },
+ "/ver1/grid_bots/{id}/market_orders": {
+ "get": {
+ "description": "Grid Bot Market Orders (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Grid Bot Market Orders (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "getVer1GridBotsIdMarketOrders"
+ }
+ },
+ "/ver1/grid_bots/{id}/profits": {
+ "get": {
+ "description": "Grid Bot Profits (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Grid Bot Profits (Permission: BOTS_READ, Security: SIGNED)",
+ "schema": {
+ "$ref": "#/definitions/Profit"
+ }
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "getVer1GridBotsIdProfits"
+ }
+ },
+ "/ver1/grid_bots/{id}/ai": {
+ "patch": {
+ "description": "Edit Grid Bot (AI) (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "description": "Grid Bot's name",
+ "type": "string",
+ "default": "GridBot",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "total_quantity",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage_type",
+ "description": "Leverage type for futures accounts",
+ "type": "string",
+ "default": "not_specified",
+ "enum": [
+ "custom",
+ "cross",
+ "not_specified",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage_custom_value",
+ "description": "Required if leverage_type = 'isolated'",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Edit Grid Bot (AI) (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "patchVer1GridBotsIdAi"
+ }
+ },
+ "/ver1/grid_bots/{id}/manual": {
+ "patch": {
+ "description": "Edit Grid Bot (Manual) (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "description": "Grid Bot's name",
+ "type": "string",
+ "default": "GridBot",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "upper_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "lower_price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "quantity_per_grid",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "grids_quantity",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage_type",
+ "description": "Leverage type for futures accounts",
+ "type": "string",
+ "default": "not_specified",
+ "enum": [
+ "custom",
+ "cross",
+ "not_specified",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage_custom_value",
+ "description": "Required if leverage_type = 'isolated'",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Edit Grid Bot (Manual) (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "patchVer1GridBotsIdManual"
+ }
+ },
+ "/ver1/grid_bots/{id}": {
+ "get": {
+ "description": "Show Grid Bot (Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Show Grid Bot (Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "getVer1GridBotsId"
+ },
+ "delete": {
+ "description": "Delete Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Delete Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "deleteVer1GridBotsId"
+ }
+ },
+ "/ver1/grid_bots/{id}/disable": {
+ "post": {
+ "description": "Disable Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Disable Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "postVer1GridBotsIdDisable"
+ }
+ },
+ "/ver1/grid_bots/{id}/enable": {
+ "post": {
+ "description": "Enable Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Enable Grid Bot (Permission: BOTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "postVer1GridBotsIdEnable"
+ }
+ },
+ "/ver1/grid_bots/{id}/required_balances": {
+ "get": {
+ "description": "Get required balances to start bot(Permission: BOTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Get required balances to start bot(Permission: BOTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "grid_bots"
+ ],
+ "operationId": "getVer1GridBotsIdRequiredBalances"
+ }
+ },
+ "/ver1/loose_accounts": {
+ "post": {
+ "description": "Create Loose Account (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "tokens[code]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "tokens[amount]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create Loose Account (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "loose_accounts"
+ ],
+ "operationId": "postVer1LooseAccounts"
+ }
+ },
+ "/ver1/loose_accounts/available_currencies": {
+ "get": {
+ "description": "Available currencies (Permission: ACCOUNTS_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "contains",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "limit",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Available currencies (Permission: ACCOUNTS_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "loose_accounts"
+ ],
+ "operationId": "getVer1LooseAccountsAvailableCurrencies"
+ }
+ },
+ "/ver1/loose_accounts/{account_id}": {
+ "put": {
+ "description": "Update Loose Account (Permission: ACCOUNTS_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "name",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "tokens[code]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "tokens[amount]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
+ },
+ {
+ "in": "path",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Update Loose Account (Permission: ACCOUNTS_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "loose_accounts"
+ ],
+ "operationId": "putVer1LooseAccountsAccountId"
+ }
+ },
+ "/ver1/ping": {
+ "get": {
+ "description": "Test connectivity to the Rest API (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "Test connectivity to the Rest API (Permission: NONE, Security: NONE)",
+ "schema": {
+ "$ref": "#/definitions/PongEntity"
+ }
+ }
+ },
+ "tags": [
+ "ping"
+ ],
+ "operationId": "getVer1Ping"
+ }
+ },
+ "/ver1/time": {
+ "get": {
+ "description": "Test connectivity to the Rest API and get the current server time (Permission: NONE, Security: NONE)",
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "Test connectivity to the Rest API and get the current server time (Permission: NONE, Security: NONE)",
+ "schema": {
+ "$ref": "#/definitions/TimeEntity"
+ }
+ }
+ },
+ "tags": [
+ "time"
+ ],
+ "operationId": "getVer1Time"
+ }
+ },
+ "/v2/smart_trades": {
+ "get": {
+ "description": "Get smart trade history (Permission: SMART_TRADE_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "query",
+ "name": "account_id",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "pair",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "type",
+ "type": "string",
+ "enum": [
+ "simple_buy",
+ "simple_sell",
+ "smart_sell",
+ "smart_trade",
+ "smart_cover",
+ "smart_buy"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "page",
+ "type": "integer",
+ "format": "int32",
+ "default": 1,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "per_page",
+ "type": "integer",
+ "format": "int32",
+ "default": 10,
+ "minimum": 1,
+ "maximum": 100,
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "status",
+ "type": "string",
+ "enum": [
+ "all",
+ "active",
+ "finished",
+ "successfully_finished",
+ "cancelled",
+ "failed"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order_by",
+ "type": "string",
+ "default": "status",
+ "enum": [
+ "created_at",
+ "updated_at",
+ "closed_at",
+ "status",
+ "profit",
+ "profit_percentage"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "order_direction",
+ "type": "string",
+ "default": "desc",
+ "enum": [
+ "asc",
+ "desc"
+ ],
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "from",
+ "description": "Param for a filter by created date",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "base",
+ "description": "Base currency",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "query",
+ "name": "quote",
+ "description": "Quote currency",
+ "type": "string",
+ "required": false
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Get smart trade history (Permission: SMART_TRADE_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "getV2SmartTrades"
+ },
+ "post": {
+ "description": "Create smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "account_id",
+ "description": "id from GET /ver1/accounts",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "pair",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "instant",
+ "description": "true for Simple Buy and Simple Sell",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "skip_enter_step",
+ "description": "true only for Smart Sell",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage[enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage[type]",
+ "type": "string",
+ "enum": [
+ "custom",
+ "cross",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage[value]",
+ "description": "Cross leverage value",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "position[type]",
+ "type": "string",
+ "enum": [
+ "buy",
+ "sell"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[order_type]",
+ "type": "string",
+ "enum": [
+ "market",
+ "limit",
+ "conditional"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[units][value]",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[price][value]",
+ "description": "Price for limit order",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][price][value]",
+ "description": "Conditional trigger price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][price][type]",
+ "description": "By default ask for long, bid for short",
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][order_type]",
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][trailing][enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][trailing][percent]",
+ "description": "Should be 100% in the sum of all steps",
+ "type": "number",
+ "format": "float",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][order_type]",
+ "description": "market, limit",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ]
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][volume]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][price][type]",
+ "description": "bid, ask, last",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][price][value]",
+ "description": "only if position has no trailing or position trailing is finished",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][price][percent]",
+ "description": "only if position has trailing and position trailing is not finished",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][trailing][enabled]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][trailing][percent]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[breakeven]",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[order_type]",
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[price][value]",
+ "description": "Price for limit order",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][price][type]",
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][price][value]",
+ "description": "if position has no trailing or position trailing is finished",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][price][percent]",
+ "description": "only if position has trailing and position trailing is not finished",
+ "type": "number",
+ "format": "float",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][trailing][enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[timeout][enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[timeout][value]",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Create smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTrades"
+ }
+ },
+ "/v2/smart_trades/{id}": {
+ "get": {
+ "description": "Get smart trade v2 by id (Permission: SMART_TRADE_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Get smart trade v2 by id (Permission: SMART_TRADE_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "getV2SmartTradesId"
+ },
+ "delete": {
+ "description": "Cancel smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Cancel smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "deleteV2SmartTradesId"
+ },
+ "patch": {
+ "description": "Update smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "leverage[enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "leverage[type]",
+ "type": "string",
+ "enum": [
+ "custom",
+ "cross",
+ "isolated"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "leverage[value]",
+ "description": "Cross leverage value",
+ "type": "integer",
+ "format": "int32",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "position[units][value]",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[price][value]",
+ "description": "Price for limit order",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][price][value]",
+ "description": "Conditional trigger price",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][price][type]",
+ "description": "By default ask for long, bid for short",
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][order_type]",
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][trailing][enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "position[conditional][trailing][percent]",
+ "type": "number",
+ "format": "float",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][order_type]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ]
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][volume]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "number",
+ "format": "float"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][price][type]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][price][value]",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][price][percent]",
+ "type": "array",
+ "required": false,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][trailing][enabled]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "take_profit[steps][][trailing][percent]",
+ "type": "array",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[breakeven]",
+ "type": "boolean",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[order_type]",
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[price][value]",
+ "description": "Price for limit order",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][price][type]",
+ "type": "string",
+ "enum": [
+ "bid",
+ "ask",
+ "last"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][price][value]",
+ "description": "Trigger price",
+ "type": "number",
+ "format": "double",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][price][percent]",
+ "type": "number",
+ "format": "float",
+ "required": false
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[conditional][trailing][enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[timeout][enabled]",
+ "type": "boolean",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "stop_loss[timeout][value]",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Update smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "patchV2SmartTradesId"
+ }
+ },
+ "/v2/smart_trades/{id}/reduce_funds": {
+ "post": {
+ "description": "Reduce funds for smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "order_type",
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "units[value]",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "price[value]",
+ "description": "Price for limit order",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Reduce funds for smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTradesIdReduceFunds"
+ }
+ },
+ "/v2/smart_trades/{id}/add_funds": {
+ "post": {
+ "description": "Average for smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "order_type",
+ "type": "string",
+ "enum": [
+ "market",
+ "limit"
+ ],
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "units[value]",
+ "description": "Amount of units to buy",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "formData",
+ "name": "price[value]",
+ "description": "Price for limit order",
+ "type": "number",
+ "format": "double",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Average for smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTradesIdAddFunds"
+ }
+ },
+ "/v2/smart_trades/{id}/close_by_market": {
+ "post": {
+ "description": "Close by market smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Close by market smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTradesIdCloseByMarket"
+ }
+ },
+ "/v2/smart_trades/{id}/force_start": {
+ "post": {
+ "description": "Force start smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Force start smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTradesIdForceStart"
+ }
+ },
+ "/v2/smart_trades/{id}/force_process": {
+ "post": {
+ "description": "Process smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Process smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTradesIdForceProcess"
+ }
+ },
+ "/v2/smart_trades/{id}/set_note": {
+ "post": {
+ "description": "Set note to smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "formData",
+ "name": "note",
+ "type": "string",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Set note to smart trade v2 (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTradesIdSetNote"
+ }
+ },
+ "/v2/smart_trades/{smart_trade_id}/trades": {
+ "get": {
+ "description": "Get smart trade v2 trades (Permission: SMART_TRADE_READ, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Get smart trade v2 trades (Permission: SMART_TRADE_READ, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "getV2SmartTradesSmartTradeIdTrades"
+ }
+ },
+ "/v2/smart_trades/{smart_trade_id}/trades/{id}/close_by_market": {
+ "post": {
+ "description": "Panic close trade by market (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "consumes": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "201": {
+ "description": "Panic close trade by market (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "postV2SmartTradesSmartTradeIdTradesIdCloseByMarket"
+ }
+ },
+ "/v2/smart_trades/{smart_trade_id}/trades/{id}": {
+ "delete": {
+ "description": "Cancel trade (Permission: SMART_TRADE_WRITE, Security: SIGNED)",
+ "produces": [
+ "application/json"
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "smart_trade_id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "type": "integer",
+ "format": "int32",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Cancel trade (Permission: SMART_TRADE_WRITE, Security: SIGNED)"
+ }
+ },
+ "tags": [
+ "smart_trades_v2"
+ ],
+ "operationId": "deleteV2SmartTradesSmartTradeIdTradesId"
+ }
+ }
+ },
+ "definitions": {
+ "IndexEntity": {
+ "type": "object",
+ "properties": {
+ "bots": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/MarketplaceBotEntity"
+ }
+ },
+ "total": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "page": {
+ "type": "integer",
+ "format": "int32"
+ }
+ },
+ "description": "Marketplace presets (Permission: NONE, Security: SIGNED)"
+ },
+ "MarketplaceBotEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "type": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "strategy": {
+ "type": "string"
+ },
+ "secret": {
+ "type": "string"
+ },
+ "marketplace_item": {
+ "$ref": "#/definitions/MarketplaceItem"
+ },
+ "profit": {
+ "$ref": "#/definitions/Profit"
+ },
+ "currencies": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "copies": {
+ "type": "integer",
+ "format": "int32",
+ "description": "Bot's copies count"
+ },
+ "is_favorite": {
+ "type": "boolean"
+ }
+ }
+ },
+ "MarketplaceItem": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32"
+ },
+ "name": {
+ "type": "string"
+ },
+ "icon_url": {
+ "type": "string"
+ }
+ }
+ },
+ "Profit": {
+ "type": "object",
+ "properties": {
+ "period": {
+ "type": "string"
+ },
+ "amount": {
+ "type": "number",
+ "format": "double"
+ },
+ "chart_data": {
+ "type": "array",
+ "items": {
+ "type": "number",
+ "format": "double"
+ }
+ }
+ },
+ "description": "Grid Bot Profits (Permission: BOTS_READ, Security: SIGNED)"
+ },
+ "PongEntity": {
+ "type": "object",
+ "properties": {
+ "pong": {
+ "type": "string",
+ "example": "'pong'"
+ }
+ },
+ "description": "Test connectivity to the Rest API (Permission: NONE, Security: NONE)"
+ },
+ "TimeEntity": {
+ "type": "object",
+ "properties": {
+ "server_time": {
+ "type": "integer",
+ "format": "int32",
+ "example": "1592769067",
+ "description": "UNIX timestamp"
+ }
+ },
+ "description": "Test connectivity to the Rest API and get the current server time (Permission: NONE, Security: NONE)"
+ },
+ "BotEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "example": 5
+ },
+ "account_id": {
+ "type": "integer",
+ "format": "int32",
+ "example": 10
+ },
+ "is_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "max_safety_orders": {
+ "type": "integer",
+ "format": "int32",
+ "example": 5
+ },
+ "active_safety_orders_count": {
+ "type": "integer",
+ "format": "int32",
+ "example": 2
+ },
+ "pairs": {
+ "type": "string",
+ "example": "['BTC_LTC', 'BTC_ETH', 'BTC_ADA']",
+ "description": "Format: [QUOTE_BASE, ...]"
+ },
+ "strategy_list": {
+ "type": "string",
+ "example": "[{'options'=>{'time'=>'5m', 'type'=>'buy_or_strong_buy'}, 'strategy'=>'trading_view'}, ...]"
+ },
+ "max_active_deals": {
+ "type": "integer",
+ "format": "int32",
+ "example": 2
+ },
+ "active_deals_count": {
+ "type": "integer",
+ "format": "int32",
+ "example": 2
+ },
+ "deletable?": {
+ "type": "boolean",
+ "example": true
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "updated_at": {
+ "type": "string",
+ "example": "2018-08-10 10:10:10"
+ },
+ "trailing_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "tsl_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "deal_start_delay_seconds": {
+ "type": "integer",
+ "format": "int32",
+ "example": 60,
+ "description": "Deal start delay in seconds"
+ },
+ "stop_loss_timeout_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "stop_loss_timeout_in_seconds": {
+ "type": "integer",
+ "format": "int32",
+ "example": 2
+ },
+ "disable_after_deals_count": {
+ "type": "integer",
+ "format": "int32",
+ "example": 2
+ },
+ "deals_counter": {
+ "type": "integer",
+ "format": "int32",
+ "example": 2
+ },
+ "allowed_deals_on_same_pair": {
+ "type": "integer",
+ "format": "int32",
+ "example": 2
+ },
+ "easy_form_supported": {
+ "type": "boolean",
+ "example": true
+ },
+ "close_deals_timeout": {
+ "type": "integer",
+ "format": "int32",
+ "example": 70,
+ "description": "Close bot deals after given number of seconds"
+ },
+ "url_secret": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string",
+ "example": "'Test Bot'"
+ },
+ "take_profit": {
+ "type": "string",
+ "example": "'1.5'",
+ "description": "'Percentage'"
+ },
+ "base_order_volume": {
+ "type": "string",
+ "example": "'0.002'"
+ },
+ "safety_order_volume": {
+ "type": "string",
+ "example": "'0.0015'"
+ },
+ "safety_order_step_percentage": {
+ "type": "string",
+ "example": "'1.1'"
+ },
+ "take_profit_type": {
+ "type": "string",
+ "example": "'base'",
+ "description": "Values: base, total"
+ },
+ "type": {
+ "type": "string",
+ "example": "'Bot::SingleBot'",
+ "description": "Values: [\"Bot::MultiBot\", \"Bot::SingleBot\", \"Bot::SwitchBot\"]"
+ },
+ "martingale_volume_coefficient": {
+ "type": "string",
+ "example": "'1.3'"
+ },
+ "martingale_step_coefficient": {
+ "type": "string",
+ "example": "'0.9'"
+ },
+ "stop_loss_percentage": {
+ "type": "string",
+ "example": "'5.5'"
+ },
+ "cooldown": {
+ "type": "string",
+ "example": "'200'"
+ },
+ "btc_price_limit": {
+ "type": "string",
+ "example": "'30.15'"
+ },
+ "strategy": {
+ "type": "string",
+ "example": "'long'",
+ "description": "Values: long, short"
+ },
+ "min_volume_btc_24h": {
+ "type": "string",
+ "example": "'500.5'"
+ },
+ "profit_currency": {
+ "type": "string",
+ "example": "'quote_currency'",
+ "description": "Values: quote_currency, base_currency"
+ },
+ "min_price": {
+ "type": "string",
+ "example": "'0.0245'"
+ },
+ "max_price": {
+ "type": "string",
+ "example": "'0.0123'"
+ },
+ "stop_loss_type": {
+ "type": "string",
+ "example": "'stop_loss'",
+ "description": "Values: stop_loss, stop_loss_and_disable_bot"
+ },
+ "safety_order_volume_type": {
+ "type": "string",
+ "example": "'base_currency'",
+ "description": "Values: quote_currency, base_currency, percent, xbt"
+ },
+ "base_order_volume_type": {
+ "type": "string",
+ "example": "'percent'",
+ "description": "Values: quote_currency, base_currency, percent, xbt"
+ },
+ "account_name": {
+ "type": "string",
+ "example": "'My account'"
+ },
+ "trailing_deviation": {
+ "type": "string",
+ "example": "0.14"
+ },
+ "finished_deals_profit_usd": {
+ "type": "string",
+ "example": "12.14"
+ },
+ "finished_deals_count": {
+ "type": "string",
+ "example": "252.1"
+ },
+ "leverage_type": {
+ "type": "string",
+ "example": "'not_specified'",
+ "description": "Values: cross, not_specified, isolated"
+ },
+ "leverage_custom_value": {
+ "type": "string",
+ "example": "'1'"
+ },
+ "start_order_type": {
+ "type": "string",
+ "example": "'limit'",
+ "description": "Values: limit, market"
+ },
+ "active_deals_usd_profit": {
+ "type": "string",
+ "example": "200.21",
+ "description": "Sum of active deals profits"
+ }
+ }
+ },
+ "AccountEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "example": 12
+ },
+ "auto_balance_period": {
+ "type": "integer",
+ "format": "int32",
+ "example": 12
+ },
+ "auto_balance_portfolio_id": {
+ "type": "integer",
+ "format": "int32",
+ "example": 452
+ },
+ "auto_balance_currency_change_limit": {
+ "type": "integer",
+ "format": "int32",
+ "example": 5
+ },
+ "autobalance_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "hedge_mode_available": {
+ "type": "boolean"
+ },
+ "hedge_mode_enabled": {
+ "type": "boolean"
+ },
+ "is_locked": {
+ "type": "boolean",
+ "example": true
+ },
+ "smart_trading_supported": {
+ "type": "boolean",
+ "example": true
+ },
+ "smart_selling_supported": {
+ "type": "boolean",
+ "example": true,
+ "description": "DEPRECATED. use smart_trading_supported instead"
+ },
+ "available_for_trading": {
+ "type": "boolean",
+ "example": true
+ },
+ "stats_supported": {
+ "type": "boolean",
+ "example": true
+ },
+ "trading_supported": {
+ "type": "boolean",
+ "example": true
+ },
+ "market_buy_supported": {
+ "type": "boolean",
+ "example": true
+ },
+ "market_sell_supported": {
+ "type": "boolean",
+ "example": true
+ },
+ "conditional_buy_supported": {
+ "type": "boolean",
+ "example": true
+ },
+ "bots_allowed": {
+ "type": "boolean",
+ "example": "false"
+ },
+ "bots_ttp_allowed": {
+ "type": "boolean",
+ "example": "false"
+ },
+ "bots_tsl_allowed": {
+ "type": "boolean",
+ "example": "false"
+ },
+ "gordon_bots_available": {
+ "type": "boolean",
+ "example": "false"
+ },
+ "multi_bots_allowed": {
+ "type": "boolean",
+ "example": "false"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "updated_at": {
+ "type": "string",
+ "example": "2018-08-22 02:25:08"
+ },
+ "last_auto_balance": {
+ "type": "string",
+ "example": "2018-08-21 08:08:08"
+ },
+ "fast_convert_available": {
+ "type": "boolean",
+ "example": true,
+ "description": "Sell all to USD/BTC possibility"
+ },
+ "grid_bots_allowed": {
+ "type": "boolean",
+ "example": true
+ },
+ "api_key_invalid": {
+ "type": "boolean",
+ "example": true
+ },
+ "deposit_enabled": {
+ "type": "boolean",
+ "example": "false"
+ },
+ "supported_market_types": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string",
+ "example": "''"
+ },
+ "name": {
+ "type": "string",
+ "example": "'Binance 2 '"
+ },
+ "auto_balance_method": {
+ "type": "integer",
+ "format": "int32",
+ "example": "'time'",
+ "description": "Values: time, currency_change"
+ },
+ "auto_balance_error": {
+ "type": "string",
+ "example": "'Failed to autobalance'"
+ },
+ "customer_id": {
+ "type": "string"
+ },
+ "subaccount_name": {
+ "type": "string"
+ },
+ "lock_reason": {
+ "type": "string",
+ "example": "'API key is invalid'"
+ },
+ "btc_amount": {
+ "type": "string",
+ "example": "'0.01134219'"
+ },
+ "usd_amount": {
+ "type": "string",
+ "example": "'70.93146245'"
+ },
+ "day_profit_btc": {
+ "type": "string",
+ "example": "'-0.00006'"
+ },
+ "day_profit_usd": {
+ "type": "string",
+ "example": "'-0.02147'"
+ },
+ "day_profit_btc_percentage": {
+ "type": "string",
+ "example": "'-0.26'"
+ },
+ "day_profit_usd_percentage": {
+ "type": "string",
+ "example": "'-1.23'"
+ },
+ "btc_profit": {
+ "type": "string",
+ "example": "'0.0001625'",
+ "description": "Month period"
+ },
+ "usd_profit": {
+ "type": "string",
+ "example": "'5.05764787'",
+ "description": "Month period"
+ },
+ "usd_profit_percentage": {
+ "type": "string",
+ "example": "'6.25'",
+ "description": "Month period"
+ },
+ "btc_profit_percentage": {
+ "type": "string",
+ "example": "'2.36'",
+ "description": "Month period"
+ },
+ "total_btc_profit": {
+ "type": "string",
+ "example": "'0.0012456'"
+ },
+ "total_usd_profit": {
+ "type": "string",
+ "example": "'6.123181'"
+ },
+ "pretty_display_type": {
+ "type": "string",
+ "example": "'BittrexAccount'"
+ },
+ "exchange_name": {
+ "type": "string",
+ "example": "'Binance Futures'"
+ },
+ "market_code": {
+ "type": "string",
+ "example": "'deribit_testnet'"
+ },
+ "address": {
+ "type": "string",
+ "example": "'0xe00000dded00bbb08725d77777777ff070aa7aa7'"
+ }
+ }
+ },
+ "GridBotEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "format": "int32",
+ "example": 5
+ },
+ "account_id": {
+ "type": "integer",
+ "format": "int32",
+ "example": 10
+ },
+ "account_name": {
+ "type": "string",
+ "example": "'My account'"
+ },
+ "is_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "grids_quantity": {
+ "type": "string",
+ "example": "'20'"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "updated_at": {
+ "type": "string",
+ "example": "2018-08-10 10:10:10"
+ },
+ "strategy_type": {
+ "type": "string",
+ "example": "'manual'"
+ },
+ "lower_price": {
+ "type": "string",
+ "example": "'8000'"
+ },
+ "upper_price": {
+ "type": "string",
+ "example": "'10000'"
+ },
+ "quantity_per_grid": {
+ "type": "string",
+ "example": "'100'"
+ },
+ "leverage_type": {
+ "type": "string",
+ "example": "'isolated'"
+ },
+ "leverage_custom_value": {
+ "type": "string",
+ "example": "'20.1'"
+ },
+ "name": {
+ "type": "string",
+ "example": "'GridBot1'"
+ },
+ "pair": {
+ "type": "string",
+ "example": "'BTC_ETH'"
+ },
+ "start_price": {
+ "type": "string",
+ "example": "'9000'"
+ },
+ "grid_price_step": {
+ "type": "string",
+ "example": "'100'"
+ },
+ "current_profit": {
+ "type": "string",
+ "example": "100"
+ },
+ "current_profit_usd": {
+ "type": "string",
+ "example": "1000"
+ },
+ "total_profits_count": {
+ "type": "string",
+ "example": "10"
+ },
+ "bought_volume": {
+ "type": "string",
+ "example": "1000"
+ },
+ "sold_volume": {
+ "type": "string",
+ "example": "1000"
+ },
+ "profit_percentage": {
+ "type": "string",
+ "example": "0.1"
+ },
+ "current_price": {
+ "type": "string",
+ "example": "100.1"
+ },
+ "investment_base_currency": {
+ "type": "string",
+ "example": "100"
+ },
+ "investment_quote_currency": {
+ "type": "string",
+ "example": "100"
+ },
+ "grid_lines": {
+ "$ref": "#/definitions/GridLineEntity"
+ }
+ }
+ },
+ "GridLineEntity": {
+ "type": "object",
+ "properties": {
+ "price": {
+ "type": "string",
+ "example": "'8000'"
+ },
+ "side": {
+ "type": "string",
+ "example": "'SELL'"
+ },
+ "order_placed": {
+ "type": "boolean",
+ "example": true
+ }
+ }
+ },
+ "GridBotProfitsEntity": {
+ "type": "object",
+ "properties": {
+ "grid_line_id": {
+ "type": "integer",
+ "format": "int32",
+ "example": "'8000'"
+ },
+ "profit": {
+ "type": "string",
+ "example": "'0.01'"
+ },
+ "usd_profit": {
+ "type": "string",
+ "example": "'100'"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ }
+ }
+ },
+ "DealEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "example": 1
+ },
+ "type": {
+ "type": "string",
+ "example": "Deal::ShortDeal",
+ "nullable": true
+ },
+ "bot_id": {
+ "type": "integer",
+ "example": 111
+ },
+ "max_safety_orders": {
+ "type": "integer",
+ "example": 2
+ },
+ "deal_has_error": {
+ "type": "boolean",
+ "example": true
+ },
+ "from_currency_id": {
+ "type": "integer",
+ "description": "DEPRECATED",
+ "example": 5
+ },
+ "to_currency_id": {
+ "type": "integer",
+ "description": "DEPRECATED",
+ "example": 10
+ },
+ "account_id": {
+ "type": "integer",
+ "example": 121
+ },
+ "active_safety_orders_count": {
+ "type": "integer",
+ "example": 1
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "updated_at": {
+ "type": "string",
+ "example": "2018-09-09 09:09:09"
+ },
+ "closed_at": {
+ "type": "string",
+ "example": "2018-10-10 10:10:10",
+ "nullable": true
+ },
+ "finished?": {
+ "type": "boolean"
+ },
+ "current_active_safety_orders_count": {
+ "type": "integer",
+ "example": 1
+ },
+ "current_active_safety_orders": {
+ "type": "integer",
+ "description": "DEPRECATED",
+ "example": 1
+ },
+ "completed_safety_orders_count": {
+ "type": "integer",
+ "description": "completed safeties (not including manual)",
+ "example": 2
+ },
+ "completed_manual_safety_orders_count": {
+ "type": "integer",
+ "description": "completed manual safeties",
+ "example": 2
+ },
+ "cancellable?": {
+ "type": "boolean"
+ },
+ "panic_sellable?": {
+ "type": "boolean"
+ },
+ "trailing_enabled": {
+ "type": "boolean",
+ "example": true,
+ "nullable": true
+ },
+ "tsl_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "stop_loss_timeout_enabled": {
+ "type": "boolean",
+ "example": true
+ },
+ "stop_loss_timeout_in_seconds": {
+ "type": "integer",
+ "example": 2
+ },
+ "active_manual_safety_orders": {
+ "type": "integer",
+ "example": 2
+ },
+ "pair": {
+ "type": "string",
+ "description": "Format: QUOTE_BASE",
+ "example": "'BTC_ADA'"
+ },
+ "status": {
+ "type": "string",
+ "description": "Values: created, base_order_placed, bought, cancelled, completed, failed, panic_sell_pending, panic_sell_order_placed, panic_sold, cancel_pending, stop_loss_pending, stop_loss_finished, stop_loss_order_placed, switched, switched_take_profit, ttp_activated, ttp_order_placed, liquidated, bought_safety_pending, bought_take_profit_pending, settled",
+ "example": "'failed'"
+ },
+ "localized_status": {
+ "type": "string"
+ },
+ "take_profit": {
+ "type": "string",
+ "description": "Percentage",
+ "example": "'1.23'",
+ "nullable": true
+ },
+ "base_order_volume": {
+ "type": "string",
+ "example": "'0.001'",
+ "nullable": true
+ },
+ "safety_order_volume": {
+ "type": "string",
+ "example": "'0.0015'",
+ "nullable": true
+ },
+ "safety_order_step_percentage": {
+ "type": "string",
+ "example": "'1.11'"
+ },
+ "leverage_type": {
+ "type": "string",
+ "example": "'isolated'"
+ },
+ "leverage_custom_value": {
+ "type": "string",
+ "example": "'20.1'",
+ "nullable": true
+ },
+ "bought_amount": {
+ "type": "string",
+ "example": "'1.5'",
+ "nullable": true
+ },
+ "bought_volume": {
+ "type": "string",
+ "example": "'150'",
+ "nullable": true
+ },
+ "bought_average_price": {
+ "type": "string",
+ "example": "'100'"
+ },
+ "base_order_average_price": {
+ "type": "string",
+ "example": "'100'",
+ "nullable": true
+ },
+ "sold_amount": {
+ "type": "string",
+ "example": "'1.5'",
+ "nullable": true
+ },
+ "sold_volume": {
+ "type": "string",
+ "example": "'150'",
+ "nullable": true
+ },
+ "sold_average_price": {
+ "type": "string",
+ "example": "'100'",
+ "nullable": true
+ },
+ "take_profit_type": {
+ "type": "string",
+ "description": "Values: base, total",
+ "example": "'base'"
+ },
+ "final_profit": {
+ "type": "string",
+ "example": "'-0.00051'"
+ },
+ "martingale_coefficient": {
+ "type": "string",
+ "description": "Percentage",
+ "example": "'1.2'"
+ },
+ "martingale_volume_coefficient": {
+ "type": "string",
+ "description": "Percentage",
+ "example": "'1.0'"
+ },
+ "martingale_step_coefficient": {
+ "type": "string",
+ "description": "Percentage",
+ "example": "'1.0'"
+ },
+ "stop_loss_percentage": {
+ "type": "string",
+ "example": "'3.6'",
+ "nullable": true
+ },
+ "error_message": {
+ "type": "string",
+ "example": "'Error placing base order'",
+ "nullable": true
+ },
+ "profit_currency": {
+ "type": "string",
+ "description": "Values: quote_currency, base_currency",
+ "example": "'quote_currency'"
+ },
+ "stop_loss_type": {
+ "type": "string",
+ "description": "Values: stop_loss, stop_loss_and_disable_bot",
+ "example": "'stop_loss'"
+ },
+ "safety_order_volume_type": {
+ "type": "string",
+ "description": "Values: quote_currency, base_currency, percent, xbt",
+ "example": "'quote_currency'"
+ },
+ "base_order_volume_type": {
+ "type": "string",
+ "description": "Values: quote_currency, base_currency, percent, xbt",
+ "example": "'base_currency,'"
+ },
+ "from_currency": {
+ "type": "string",
+ "example": "'BTC'"
+ },
+ "to_currency": {
+ "type": "string",
+ "example": "'ADA'"
+ },
+ "current_price": {
+ "type": "string",
+ "example": "'102'"
+ },
+ "take_profit_price": {
+ "type": "string",
+ "example": "'105'"
+ },
+ "stop_loss_price": {
+ "type": "string",
+ "example": "'95.3'",
+ "nullable": true
+ },
+ "final_profit_percentage": {
+ "type": "string",
+ "example": "'4.2'"
+ },
+ "actual_profit_percentage": {
+ "type": "string",
+ "example": "'3.4'"
+ },
+ "bot_name": {
+ "type": "string",
+ "example": "My bot"
+ },
+ "account_name": {
+ "type": "string",
+ "example": "My Account"
+ },
+ "usd_final_profit": {
+ "type": "string",
+ "example": "'3.3523452'"
+ },
+ "actual_profit": {
+ "type": "string",
+ "example": "'0.0023'"
+ },
+ "actual_usd_profit": {
+ "type": "string",
+ "example": "'0.0023'"
+ },
+ "failed_message": {
+ "type": "string",
+ "example": "Failed",
+ "nullable": true
+ },
+ "reserved_base_coin": {
+ "type": "string",
+ "example": "1.3423523"
+ },
+ "reserved_second_coin": {
+ "type": "string",
+ "example": "0.1412454"
+ },
+ "trailing_deviation": {
+ "type": "string",
+ "example": "0.14",
+ "nullable": true
+ },
+ "trailing_max_price": {
+ "type": "string",
+ "description": "Highest price met in case of long deal, lowest price otherwise",
+ "example": "0.1412454",
+ "nullable": true
+ },
+ "tsl_max_price": {
+ "type": "string",
+ "description": "Highest price met in TSL in case of long deal, lowest price otherwise",
+ "example": "0.1412454",
+ "nullable": true
+ },
+ "strategy": {
+ "type": "string",
+ "description": "short or long",
+ "example": "'short'"
+ },
+ "reserved_quote_funds": {
+ "type": "number",
+ "description": "Sum of reserved in active deals funds in QUOTE",
+ "nullable": true
+ },
+ "reserved_base_funds": {
+ "type": "number",
+ "description": "Sum of reserved in active deals funds in BASE",
+ "nullable": true
+ }
+ },
+ "additionalProperties": false
+ },
+ "SmartTradeV2Entity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "version": {
+ "type": "integer"
+ },
+ "account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "market": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ }
+ }
+ },
+ "pair": {
+ "type": "string"
+ },
+ "instant": {
+ "type": "boolean"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "leverage": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string"
+ },
+ "value": {
+ "type": "integer"
+ }
+ }
+ },
+ "position": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "editable": {
+ "type": "boolean"
+ },
+ "units": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string",
+ "example": 1231.11,
+ "nullable": true
+ },
+ "editable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "price": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "number",
+ "example": 1223.32,
+ "nullable": true
+ },
+ "value_without_commission": {
+ "type": "number",
+ "example": 500.2,
+ "nullable": true
+ },
+ "editable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "total": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "number",
+ "example": 100.2,
+ "nullable": true
+ }
+ }
+ },
+ "order_type": {
+ "type": "string"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "take_profit": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "steps": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TakeProfitStep"
+ }
+ }
+ }
+ },
+ "stop_loss": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "note": {
+ "type": "string"
+ },
+ "skip_enter_step": {
+ "type": "boolean"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "editable": {
+ "type": "boolean"
+ },
+ "current_price": {
+ "type": "object",
+ "properties": {
+ "quote_volume": {
+ "type": "string"
+ },
+ "last": {
+ "type": "string"
+ }
+ }
+ },
+ "target_price_type": {
+ "type": "string"
+ },
+ "base_order_finished": {
+ "type": "boolean"
+ },
+ "missing_funds_to_close": {
+ "type": "number"
+ },
+ "liquidation_price": {
+ "type": "number",
+ "example": 1000.22,
+ "nullable": true
+ },
+ "average_enter_price": {
+ "type": "number",
+ "example": 60.2,
+ "nullable": true
+ },
+ "average_close_price": {
+ "type": "number",
+ "example": 60.2,
+ "nullable": true
+ },
+ "average_enter_price_without_commission": {
+ "type": "number",
+ "example": 100.3,
+ "nullable": true
+ },
+ "average_close_price_without_commission": {
+ "type": "number",
+ "example": 40.2,
+ "nullable": true
+ },
+ "panic_sell_available": {
+ "type": "boolean"
+ },
+ "add_funds_available": {
+ "type": "boolean"
+ },
+ "force_start_available": {
+ "type": "boolean"
+ },
+ "force_process_available": {
+ "type": "boolean"
+ },
+ "cancel_available": {
+ "type": "boolean"
+ },
+ "finished": {
+ "type": "boolean"
+ },
+ "base_position_step_finished": {
+ "type": "boolean"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "updated_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "closed_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "type": {
+ "type": "string",
+ "example": "smart_sell"
+ }
+ }
+ },
+ "profit": {
+ "type": "object",
+ "properties": {
+ "volume": {
+ "type": "number",
+ "example": 14,
+ "nullable": true
+ },
+ "usd": {
+ "type": "number",
+ "example": 12.22,
+ "nullable": true
+ },
+ "percent": {
+ "type": "number",
+ "example": 12
+ },
+ "roe": {
+ "type": "number",
+ "nullable": true
+ }
+ }
+ },
+ "margin": {
+ "type": "object",
+ "properties": {
+ "amount": {
+ "type": "number",
+ "example": 100.2,
+ "nullable": true
+ },
+ "total": {
+ "type": "number",
+ "example": 700.2,
+ "nullable": true
+ }
+ }
+ },
+ "is_position_not_filled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
+ "TakeProfitStep": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "version": {
+ "type": "integer"
+ },
+ "account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "market": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ }
+ }
+ },
+ "pair": {
+ "type": "string"
+ },
+ "instant": {
+ "type": "boolean"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "leverage": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "type": {
+ "type": "string"
+ },
+ "value": {
+ "type": "integer"
+ }
+ }
+ },
+ "position": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "editable": {
+ "type": "boolean"
+ },
+ "units": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string",
+ "example": 1231.11,
+ "nullable": true
+ },
+ "editable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "price": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "number",
+ "example": 1223.32,
+ "nullable": true
+ },
+ "value_without_commission": {
+ "type": "number",
+ "example": 500.2,
+ "nullable": true
+ },
+ "editable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "total": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "number",
+ "example": 100.2,
+ "nullable": true
+ }
+ }
+ },
+ "order_type": {
+ "type": "string"
+ },
+ "status": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "take_profit": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "steps": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TakeProfitStep"
+ }
+ }
+ }
+ },
+ "stop_loss": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "note": {
+ "type": "string"
+ },
+ "skip_enter_step": {
+ "type": "boolean"
+ },
+ "data": {
+ "type": "object",
+ "properties": {
+ "editable": {
+ "type": "boolean"
+ },
+ "current_price": {
+ "type": "object",
+ "properties": {
+ "quote_volume": {
+ "type": "string"
+ },
+ "last": {
+ "type": "string"
+ }
+ }
+ },
+ "target_price_type": {
+ "type": "string"
+ },
+ "base_order_finished": {
+ "type": "boolean"
+ },
+ "missing_funds_to_close": {
+ "type": "number"
+ },
+ "liquidation_price": {
+ "type": "number",
+ "example": 1000.22,
+ "nullable": true
+ },
+ "average_enter_price": {
+ "type": "number",
+ "example": 60.2,
+ "nullable": true
+ },
+ "average_close_price": {
+ "type": "number",
+ "example": 60.2,
+ "nullable": true
+ },
+ "average_enter_price_without_commission": {
+ "type": "number",
+ "example": 100.3,
+ "nullable": true
+ },
+ "average_close_price_without_commission": {
+ "type": "number",
+ "example": 40.2,
+ "nullable": true
+ },
+ "panic_sell_available": {
+ "type": "boolean"
+ },
+ "add_funds_available": {
+ "type": "boolean"
+ },
+ "force_start_available": {
+ "type": "boolean"
+ },
+ "force_process_available": {
+ "type": "boolean"
+ },
+ "cancel_available": {
+ "type": "boolean"
+ },
+ "finished": {
+ "type": "boolean"
+ },
+ "base_position_step_finished": {
+ "type": "boolean"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "updated_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "closed_at": {
+ "type": "string",
+ "example": "2018-08-08 08:08:08"
+ },
+ "type": {
+ "type": "string",
+ "example": "smart_sell"
+ }
+ }
+ },
+ "profit": {
+ "type": "object",
+ "properties": {
+ "volume": {
+ "type": "number",
+ "example": 14,
+ "nullable": true
+ },
+ "usd": {
+ "type": "number",
+ "example": 12.22,
+ "nullable": true
+ },
+ "percent": {
+ "type": "number",
+ "example": 12
+ },
+ "roe": {
+ "type": "number",
+ "nullable": true
+ }
+ }
+ },
+ "margin": {
+ "type": "object",
+ "properties": {
+ "amount": {
+ "type": "number",
+ "example": 100.2,
+ "nullable": true
+ },
+ "total": {
+ "type": "number",
+ "example": 700.2,
+ "nullable": true
+ }
+ }
+ },
+ "is_position_not_filled": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
+ "BotDealsStatsEntity": {
+ "type": "object",
+ "properties": {
+ "completed": {
+ "type": "integer",
+ "example": 0
+ },
+ "panic_sold": {
+ "type": "integer",
+ "example": 0
+ },
+ "active": {
+ "type": "integer",
+ "example": 0
+ },
+ "completed_deals_usd_profit": {
+ "type": "string",
+ "example": "5000.0"
+ },
+ "from_currency_is_dollars": {
+ "type": "boolean",
+ "example": false
+ },
+ "completed_deals_btc_profit": {
+ "type": "string",
+ "example": "0.5"
+ },
+ "funds_locked_in_active_deals": {
+ "type": "string",
+ "example": "0.0"
+ },
+ "btc_funds_locked_in_active_deals": {
+ "type": "string",
+ "example": "0.0"
+ },
+ "active_deals_usd_profit": {
+ "type": "string",
+ "example": "0.0"
+ },
+ "active_deals_btc_profit": {
+ "type": "string",
+ "example": "0.0"
+ }
+ },
+ "additionalProperties": false
+ },
+ "LooseAccountEntity": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "example": 1
+ },
+ "name": {
+ "type": "string",
+ "example": "New Loose Account"
+ },
+ "created_at": {
+ "type": "string",
+ "example": "2021-07-08 08:08:08"
+ },
+ "updated_at": {
+ "type": "string",
+ "example": "2021-08-09 09:09:09"
+ },
+ "type": {
+ "type": "string",
+ "example": "Accounts::LooseAccount"
+ },
+ "is_deleted": {
+ "type": "boolean",
+ "example": false
+ },
+ "is_locked": {
+ "type": "boolean",
+ "example": false
+ }
+ },
+ "additionalProperties": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/type_generators/api_generator.py b/type_generators/api_generator.py
index 704b8d1..8a736bb 100644
--- a/type_generators/api_generator.py
+++ b/type_generators/api_generator.py
@@ -3,7 +3,7 @@
from pathlib import Path
from typing import List, Union, Dict, Iterable
-IN_PATH = './3commas_swaggerdoc.json'
+IN_PATH = '3commas_swaggerdoc_2022_01_24.json'
OUT_FOLDER = './generated_api'
INDENT = ' '
diff --git a/type_generators/auto_api_from_swaggerdoc.py b/type_generators/auto_api_from_swaggerdoc.py
index c49909f..8911c51 100644
--- a/type_generators/auto_api_from_swaggerdoc.py
+++ b/type_generators/auto_api_from_swaggerdoc.py
@@ -228,7 +228,7 @@ def create_models(swaggerdoc: Dict[str, dict]):
def generate():
- with open('./3commas_swaggerdoc.json', 'r') as f:
+ with open('3commas_swaggerdoc_2022_01_24.json', 'r') as f:
swaggerdoc: Dict[str, dict] = json.loads(f.read())
structured_code: Dict[str, list] = defaultdict(list)
diff --git a/type_generators/auto_api_from_swaggerdoc_2.py b/type_generators/auto_api_from_swaggerdoc_2.py
index 498c7b9..7d9bfc4 100644
--- a/type_generators/auto_api_from_swaggerdoc_2.py
+++ b/type_generators/auto_api_from_swaggerdoc_2.py
@@ -23,3 +23,15 @@ class ThreeCommasApiFunction:
action: str
action_id_name: str
sub_id_name: str
+
+
+# ideas
+# api.ver1.accounts.by_id.get(id=)
+# api.ver1.accounts.get() # use __call__()
+# api.ver1.accounts.get.by_id_and_sub_id(id=, sub_id=)
+# api.ver1.accounts.get.by_id(id=, sub_id=)
+# api.get.ver1.accounts.by_id(id=, sub_id=) # not preffered, better to have all account endpoint clustered in one file
+# api.get.ver1.accounts.remove.post(id=)
+# api.get.ver1.accounts.get(id=)
+# api.get.ver1.accounts.get()
+
diff --git a/type_generators/model_generator.py b/type_generators/model_generator.py
index e754067..ef0e10a 100644
--- a/type_generators/model_generator.py
+++ b/type_generators/model_generator.py
@@ -307,6 +307,14 @@ def __init__(self, name: str, properties: List[ThreeCommasJsonProperty]):
ThreeCommasJsonProperty('cancelable', bool),
ThreeCommasJsonProperty('force_processable', bool),
]),
+ ThreeCommasModelClass(name='BalanceChartDataElement',
+ properties=[
+ ThreeCommasJsonProperty('date', int),
+ ThreeCommasJsonProperty('usd', float),
+ ThreeCommasJsonProperty('btc', float),
+ ThreeCommasJsonProperty('btc_deposit_amount', float),
+ ThreeCommasJsonProperty('usd_deposit_amount', float),
+ ]),
]
diff --git a/type_generators/parsing_and_return_mapping.py b/type_generators/parsing_and_return_mapping.py
index 7762b3a..6f5b194 100644
--- a/type_generators/parsing_and_return_mapping.py
+++ b/type_generators/parsing_and_return_mapping.py
@@ -4,27 +4,36 @@
# {endpoint_path : str_class_to_parse_to}
ENDPOINT_PRODUCTION_MAP = {
- 'get /ver1/bots/{bot_id}/show': 'BotEntity',
- 'get /ver1/bots': 'List[BotEntity]',
- 'get /v2/smart_trades': 'List[SmartTradeV2Entity]',
- 'get /v2/smart_trades/{id}': 'SmartTradeV2Entity',
- 'get /ver1/accounts/market_pairs': 'List[str]',
+ 'GET /ver1/bots/{bot_id}/show': 'BotEntity',
+ 'GET /ver1/bots': 'List[BotEntity]',
+ 'GET /v2/smart_trades': 'List[SmartTradeV2Entity]',
+ 'GET /v2/smart_trades/{id}': 'SmartTradeV2Entity',
+ 'POST /v2/smart_trades': 'SmartTradeV2Entity',
+ 'GET /ver1/accounts/market_pairs': 'List[str]',
+ 'GET /ver1/accounts/{account_id}': 'AccountEntity',
+ 'POST /ver1/accounts/new': 'AccountEntity',
}
-def endpoint_returns(verb, endpoint):
- return ENDPOINT_PRODUCTION_MAP.get(f'{verb} {endpoint}')
+def endpoint_returns(verb: str, endpoint: str):
+ return ENDPOINT_PRODUCTION_MAP.get(f'{verb.upper()} {endpoint}')
# {endpoint_path : str_class_to_consume}
ENDPOINT_CONSUMPTION_MAP = {
- 'post /v2/smart_trades': 'SmartTradeV2Entity',
- 'get /ver1/accounts/market_pairs': 'dict',
+ 'POST /v2/smart_trades': 'SmartTradeV2Entity',
+ 'GET /ver1/accounts/market_pairs': 'dict',
}
-def endpoint_consumes(verb, endpoint):
- return ENDPOINT_CONSUMPTION_MAP.get(f'{verb} {endpoint}')
+def endpoint_consumes(verb: str, endpoint: str):
+ return ENDPOINT_CONSUMPTION_MAP.get(f'{verb.upper()} {endpoint}')
+
+FIELD_INITIAL_TYPE_MAPPINGS = {
+ 'AccountEntity': {
+ 'supported_market_types': List[str] # swaggerdoc states "str"
+ }
+}
# {name_of_model : {name_of_attr: parse_to}}