John Colvin
0cb46fd8ab
cleanup: Remove unnecessary py_module.cpp files
...
We used to have separate modules for md and execution. I forgot
to remove these after unifying them to a single module.
2025-06-16 14:31:28 +00:00
John Colvin
c098b5e442
diag: Reduce book log noise in md plugins
...
They're too noisy for Info level.
2025-06-16 14:28:09 +00:00
John Colvin
dc8cd290b6
diag: Optimize logging in bybit exe gw plugin
...
* Format params as json (not python pseudo json)
* Format params lazily
2025-06-16 14:17:45 +00:00
John Colvin
17c77d9b31
fix: Use lock_guard instead of lock/unlock calls
...
I just noticed it was technically possible for the "work thread" (in py
plugin manager) to be started twice, due to improper lock/unlock calls.
2025-06-13 21:26:36 +00:00
John Colvin
2cf62d8d9a
Increase sleep time in bybit_md_provider keep-alive loop
...
This thread's only job is to stay alive until "stop" is called. It
doesn't need to be particularly fast/responsive. Longer sleep intervals
reduce contention with the "hot" thread that receives market data.
2025-06-13 20:50:30 +00:00
John Colvin
0328356758
diag: Add security to assert msg when qty tick deduction fails
2025-06-13 20:50:30 +00:00
John Colvin
0e1be3f559
deploy: Add alphaworx_zen_hk_live-preview configuration
2025-06-13 20:50:30 +00:00
John Colvin
f2d1364c4b
fix: Assert that acc name length < max_size (not size)
...
Since we changed the account field from std::array -> bts::core::SmallString
2025-06-13 20:50:30 +00:00
John Colvin
3d2043f926
deploy: Install python requirements in docker
...
No point in using a virtual environment. These containers have one
purpose: run sparkd with a constant, predetermined set of py plugins.
2025-06-13 20:50:30 +00:00
John Colvin
e525e740c1
chore: Update alphaworx_zen_hk_live init.py to query new secret
...
I decided to put all alphaworx api keys in one secret. It's easier this way.
2025-06-13 20:50:30 +00:00
John Colvin
0ef72a45fe
fix: Fix config dir env var in bybit_dev profile
2025-06-13 20:50:30 +00:00
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