trd-utils 0.0.43__py3-none-any.whl → 0.0.45__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of trd-utils might be problematic. Click here for more details.
- trd_utils/__init__.py +1 -1
- trd_utils/exchanges/bx_ultra/bx_ultra_client.py +13 -2
- {trd_utils-0.0.43.dist-info → trd_utils-0.0.45.dist-info}/METADATA +1 -1
- {trd_utils-0.0.43.dist-info → trd_utils-0.0.45.dist-info}/RECORD +6 -6
- {trd_utils-0.0.43.dist-info → trd_utils-0.0.45.dist-info}/LICENSE +0 -0
- {trd_utils-0.0.43.dist-info → trd_utils-0.0.45.dist-info}/WHEEL +0 -0
trd_utils/__init__.py
CHANGED
|
@@ -77,6 +77,8 @@ logger = logging.getLogger(__name__)
|
|
|
77
77
|
# specific to the current session that is fetching them,
|
|
78
78
|
user_api_identity_cache: dict[int, int] = {}
|
|
79
79
|
|
|
80
|
+
_positions_hidden_warn_map: dict[str, bool] = {}
|
|
81
|
+
|
|
80
82
|
|
|
81
83
|
class BXUltraClient(ExchangeBase, IPriceFetcher):
|
|
82
84
|
###########################################################
|
|
@@ -922,6 +924,7 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
|
|
|
922
924
|
no_warn: bool = False,
|
|
923
925
|
min_margin: Decimal = 0,
|
|
924
926
|
) -> UnifiedTraderPositions:
|
|
927
|
+
global _positions_hidden_warn_map
|
|
925
928
|
perp_positions = []
|
|
926
929
|
std_positions = []
|
|
927
930
|
perp_ex: str = None
|
|
@@ -940,7 +943,11 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
|
|
|
940
943
|
raise ex
|
|
941
944
|
|
|
942
945
|
if not no_warn:
|
|
943
|
-
|
|
946
|
+
if err_str.find("positions hidden") != -1:
|
|
947
|
+
warn_key = f"perp_{uid}"
|
|
948
|
+
if not _positions_hidden_warn_map.get(warn_key, False):
|
|
949
|
+
_positions_hidden_warn_map[warn_key] = True
|
|
950
|
+
logger.warning(f"Failed to fetch perp positions of {uid}: {ex}")
|
|
944
951
|
perp_ex = ex
|
|
945
952
|
|
|
946
953
|
try:
|
|
@@ -955,7 +962,11 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
|
|
|
955
962
|
raise ex
|
|
956
963
|
|
|
957
964
|
if not no_warn:
|
|
958
|
-
|
|
965
|
+
if err_str.find("positions hidden") != -1:
|
|
966
|
+
warn_key = f"std_{uid}"
|
|
967
|
+
if not _positions_hidden_warn_map.get(warn_key, False):
|
|
968
|
+
_positions_hidden_warn_map[warn_key] = True
|
|
969
|
+
logger.warning(f"Failed to fetch std positions of {uid}: {ex}")
|
|
959
970
|
std_ex = ex
|
|
960
971
|
|
|
961
972
|
if not perp_positions and not std_positions:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
trd_utils/__init__.py,sha256=
|
|
1
|
+
trd_utils/__init__.py,sha256=vxgxuc3sNr3iokfiyshHWxXK-ULBlGLT71djL9Xot1E,25
|
|
2
2
|
trd_utils/cipher/__init__.py,sha256=V05KNuzQwCic-ihMVHlC8sENaJGc3I8MCb4pg4849X8,1765
|
|
3
3
|
trd_utils/common_utils/float_utils.py,sha256=aYPwJ005LmrRhXAngojwvdDdtRgeb1FfR6hKeQ5ndMU,470
|
|
4
4
|
trd_utils/common_utils/wallet_utils.py,sha256=OX9q2fymP0VfIWTRIRBP8W33cfyjLXimxMgPOsZe-3g,727
|
|
@@ -12,7 +12,7 @@ trd_utils/exchanges/blofin/blofin_client.py,sha256=JVimaxGHRVviQHZbPY1gek8ICPl8-
|
|
|
12
12
|
trd_utils/exchanges/blofin/blofin_types.py,sha256=bQx0opCgHwcuC-5TxiVA4VQr17A1x7u7QIMdcIrROAg,4315
|
|
13
13
|
trd_utils/exchanges/bx_ultra/__init__.py,sha256=8Ssy-eOemQR32Nv1-FoPHm87nRqRO4Fm2PU5GHEFKfQ,80
|
|
14
14
|
trd_utils/exchanges/bx_ultra/bx_types.py,sha256=7Ga6IYHQNRDbhWXmS1J0NxpcR9HUJ8ZwQGh-1EvNRqM,36687
|
|
15
|
-
trd_utils/exchanges/bx_ultra/bx_ultra_client.py,sha256=
|
|
15
|
+
trd_utils/exchanges/bx_ultra/bx_ultra_client.py,sha256=pB97gs1PHWNbE6M_81Oppf_4unFkUTQtIJEfhKEu_Uk,41571
|
|
16
16
|
trd_utils/exchanges/bx_ultra/bx_utils.py,sha256=PwapomwDW33arVmKIDj6cL-aP0ptu4BYy_lOCqSAPOo,1392
|
|
17
17
|
trd_utils/exchanges/errors.py,sha256=P_NTuc389XL7rFegomP59BydWmHv8ckiGyNU-_l5qNQ,167
|
|
18
18
|
trd_utils/exchanges/exchange_base.py,sha256=eAORzCci78b2-IrslkQnMIbzVJGb6YYzNzniCUHG-jg,7891
|
|
@@ -35,7 +35,7 @@ trd_utils/types_helper/decorators.py,sha256=ziQGDKV0RnhMG6gBPAz244Ug3j6ayr0iKXeu
|
|
|
35
35
|
trd_utils/types_helper/model_config.py,sha256=uvyhdGHQZ1A_I5RUbCgzlDk6MxWL6RLV8r0cdVi6nBk,60
|
|
36
36
|
trd_utils/types_helper/ultra_list.py,sha256=01WQSkx0G7lD9O9XcXccexniNwyuQ9LwVOeixxr4tWQ,1178
|
|
37
37
|
trd_utils/types_helper/utils.py,sha256=Xq4SZG4NkkGzJyOBs9huAvzl2YcCZ7ZRjfOHol3o-Kc,569
|
|
38
|
-
trd_utils-0.0.
|
|
39
|
-
trd_utils-0.0.
|
|
40
|
-
trd_utils-0.0.
|
|
41
|
-
trd_utils-0.0.
|
|
38
|
+
trd_utils-0.0.45.dist-info/LICENSE,sha256=J1EP2xt87RjjmsTV1jTjHDQMLIM9FjdwEftTpw8hyv4,1067
|
|
39
|
+
trd_utils-0.0.45.dist-info/METADATA,sha256=p8f1kTQ54fXWZxFtp96-XAHlbXK9WWY81mECj4DXU1Y,1179
|
|
40
|
+
trd_utils-0.0.45.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
41
|
+
trd_utils-0.0.45.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|