John Colvin
db5dbd3666
fix: Fix SmallString numeric parsing, make more robust
...
* Fix by parsing numbers from left to right instead of right to left
(previously, would parse "17" to 71)
* Support leading +/- signs
* Throw if unexpected char encountered
* Unit tests
2025-06-13 20:50:30 +00:00
John Colvin
ca27dd3329
fix: Change thread_id type to size_t (not int64_t)
2025-06-13 20:50:30 +00:00
John Colvin
37b34ec6f7
cleanup: Remove unnecessary signal handler in bybit_md_provider.py
...
We handle them properly in sparkd now
2025-06-13 20:50:30 +00:00
John Colvin
f869c97fbe
cleanup: Sort gateio symbols in symbols.conf
2025-06-13 20:50:30 +00:00
John Colvin
a27462b1a3
chore: Add config json for py plugins
...
Support overrides per venue in a separate file, so symbols can be
changed after deployment using arham's widget.
2025-06-13 20:50:30 +00:00
John Colvin
8e9abf8451
fix: Init shared_ptr w/ default obj (not null)
...
Prob a typo
2025-06-13 20:50:30 +00:00
John Colvin
1b40382d56
chore: Fix path in .env file (server/sparkd -> app_sparkd)
2025-06-13 20:50:30 +00:00
John Colvin
402d9f5b84
fix build: Remove include of non-existent header
...
I created the file locally, but ended up not using it and forgot to remove an
include before I pushed.
2025-06-13 20:50:30 +00:00
John Colvin
20779387eb
fix build: Always return value in non-void fn
2025-06-13 20:50:30 +00:00
John Colvin
7a6bba0f19
fix: Don't compare size_t to -1 in SmallString num parsers
2025-06-13 20:50:30 +00:00
John Colvin
83dc93aeb1
refactor: Manage all py plugins (md and exe) in one class
...
All calls to/from python are performed on one thread via a simple
message queue (necessary because of the global interpreter lock).
2025-06-13 20:50:30 +00:00
John Colvin
6107bbdb5d
chore: Add pybit to py venv
2025-06-13 20:50:30 +00:00
John Colvin
71f95f8774
diag: Log incoming books at Info level in bybit_md_provider
2025-06-13 20:50:30 +00:00
John Colvin
4108ee087e
chore: Add bybit execution config to bybit_dev profile
2025-06-13 20:50:30 +00:00
John Colvin
e30bf5cdea
chore: Add numpy to py venv
...
This is needed for md plugins
2025-06-13 20:50:30 +00:00
John Colvin
dce77049b1
fix: Include fill id in format str for ExecutionReport
2025-06-13 20:50:30 +00:00
John Colvin
72ef4f33b0
dev qol: Bind PySecurity __format__ to fmt::formatter impl
2025-06-13 20:50:30 +00:00
John Colvin
a7176f7851
refactor: Change floats to doubles in py bridge types
...
Getting rounding errors with floats
2025-06-13 20:50:30 +00:00
John Colvin
1a0f3197ce
refactor: Use SmallString instead of std::array in ExchangeFillID
2025-06-13 20:50:30 +00:00
John Colvin
e34c2ffec7
Add py bybit exe config to bybit_dev profile
2025-06-13 20:50:30 +00:00
John Colvin
8a10b591ed
refactor: Consolidate all py interop into single lib
...
It was just too hard trying to make it work with separate libs. The
main issue was getting the python md and execution modules to
recognize PySecurityList and other types defined in the core module.
2025-06-13 20:50:30 +00:00
John Colvin
efc2100177
refactor: Move tick fns into gen-purpose tick_utils.h
2025-06-13 20:50:30 +00:00
John Colvin
a4d57cc97c
Change bybit_dev symbols.conf to list bybit futs (not spots)
2025-06-13 20:50:30 +00:00
John Colvin
3426702d8f
fix: Actually use configured logger in bybit_md_provider.py
2025-06-13 20:50:30 +00:00
John Colvin
8e7a24c971
dev qol: Reduce noisy logs in PositionServicePNLHelper
2025-06-13 20:50:30 +00:00
John Colvin
475dda4e9e
build: Add cmake script to sym link py module and plugins
...
We have several of these (python_core, python_md, python_execution),
so the repetative boilerplate code was starting to pile up.
2025-06-13 20:50:30 +00:00
John Colvin
193f3380cb
deploy: Install/activate py venv in sparkd container
2025-06-13 20:50:29 +00:00
John Colvin
d6ac2c5134
dev qol: Add pyrightconfig.json for type hints in py/c++ bridge
2025-06-13 20:50:29 +00:00
John Colvin
076513e79b
Tweak py to get rid of false positive type hint warns
2025-06-13 20:50:29 +00:00
John Colvin
b227fc6254
feat: Support python execution plugins
2025-06-13 20:50:29 +00:00
John Colvin
ca82042669
refactor: Move py security (and related types) to python_core lib
...
So the execution gw plugins can use it (as well as the md plugins).
2025-06-13 20:50:29 +00:00
John Colvin
ec7c0de946
fix: Add missing switch cases for bybit & gateio
2025-06-13 20:50:29 +00:00
John Colvin
391580b9da
fix: Initialize bybit secs as perp futs (not spots)
2025-06-13 20:50:29 +00:00
John Colvin
7e7e185968
dev qol: Add wait/notify functionality to ConcurrentQueue
2025-06-13 20:50:29 +00:00
John Colvin
517e64ceff
chore: Add CANCEL_ORDER op to binance.env
2025-06-13 20:50:29 +00:00
John Colvin
7df9a15d3b
dev qol: Add ConcurrentValueStore, with notify/wait functionality
...
Uses std::condition_variable
2025-06-13 20:50:29 +00:00
John Colvin
b01f36d263
fix: Don't raise ex if var isn't defined in req path
2025-06-13 20:50:29 +00:00
John Colvin
36e555cd13
dev qol: Add gen-purpose validation fns for execution gws
2025-06-13 20:50:29 +00:00
John Colvin
3d0d1c6dba
build: Use new gen-purpose python cmake fns in py md proj
...
Significantly simplifies CMakeLists.txt
2025-06-13 20:50:29 +00:00
John Colvin
f03a055c34
build: Add gen-purpose InitPythonModule, InitPythonPlugin cmake scripts
2025-06-13 20:50:29 +00:00
John Colvin
bfeb5e362a
dev qol: Add fn to make Stopwatch and start it at once
2025-06-13 20:50:29 +00:00
John Colvin
e48f2ec99d
chore: Use same log format as sparkd in py md plugins
2025-06-13 20:50:29 +00:00
John Colvin
cec62215e2
improvement: Set PyBook data in single call to reduce interop overhead
2025-06-13 20:50:29 +00:00
John Colvin
e361d405c9
Reduce log noise in py md providers
2025-06-13 20:50:29 +00:00
John Colvin
020cd44cf3
doc: Improve py md readme
...
* Put examples in a table
* Show command to create symlinks for intellisense
2025-06-13 20:50:29 +00:00
John Colvin
c02f3d152a
refactor: Redesign py md so it doesn't lock the global interpreter
...
We can only embed one interpreter in the sparkd process, so all py
plugins need to share it.
* Move core py interop code to new lib_python_core. We're about to add a
new lib for py execution, so it needs to be accesible from both
execution and md libs
* Fix typo for type hint in py_md_utils.py
* Run py md providers on background thread
* Rename MdSink -> MdBridge
2025-06-13 20:50:29 +00:00
John Colvin
b4b9e00f90
build: Add lib_spark subdir first (all others depend on it)
2025-06-13 20:50:29 +00:00
John Colvin
8f886008ef
dev qol: Add to_chrono fns to TimeSpan
2025-06-13 20:50:29 +00:00
John Colvin
23e4dbfa07
dev qol: Add -> operators to ValueWrapper for convenience
...
So we can type "foo->" instead of "foo.value()" (much shorter!)
2025-06-13 20:50:29 +00:00
John Colvin
114ac2fdc9
build: Link against system installed ssl to support py interop
...
Unless we want to build python packages ourselves, the underlying clibs
they use link to the system installed ssl. Notably, the requests module.
2025-06-13 20:50:29 +00:00