Add "is_bot_managed" flag to API

This commit is contained in:
Matthias
2023-04-22 14:57:13 +02:00
parent cb09ef7180
commit 7a47500b22
3 changed files with 7 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ class Balance(BaseModel):
leverage: float
is_position: bool
position: float
is_bot_managed: bool
class Balances(BaseModel):

View File

@@ -43,7 +43,8 @@ logger = logging.getLogger(__name__)
# 2.23: Allow plot config request in webserver mode
# 2.24: Add cancel_open_order endpoint
# 2.25: Add several profit values to /status endpoint
API_VERSION = 2.25
# 2.26: increase /balance output
API_VERSION = 2.26
# Public API, requires no auth.
router_public = APIRouter()

View File

@@ -631,7 +631,8 @@ class RPC:
continue
total += est_stake
if coin == stake_currency or coin in open_assets:
is_bot_managed = coin == stake_currency or coin in open_assets
if is_bot_managed:
total_bot += est_stake
currencies.append({
'currency': coin,
@@ -643,6 +644,7 @@ class RPC:
'side': 'long',
'leverage': 1,
'position': 0,
'is_bot_managed': is_bot_managed,
'is_position': False,
})
symbol: str
@@ -660,6 +662,7 @@ class RPC:
'stake': stake_currency,
'leverage': position.leverage,
'side': position.side,
'is_bot_managed': True,
'is_position': True
})