Commit Graph
14074 Commits
Author SHA1 Message Date
John Colvin 2dec5812f6 dev qol: Add fn to make Stopwatch and start it at once 2025-06-09 05:58:37 +00:00
John Colvin 237f525263 chore: Use same log format as sparkd in py md plugins 2025-06-09 05:58:37 +00:00
John Colvin 8a5fcfbe04 improvement: Set PyBook data in single call to reduce interop overhead 2025-06-09 05:58:37 +00:00
John Colvin ccc8faf353 Reduce log noise in py md providers 2025-06-09 05:58:37 +00:00
John Colvin 4c983c6ec1 doc: Improve py md readme
* Put examples in a table
* Show command to create symlinks for intellisense
2025-06-09 05:58:37 +00:00
John Colvin e7ee1e02dd 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-09 05:54:10 +00:00
John Colvin de8edca010 build: Add lib_spark subdir first (all others depend on it) 2025-06-06 17:41:53 +00:00
John Colvin 63d5e70add dev qol: Add to_chrono fns to TimeSpan 2025-06-06 17:41:53 +00:00
John Colvin 5a77102bd2 dev qol: Add -> operators to ValueWrapper for convenience
So we can type "foo->" instead of "foo.value()" (much shorter!)
2025-06-06 17:41:53 +00:00
John Colvin ca1799fa68 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-06 17:41:53 +00:00
John Colvin caaac014ba chore: Add pybind11, pybind11-stubgen to py venv 2025-06-06 17:41:53 +00:00
John Colvin 716be146b9 improvement: Generate py stubs for md providers
Provides intellisense for the python_md_module
2025-06-06 17:41:53 +00:00
John Colvin a57d38951e cleanup: Get rid of unecessary namespace prefixes 2025-06-06 17:41:53 +00:00
John Colvin 99dccbf6d1 cleanup: Get rid of "PyList" classes, bind to stl vector instead
I wasn't aware this was possible until recently.
2025-06-06 17:41:53 +00:00
John Colvin 5f16e88bcf refactor: Move SimpleOrderKeyMap from binance_execution to lib_spark
It provides basic functionality that will be useful in other execution gateways.
2025-06-06 17:41:53 +00:00
John Colvin 092ac21fce chore: Add smart parse and pretty name fns for proto enums
Mainly to ease the pain of representing enums as strings in python md
and execution plugins
2025-06-06 17:41:53 +00:00
John Colvin 2cd75209d2 refactor: Move ErrorList from binance_execution to lib_spark
It provides basic functionality that will be useful elsewhere
2025-06-06 17:41:53 +00:00
John Colvin 9dc5de4bdb refactor: Use SmallString std::array in AccountName 2025-06-06 17:41:53 +00:00
John Colvin 34e7e1e01c refactor: Use SmallString instead of std::array in ExchangeOrderID 2025-06-06 17:41:53 +00:00
John Colvin f3d32dd918 Add our own "SmallString" class for fixed cap strings
This will replace the std::array<char, N> we use in ExecutionReport, etc.
among other things
2025-06-06 17:41:53 +00:00
John Colvin 83e3780964 refactor: Move ExecutionReportStore to lib_spark
From lib_binance_execution
2025-06-04 04:37:02 +00:00
Adeel Khan 5d9c7502c9 CLEANUP: BYBIT Symbols.conf. 2025-06-04 04:37:02 +00:00
Adeel Khan d47958e268 ADD: BYBIT MD Working, NaN's also Added. 2025-06-04 04:37:02 +00:00
Adeel Khan 11bb764a47 ADD: BYBIT Securities showing up on frontend. Default Contract Spec 2025-06-04 04:37:02 +00:00
Adeel Khan 92f8167477 ADD: GATEIO md_provider with dynamic contract specs using Batch REST call 2025-06-04 04:37:02 +00:00
Adeel Khan 99f89ce965 ADD: GATEIO md_provider with dynamic contract specs 1 REST call per Contract 2025-06-04 04:37:02 +00:00
Adeel Khan 598078ce06 ADD: GATEIO md_provider with default contract specs 2025-06-04 04:37:02 +00:00
John Colvin d5ea5a9778 Add gateio_dev config profile for Adeel 2025-06-04 04:37:02 +00:00
John Colvin c3cf785f10 cleanup: Remove unused spark.conf file
Originally, this spark.conf was hardcoded into compose.yaml, and copied
into the sparkd container on each deploy. It hasn't been used since
config profiles were introduced.
2025-06-04 04:37:02 +00:00
John Colvin 569e0ed974 Add py_dummy_md config profile to test py md plugin 2025-06-04 04:37:02 +00:00
John Colvin c9eaa8af5d deploy: Move configurations to new stutter dir "app_sparkd" 2025-06-04 04:37:02 +00:00
John Colvin 679ea671c9 Add protos for gateio 2025-06-04 04:37:02 +00:00
John Colvin a245bc8610 Add protos for bybit 2025-06-04 04:37:02 +00:00
John Colvin c2362e2cd6 build: Move onix fix adapter to its own lib
We should keep order execution dependencies out of lib_spark.
2025-06-04 04:37:02 +00:00
John Colvin ddf99576af fix build: Move OnixsUtils to from lib_spark to app_sparkd
They're only needed MDP3Main.cpp and ICEMain.cpp. We're one step closer
to removing lib_spark's dependency on onixs.
2025-06-04 04:37:02 +00:00
John Colvin b8ba48c905 cleanup: Remove unnecessary onixs include from TrafixOrderStateHandler.h 2025-06-04 04:37:02 +00:00
John Colvin 0a3b8ca793 feat: Support python md plugins 2025-06-04 04:37:02 +00:00
John Colvin 82b8224416 Add "clear" fn to Book & BookSide
Prelude to python market data bindings
2025-06-04 04:37:02 +00:00
John Colvin 1849d875b1 Add "smart" parse fns for a couple proto enums
Prelude to python market data bindings. Unlike the normal parse fns, the
"smart" variants aren't case sensitive, and can match strings with or
without TYPE_NAME_ prefixes.
2025-06-04 04:37:02 +00:00
John Colvin c03f0fcf0e build: Move okx execution to its own lib 2025-06-04 04:37:02 +00:00
John Colvin 66718ed77e cleanup: Remove unnecessary onixs include from IDGenerator.h 2025-06-04 04:37:02 +00:00
John Colvin 6952821753 cleanup: Remove unnecessary includes from MDP3Listener.h 2025-06-04 04:37:01 +00:00
John Colvin ecbad48ea4 refactor: Organize libspark proj w/ stuttering include
This new structure provides several benefits:

* Allows us to install multiple CMake projects in the same destination
  dir (without include path conflicts).
  - This makes shipping the trading algo sdk a trivial excercise. Simply
    copy the lib and include dirs from the install dest. That's it!
* Puts us in a position to break up the monolithic libspark into smaller
  modules, which are easier to manage.

Windows specific notes:

* Get rid of unnecessary script vs_filters.cmake
* Define WebsocketConnectionGateway directly in cs (instead of proto)
  - The proto would no longer be in the include path passed to protoc.
    Moving it to c# because there wasn't a compelling reason for it to
    be a proto in the first place.
* Set spark output prefix to "lib" on windows
  - So we get "libspark.dll" instead of "spark.dll", which conflicts
    with the csharp lib, "Spark.dll".
* Copy libspark.dll to net8.0 & net8.0-windows in a single cmake build
  target

fix build: Copy libspark to both dirs net8.0, net8.0-windows
2025-06-04 04:37:01 +00:00
John Colvin ff6ed83e80 cleanup: Move TradeSummarySignalDispatcher to libspark
It is needed by TradeSummarySignal, which is in libspark. This prevents a
circular dependency from libspark -> sparkd.
2025-06-04 04:37:01 +00:00
John Colvin 116e4d3800 build: Clean up protobuf cmake scripts
Make them more flexible, reusable. This is a precursor to porting over
python md provider code from another branch.
2025-06-04 04:37:01 +00:00
John Colvin a6b6c1168d build: Rename external path vars w/ "EXTERNAL_" prefix in cmake
The old "SPARK_" prefix felt like a misnomer.
2025-06-04 04:37:01 +00:00
John Colvin 41be74d690 Add a few arithmetic ops to TimeSpan 2025-06-04 04:37:01 +00:00
John Colvin 661977a3ba diag: Log time it takes to start md sources
So we can detect bottlenecks
2025-06-04 04:37:01 +00:00
John Colvin ffc7dc132e refactor: Split MarketDataGateway up into providers/sources
MarketDataGateway still exists, but is greatly simplified. It creates
several `IMarketDataProvider`s, each of which generates a list of
`IMarketDataSource`s. The market data sources provide market data to an
`IMarketDataListener`.

* EmumbaMarketDataProvider
* CCApiMarketDataProvider
* PyMarketDataProvider
* OnixsMarketDataProvider
* ReplayMarketDataProvider

As a side effect, individual py market data sources are now explicitly
limited to a single venue (it probably should have been this way all
along, since the shared memory writers do not expect updates to involve
multiple venues).
2025-06-04 04:37:01 +00:00
John Colvin 248dc2e5b6 cleanup: Remove dependency on quickfix for string to_lower
We shouldn't depend on external libs for trivial things like converting
strings to lower case.
2025-06-04 04:36:53 +00:00