Repository navigation
Releases: SlickQuant/slick-trader
Releases · SlickQuant/slick-trader
Release list
Release v0.1.0
Changes
First release.
Added
Engine
- Lock-free messaging core. Broker connectors, the strategy manager and the web server exchange
events and requests through slick-queue rings multiplexed by astream_buffer_multiplexer, with
no mutex on the path between them. - Single-writer trading state.
StrategyManageris the only thread that writes
PositionTracker,PnLCalculatorandRiskManager. It dispatches market data and order events
to every strategy and forwards each order request to its broker's order connector alone. TradingEnginereads one JSON config and owns the lifecycle of the brokers, the strategies and
the web server. It shuts down on SIGINT/SIGTERM.
Brokers
- Coinbase Advanced Trade (market data and order entry) and Hyperliquid (market data;
order entry needs a wallet key wired in). Each broker is a market data connector and an order
connector, each on its own thread, behindIBroker. - Brokers register themselves by name.
SLICK_TRADER_REGISTER_BROKER("name", Type)puts a
broker inBrokerRegistry, and abrokers[]config entry names the one it wants. An entry naming
no broker in the binary stops startup with the list of those it carries. A broker whose
constructor throws is reported, not left to terminate the process. - Out-of-tree brokers.
-DSLICK_TRADER_EXTERNAL_BROKERS=<dir>[;<dir>...]builds brokers kept in
their own repositories into the binary. Each callsslick_trader_add_broker()as an in-tree
broker does, and itsTESTSare compiled intoslick-trader-tests. Configure prints each one,
with the version its ownproject()declares. BrokerStatusRegistry: each broker's market data and order connectors' enabled and connected
state, lock-free.StrategyBase::submit_orderchecks it before queueing an order, and the
dashboard shows it.
Strategies
- Strategy plugins. A strategy is a shared library (
.dll/.so) thatStrategyLoaderloads at
startup and matches to a*.config.jsonby name. The host injects its logger and
BrokerStatusRegistryinto every plugin. StrategyBase: order submission, modification and cancellation with pre-trade risk and broker
connectivity checks; order-state tracking (get_order,get_open_orders,
close_all_positions); and FIFO position tracking on fills. Order events are broadcast to
every strategy, and each takes its own by the<strategy-name>_prefix onclient_order_id.
An order a broker restates after a reconnect or a restart is taken up by that prefix, and so is
a fill for an order the strategy no longer tracks.- Strategy parameters can be changed at runtime from the dashboard, through the event bus.
- Reference plugins: MarketMaker (fair value, inventory skew, trend detection, book-imbalance
adjustment, post-only quoting) and OrderStacker (a two-sided ladder of resting orders, driven
by slick-stacker). ManualStrategyowns the orders placed by hand from the dashboard.
Market data
- Trades, quotes, level 2 updates and order books, as subscribed per instrument.
- Market-by-order books and queue position. A strategy subscribed
SubscriptionType::MBOis
handed the instrument's order-by-order book (on_order_book_l3), andqueue_position()says how
many orders, and how much quantity, stand ahead of one of its own orders. InstrumentDefinitionEvent: each instrument's tick size and contract multiplier, as its broker
defines it.InstrumentStatusEvent: an instrument's trading state - pre-open, open, halted, closed - handed to
strategies throughon_instrument_status.
Positions, PnL and risk
- FIFO-lot positions with realized and unrealized PnL, and fees from the fill or from the broker's
fallbackFeeStructure(FeeType::PER_UNITfor per-contract fees). - Futures accounting. A per-instrument contract multiplier scales PnL and order-value risk
checks. ADAYtime in force, and zero and negative prices (calendar spreads), are supported. - Multi-leg fills. A fill of an order for a multi-leg instrument comes as the order's own fill
(FillScope::ORDER) followed by one fill per leg (FillScope::LEG): the order moves at the
spread's price, and the positions booked are the legs'. - Pre-trade risk: position limits, order-value limits, per-second rate limits, and loss limits that
halt a strategy. - Positions across restarts. With
position_storeconfigured, every position and its open lots
is kept in a memory-mapped file: recording a fill is a copy into memory, a process killed
mid-update leaves the position as it was, and a restart carries on with what was held. - Fill journal replay. A broker that journals its fills (
OrderFillEvent::journal_seq) replays
them at startup. The position store keeps how far into each broker's journal the strategies had
got, so a fill they had is dropped and one still on its way when the process died is booked
once. A fill can carry its contract multiplier (OrderFillEvent::contract_multiplier), which
values a replayed fill before the instrument's definition arrives.
Web dashboard
- A vanilla-JS dashboard served by uWebSockets: positions, PnL, orders and broker status pushed
over WebSocket, PnL at most four times a second as the top of book moves. - REST API for health, brokers, strategies, positions, PnL and orders, strategy control (start,
stop, halt, resume), risk limits and parameters, and the ladder configuration. - A price ladder for click-to-trade manual orders.
Build
- C++23, CMake 3.28 or later, on Windows (MSVC), Linux (GCC 14) and macOS (Apple clang).
Dependencies are used as installed packages when found and fetched otherwise; uWebSockets and
nlohmann_json come from vcpkg. SLICK_TRADER_SANITIZERbuilds with ASan and UBSan (address,undefined) or TSan (thread).slick-trader-tests, a GTest regression suite, run by CI on all three platforms and under ASan,
UBSan and TSan on Linux. Each release
attaches a ready-to-run package for each: the engine, the strategy plugins, the dashboard and
the sample config.