siglab-py 0.1.60__py3-none-any.whl → 0.2.0__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 siglab-py might be problematic. Click here for more details.
- siglab_py/ordergateway/gateway.py +5 -0
- siglab_py/ordergateway/test_ordergateway.py +8 -7
- {siglab_py-0.1.60.dist-info → siglab_py-0.2.0.dist-info}/METADATA +1 -1
- {siglab_py-0.1.60.dist-info → siglab_py-0.2.0.dist-info}/RECORD +6 -6
- {siglab_py-0.1.60.dist-info → siglab_py-0.2.0.dist-info}/WHEEL +0 -0
- {siglab_py-0.1.60.dist-info → siglab_py-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -669,6 +669,7 @@ async def execute_one_position(
|
|
|
669
669
|
position.dispatched_slices.append(slice)
|
|
670
670
|
|
|
671
671
|
log(f"Executed slice #{i}", log_level=LogLevel.INFO)
|
|
672
|
+
log(f"{json.dumps(slice.to_dict(), indent=4)}")
|
|
672
673
|
log(f"{position.ticker}, multiplier: {multiplier}, slice_amount_in_base_ccy: {slice_amount_in_base_ccy}, rounded_slice_amount_in_base_ccy, {rounded_slice_amount_in_base_ccy}", log_level=LogLevel.INFO)
|
|
673
674
|
if position.order_type=='limit':
|
|
674
675
|
log(f"{position.ticker}, limit_price: {limit_price}, rounded_limit_price, {rounded_limit_price}", log_level=LogLevel.INFO)
|
|
@@ -678,6 +679,7 @@ async def execute_one_position(
|
|
|
678
679
|
f"Failed to execute #{i} slice: {slice.to_dict()}. {slice_err} {str(sys.exc_info()[0])} {str(sys.exc_info()[1])} {traceback.format_exc()}",
|
|
679
680
|
log_level=LogLevel.ERROR
|
|
680
681
|
)
|
|
682
|
+
raise slice_err
|
|
681
683
|
finally:
|
|
682
684
|
i += 1
|
|
683
685
|
|
|
@@ -698,6 +700,9 @@ async def execute_one_position(
|
|
|
698
700
|
|
|
699
701
|
position.done = True
|
|
700
702
|
|
|
703
|
+
log(f"Executions:")
|
|
704
|
+
log(f"{json.dumps(position.get_executions(), indent=4)}")
|
|
705
|
+
|
|
701
706
|
except Exception as position_execution_err:
|
|
702
707
|
position.done = False
|
|
703
708
|
position.execution_err = f"Execution failed: {position_execution_err} {str(sys.exc_info()[0])} {str(sys.exc_info()[1])} {traceback.format_exc()}"
|
|
@@ -12,7 +12,7 @@ from constants import JSON_SERIALIZABLE_TYPES
|
|
|
12
12
|
|
|
13
13
|
'''
|
|
14
14
|
set PYTHONPATH=%PYTHONPATH%;D:\dev\siglab\siglab_py
|
|
15
|
-
python test_ordergateway.py --gateway_id
|
|
15
|
+
python test_ordergateway.py --gateway_id hyperliquid_01
|
|
16
16
|
'''
|
|
17
17
|
|
|
18
18
|
param : Dict[str, str] = {
|
|
@@ -91,27 +91,28 @@ if __name__ == '__main__':
|
|
|
91
91
|
|
|
92
92
|
positions_3 : List[DivisiblePosition] = [
|
|
93
93
|
DivisiblePosition(
|
|
94
|
-
ticker = 'BTC/
|
|
94
|
+
ticker = 'BTC/USDC:USDC',
|
|
95
95
|
side = 'sell',
|
|
96
|
-
amount = 0.
|
|
96
|
+
amount = 0.00100,
|
|
97
97
|
leg_room_bps = 5,
|
|
98
|
-
reduce_only=
|
|
98
|
+
reduce_only=True,
|
|
99
99
|
order_type = 'limit',
|
|
100
100
|
slices=1,
|
|
101
|
-
wait_fill_threshold_ms=60000
|
|
101
|
+
wait_fill_threshold_ms=60000,
|
|
102
|
+
fees_ccy='USDC'
|
|
102
103
|
)
|
|
103
104
|
]
|
|
104
105
|
|
|
105
106
|
|
|
106
107
|
executed_positions : Union[Dict[JSON_SERIALIZABLE_TYPES, JSON_SERIALIZABLE_TYPES], None] = execute_positions(
|
|
107
108
|
redis_client=redis_client,
|
|
108
|
-
positions=
|
|
109
|
+
positions=positions_3,
|
|
109
110
|
ordergateway_pending_orders_topic=ordergateway_pending_orders_topic,
|
|
110
111
|
ordergateway_executions_topic=ordergateway_executions_topic
|
|
111
112
|
)
|
|
112
113
|
if executed_positions:
|
|
113
114
|
for position in executed_positions:
|
|
114
|
-
print(f"{position['ticker']} {position['side']} amount: {position['amount']} leg_room_bps: {position['leg_room_bps']} slices: {position['slices']}, filled_amount: {position['filled_amount']}, average_cost: {position['average_cost']}, # executions: {len(position['executions'])}") # type: ignore
|
|
115
|
+
print(f"{position['ticker']} {position['side']} amount: {position['amount']} leg_room_bps: {position['leg_room_bps']} slices: {position['slices']}, filled_amount: {position['filled_amount']}, average_cost: {position['average_cost']}, # executions: {len(position['executions'])}, done: {position['done']}, execution_err: {position['execution_err']}") # type: ignore
|
|
115
116
|
|
|
116
117
|
|
|
117
118
|
|
|
@@ -15,8 +15,8 @@ siglab_py/market_data_providers/test_provider.py,sha256=wBLCgcWjs7FGZJXWsNyn30lk
|
|
|
15
15
|
siglab_py/ordergateway/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
siglab_py/ordergateway/client.py,sha256=EwoVKxEcngIs8-b4MThPBdZfFIWJg1OFAKG9bwC5BYw,14826
|
|
17
17
|
siglab_py/ordergateway/encrypt_keys_util.py,sha256=-qi87db8To8Yf1WS1Q_Cp2Ya7ZqgWlRqSHfNXCM7wE4,1339
|
|
18
|
-
siglab_py/ordergateway/gateway.py,sha256
|
|
19
|
-
siglab_py/ordergateway/test_ordergateway.py,sha256=
|
|
18
|
+
siglab_py/ordergateway/gateway.py,sha256=-rDx0tD8vykKbsuS478fedODN0_5ZXe7OAsMYoXtfw8,39165
|
|
19
|
+
siglab_py/ordergateway/test_ordergateway.py,sha256=4PE2flp_soGcD3DrI7zJOzZndjkb6I5XaDrFNNq4Huo,4009
|
|
20
20
|
siglab_py/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
siglab_py/tests/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
siglab_py/tests/integration/market_data_util_tests.py,sha256=X0CiSMDfsafKcmjVKknA03vUUbMV0fAZweb3D01ikYI,7174
|
|
@@ -28,7 +28,7 @@ siglab_py/util/analytic_util.py,sha256=o9MNuOWUhw-r0id10Wjjd7a6rkL6-g3OmvajMSj1J
|
|
|
28
28
|
siglab_py/util/aws_util.py,sha256=KGmjHrr1rpnnxr33nXHNzTul4tvyyxl9p6gpwNv0Ygc,2557
|
|
29
29
|
siglab_py/util/market_data_util.py,sha256=hBZiFhko0NFf8A74mv9Qia-YYbjK4RuhzC9I6L353is,19033
|
|
30
30
|
siglab_py/util/retry_util.py,sha256=mxYuRFZRZoaQQjENcwPmxhxixtd1TFvbxIdPx4RwfRc,743
|
|
31
|
-
siglab_py-0.
|
|
32
|
-
siglab_py-0.
|
|
33
|
-
siglab_py-0.
|
|
34
|
-
siglab_py-0.
|
|
31
|
+
siglab_py-0.2.0.dist-info/METADATA,sha256=smtL3wpkrqAmHQC8wdHrA1nVWwejI8QHUdHpXGwOXGM,979
|
|
32
|
+
siglab_py-0.2.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
33
|
+
siglab_py-0.2.0.dist-info/top_level.txt,sha256=AbD4VR9OqmMOGlMJLkAVPGQMtUPIQv0t1BF5xmcLJSk,10
|
|
34
|
+
siglab_py-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|