unified-trading-execution 0.0.1__tar.gz
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.
- unified_trading_execution-0.0.1/PKG-INFO +12 -0
- unified_trading_execution-0.0.1/pyproject.toml +22 -0
- unified_trading_execution-0.0.1/setup.cfg +4 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/__init__.py +10 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/_public.py +151 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/adapter/__init__.py +556 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/dispatch/__init__.py +386 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/engine.py +1635 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/errors/__init__.py +144 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/events/__init__.py +266 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/history/__init__.py +129 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/logging/__init__.py +3 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/py.typed +1 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/registry.py +7 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/risk/__init__.py +338 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/state/__init__.py +24 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/state/halt.py +196 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/state/migrations/__init__.py +1 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/state/reconciliation.py +194 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/state/store.py +1672 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/sync/__init__.py +392 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/testing/__init__.py +938 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/trailing/__init__.py +45 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/trailing/manager.py +2925 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/trailing/math.py +274 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/trailing/types.py +352 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/trailing/worker.py +284 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/types/__init__.py +57 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/types/enums.py +103 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/types/instrument.py +115 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/types/market_data.py +56 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/types/order.py +204 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/types/position.py +64 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution/types/utils.py +14 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution.egg-info/PKG-INFO +12 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution.egg-info/SOURCES.txt +37 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution.egg-info/dependency_links.txt +1 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution.egg-info/requires.txt +6 -0
- unified_trading_execution-0.0.1/src/unified_trading_execution.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: unified-trading-execution
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Unified Trading Execution — core library (platform-agnostic types, dispatch, risk checks, state mirror)
|
|
5
|
+
Author: Syed Qaisar Jalil
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: aiosqlite>=0.20
|
|
9
|
+
Requires-Dist: uuid7>=0.1
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
12
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "unified-trading-execution"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "Unified Trading Execution — core library (platform-agnostic types, dispatch, risk checks, state mirror)"
|
|
5
|
+
requires-python = ">=3.11"
|
|
6
|
+
license = {text = "Apache-2.0"}
|
|
7
|
+
authors = [
|
|
8
|
+
{name = "Syed Qaisar Jalil"},
|
|
9
|
+
]
|
|
10
|
+
dependencies = [
|
|
11
|
+
"aiosqlite>=0.20",
|
|
12
|
+
"uuid7>=0.1", # uuid.uuid7() backport for Python 3.11–3.13 (stdlib in 3.14+)
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
[project.optional-dependencies]
|
|
16
|
+
dev = [
|
|
17
|
+
"pytest>=8.0",
|
|
18
|
+
"pytest-asyncio>=0.24",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[tool.setuptools.packages.find]
|
|
22
|
+
where = ["src"]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Namespace package (pkgutil-style) — enables multiple independently-installable
|
|
2
|
+
# packages to contribute modules under a single unified_trading_execution namespace.
|
|
3
|
+
from pkgutil import extend_path
|
|
4
|
+
|
|
5
|
+
__path__ = extend_path(__path__, __name__)
|
|
6
|
+
|
|
7
|
+
# Every distribution ships this file, so the copy pip leaves in place must
|
|
8
|
+
# restore the core public surface. Adapter copies run the same two imports.
|
|
9
|
+
from unified_trading_execution._public import * # noqa: F403
|
|
10
|
+
from unified_trading_execution._public import __all__ as __all__
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Core public surface re-exported by the shared namespace ``__init__``.
|
|
2
|
+
|
|
3
|
+
This module exists because every distribution ships its own copy of
|
|
4
|
+
``unified_trading_execution/__init__.py``. Whichever copy pip installs last
|
|
5
|
+
wins, so each one reapplies this module's star import instead of repeating the
|
|
6
|
+
symbol list; otherwise installing an adapter after the core package would drop
|
|
7
|
+
the core top-level re-exports.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from unified_trading_execution.adapter import Adapter, RateLimits
|
|
11
|
+
from unified_trading_execution.engine import Engine
|
|
12
|
+
from unified_trading_execution.errors import (
|
|
13
|
+
AccountChangedError,
|
|
14
|
+
AccountHaltedError,
|
|
15
|
+
ConnectionError,
|
|
16
|
+
DuplicateOrderIdError,
|
|
17
|
+
EngineShutdownError,
|
|
18
|
+
InstrumentHaltedError,
|
|
19
|
+
InsufficientBalanceError,
|
|
20
|
+
InvalidSymbolError,
|
|
21
|
+
MarketClosedError,
|
|
22
|
+
OrderNotFoundError,
|
|
23
|
+
PlatformConnectionError,
|
|
24
|
+
PlatformError,
|
|
25
|
+
RateLimitError,
|
|
26
|
+
ReconciliationError,
|
|
27
|
+
TrailingNotSupportedError,
|
|
28
|
+
TrailingStateError,
|
|
29
|
+
UnsupportedOrderTypeError,
|
|
30
|
+
)
|
|
31
|
+
from unified_trading_execution.events import (
|
|
32
|
+
AccountChangedEvent,
|
|
33
|
+
AuditEvent,
|
|
34
|
+
BalanceUpdateEvent,
|
|
35
|
+
ConnectionStateEvent,
|
|
36
|
+
Event,
|
|
37
|
+
EventBus,
|
|
38
|
+
FillEvent,
|
|
39
|
+
HaltClearedEvent,
|
|
40
|
+
HaltEnteredEvent,
|
|
41
|
+
HaltEvent,
|
|
42
|
+
OrderCancelledEvent,
|
|
43
|
+
OrderModifiedEvent,
|
|
44
|
+
OrderPlacedEvent,
|
|
45
|
+
PositionUpdateEvent,
|
|
46
|
+
ReconciliationCompleteEvent,
|
|
47
|
+
ReconciliationEvent,
|
|
48
|
+
ReconciliationMismatch,
|
|
49
|
+
TickerEvent,
|
|
50
|
+
TrailingStateEvent,
|
|
51
|
+
)
|
|
52
|
+
from unified_trading_execution.state import SQLiteStateStore, StateStore
|
|
53
|
+
from unified_trading_execution.sync import SyncEngine
|
|
54
|
+
from unified_trading_execution.types import (
|
|
55
|
+
LIVE_ORDER_STATUSES,
|
|
56
|
+
# Enums
|
|
57
|
+
AssetClass,
|
|
58
|
+
# Data types
|
|
59
|
+
Balance,
|
|
60
|
+
FillEntry,
|
|
61
|
+
FillReason,
|
|
62
|
+
FillRecord,
|
|
63
|
+
HaltClearMode,
|
|
64
|
+
HaltState,
|
|
65
|
+
Instrument,
|
|
66
|
+
InstrumentSpec,
|
|
67
|
+
OptionRight,
|
|
68
|
+
OrderModification,
|
|
69
|
+
OrderRecord,
|
|
70
|
+
OrderResult,
|
|
71
|
+
OrderSide,
|
|
72
|
+
OrderStatus,
|
|
73
|
+
OrderType,
|
|
74
|
+
Position,
|
|
75
|
+
TimeInForce,
|
|
76
|
+
TpSlAttachment,
|
|
77
|
+
UnifiedOrder,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
__all__ = [ # noqa: RUF022
|
|
81
|
+
# Enums
|
|
82
|
+
"AssetClass",
|
|
83
|
+
"FillEntry",
|
|
84
|
+
"FillReason",
|
|
85
|
+
"HaltClearMode",
|
|
86
|
+
"HaltState",
|
|
87
|
+
"LIVE_ORDER_STATUSES",
|
|
88
|
+
"OptionRight",
|
|
89
|
+
"OrderSide",
|
|
90
|
+
"OrderStatus",
|
|
91
|
+
"OrderType",
|
|
92
|
+
"TimeInForce",
|
|
93
|
+
# Data types
|
|
94
|
+
"Balance",
|
|
95
|
+
"FillRecord",
|
|
96
|
+
"Instrument",
|
|
97
|
+
"InstrumentSpec",
|
|
98
|
+
"OrderModification",
|
|
99
|
+
"OrderRecord",
|
|
100
|
+
"OrderResult",
|
|
101
|
+
"Position",
|
|
102
|
+
"RateLimits",
|
|
103
|
+
"TpSlAttachment",
|
|
104
|
+
"UnifiedOrder",
|
|
105
|
+
# Engine (async and sync)
|
|
106
|
+
"Engine",
|
|
107
|
+
"SyncEngine",
|
|
108
|
+
# ABCs + default implementations
|
|
109
|
+
"Adapter",
|
|
110
|
+
"SQLiteStateStore",
|
|
111
|
+
"StateStore",
|
|
112
|
+
# Event bus
|
|
113
|
+
"Event",
|
|
114
|
+
"EventBus",
|
|
115
|
+
"FillEvent",
|
|
116
|
+
"PositionUpdateEvent",
|
|
117
|
+
"BalanceUpdateEvent",
|
|
118
|
+
"ConnectionStateEvent",
|
|
119
|
+
"AccountChangedEvent",
|
|
120
|
+
"OrderPlacedEvent",
|
|
121
|
+
"OrderModifiedEvent",
|
|
122
|
+
"OrderCancelledEvent",
|
|
123
|
+
"TickerEvent",
|
|
124
|
+
"TrailingStateEvent",
|
|
125
|
+
"ReconciliationCompleteEvent",
|
|
126
|
+
"ReconciliationEvent",
|
|
127
|
+
"ReconciliationMismatch",
|
|
128
|
+
"HaltEnteredEvent",
|
|
129
|
+
"HaltClearedEvent",
|
|
130
|
+
"HaltEvent",
|
|
131
|
+
# Errors
|
|
132
|
+
"AccountChangedError",
|
|
133
|
+
"AccountHaltedError",
|
|
134
|
+
"ConnectionError",
|
|
135
|
+
"PlatformConnectionError",
|
|
136
|
+
"DuplicateOrderIdError",
|
|
137
|
+
"EngineShutdownError",
|
|
138
|
+
"InstrumentHaltedError",
|
|
139
|
+
"InsufficientBalanceError",
|
|
140
|
+
"InvalidSymbolError",
|
|
141
|
+
"MarketClosedError",
|
|
142
|
+
"OrderNotFoundError",
|
|
143
|
+
"PlatformError",
|
|
144
|
+
"RateLimitError",
|
|
145
|
+
"ReconciliationError",
|
|
146
|
+
"TrailingNotSupportedError",
|
|
147
|
+
"TrailingStateError",
|
|
148
|
+
"UnsupportedOrderTypeError",
|
|
149
|
+
# Audit
|
|
150
|
+
"AuditEvent",
|
|
151
|
+
]
|