@@ -964,7 +964,6 @@ def _limit_order_kwargs(client, symbol, amount, price, side, market_type, client
964964 from app .services .live_trading .binance_spot import BinanceSpotClient
965965 from app .services .live_trading .okx import OkxClient
966966 from app .services .live_trading .bybit import BybitClient
967- from app .services .live_trading .deepcoin import DeepcoinClient
968967
969968 if isinstance (client , (BinanceFuturesClient , BinanceSpotClient )):
970969 return {"quantity" : amount , "price" : price , "client_order_id" : client_order_id }
@@ -977,7 +976,7 @@ def _limit_order_kwargs(client, symbol, amount, price, side, market_type, client
977976 pos_side = "long" if side .lower () == "buy" else "short"
978977 kwargs ["pos_side" ] = pos_side
979978 return kwargs
980- if isinstance (client , ( BybitClient , DeepcoinClient ) ):
979+ if isinstance (client , BybitClient ):
981980 return {"qty" : amount , "price" : price , "client_order_id" : client_order_id }
982981 # Generic fallback
983982 return {"size" : amount , "price" : price , "client_order_id" : client_order_id }
@@ -1501,31 +1500,28 @@ def _fetch_exchange_positions_raw(
15011500 """
15021501 Fetch raw position payload for quick-trade / close-position.
15031502
1504- Many clients do not accept ``symbol=`` on ``get_positions()`` (Gate, KuCoin ),
1503+ Many clients do not accept ``symbol=`` on ``get_positions()`` (Gate),
15051504 or need extra args (Bitget ``product_type``, OKX ``inst_type``). Centralize here.
15061505 """
15071506 from app .services .live_trading .binance import BinanceFuturesClient
15081507 from app .services .live_trading .binance_spot import BinanceSpotClient
15091508 from app .services .live_trading .bitget import BitgetMixClient
15101509 from app .services .live_trading .bitget_spot import BitgetSpotClient
15111510 from app .services .live_trading .bybit import BybitClient
1512- from app .services .live_trading .deepcoin import DeepcoinClient
15131511 from app .services .live_trading .gate import GateSpotClient , GateUsdtFuturesClient
15141512 from app .services .live_trading .htx import HtxClient
1515- from app .services .live_trading .kucoin import KucoinFuturesClient , KucoinSpotClient
15161513 from app .services .live_trading .okx import OkxClient
15171514 from app .services .live_trading .symbols import (
15181515 to_bybit_symbol ,
15191516 to_gate_currency_pair ,
1520- to_kucoin_futures_symbol ,
15211517 to_okx_spot_inst_id ,
15221518 to_okx_swap_inst_id ,
15231519 )
15241520
15251521 mt = (market_type or "swap" ).strip ().lower ()
15261522
15271523 if mt == "spot" and isinstance (
1528- client , (BinanceSpotClient , BitgetSpotClient , KucoinSpotClient , OkxClient )
1524+ client , (BinanceSpotClient , BitgetSpotClient , OkxClient )
15291525 ):
15301526 return _fetch_spot_holdings_raw (client , symbol = symbol )
15311527
@@ -1619,19 +1615,6 @@ def _fetch_exchange_positions_raw(
16191615 [(p .get ("size" ), p .get ("positionAmt" )) for p in out ])
16201616 return out
16211617
1622- if isinstance (client , KucoinFuturesClient ):
1623- raw = client .get_positions ()
1624- data = raw .get ("data" ) if isinstance (raw , dict ) else []
1625- sym = to_kucoin_futures_symbol (symbol )
1626- if not isinstance (data , list ):
1627- data = []
1628- filtered = [p for p in data if isinstance (p , dict ) and str (p .get ("symbol" ) or "" ).strip () == sym ]
1629- if isinstance (raw , dict ):
1630- out = dict (raw )
1631- out ["data" ] = filtered
1632- return out
1633- return {"data" : filtered }
1634-
16351618 if isinstance (client , HtxClient ):
16361619 if mt == "spot" :
16371620 return client .get_positions (symbol = symbol )
@@ -1667,9 +1650,6 @@ def _fetch_exchange_positions_raw(
16671650 [(p .get ("contract_code" ), p .get ("volume" ), p .get ("positionAmt" )) for p in out_items ])
16681651 return {"data" : out_items }
16691652
1670- if isinstance (client , DeepcoinClient ):
1671- return client .get_positions (symbol = symbol )
1672-
16731653 if hasattr (client , "get_positions" ):
16741654 try :
16751655 return client .get_positions (symbol = symbol )
0 commit comments