Skip to content

Known gaps

slick-trader is under active development. This page lists stubs, half-wired paths and sharp edges found by reading the code at 0.10.0. Each item says what the code does and what that means for you. Anything not confirmed by reading the exact lines is left out.

Engine and startup

wait_for_brokers_ready does not wait

TradingEngine::wait_for_brokers_ready loops on while (!(timed_out = now < end)). The loop leaves after one pass unless the deadline has already passed, so waiting_time_out never delays anything. It also reads the control queue record without a null check, so a config with no brokers array dereferences a null pointer.

What it means: configure at least one broker. Do not rely on waiting_time_out to hold startup until slow brokers have registered.

web_service needs a strategies block

The web server is constructed with *strategy_manager_, and the strategy manager is only created when the config has a strategies key. A web_service block without strategies dereferences a null pointer. With strategies.enabled false there is no MANUAL strategy, so every POST /api/orders answers 404.

What it means: keep both blocks in the config, see Configuration.

StrategyManager::shutdown() is never called

The engine stops strategies through stop() but never calls shutdown(), so a strategy's on_shutdown hook does not run.

What it means: release resources in on_stop, not on_shutdown.

initialize() failures are ignored

StrategyManager::load_strategies ignores the return value of a strategy's initialize(). A strategy that refuses to start, such as OrderStacker with a bad config, is still added and its default subscriptions still go out.

Misleading log line

When the plugin folder has no plugins, the warning "No strategy plugins found in" prints the configs folder, not the plugins folder.

Reserved Python and Lua options

SLICK_TRADER_ENABLE_PYTHON_STRATEGY and SLICK_TRADER_ENABLE_LUA_STRATEGY only define SLICK_TRADER_PYTHON_SUPPORT and SLICK_TRADER_LUA_SUPPORT. Nothing reads either macro, so there is no script-based strategy support.

Debug logging needs a single-config Debug build

The DEBUG define, and with it the console log sink, is set only when CMAKE_BUILD_TYPE is Debug. A Visual Studio or other multi-config build does not set it.

Strategies and risk

Plugins load once and run unisolated

Strategy binaries are loaded when the engine starts and are never unloaded or rescanned. Only parameters change live. Plugins run in-process on the worker thread with no exception guard around dispatch, so a crash in a plugin takes the engine down. See Writing a strategy.

Several objects are shared across threads without locks

The web thread calls StrategyBase::submit_order, get_order, the start and stop helpers and the RiskManager setters directly, while the strategy worker thread touches the same maps. PositionTracker, PnLCalculator and RiskManager have no locks, and the comment in position_tracker.hpp that mentions a position_update_queue describes something that does not exist. A race has not been reproduced, but the code does not prevent one.

REST start and stop run on_start and on_stop on the web thread, and cancel_all_orders() there touches maps the worker owns.

What it means: treat dashboard actions during heavy strategy activity as unproven under ThreadSanitizer.

Risk checks have holes

  • Market orders skip the order-value check, because their price is NaN.
  • There is no quantity check, and a modify is not risk-checked.
  • The position-limit check ignores open working orders.
  • max_loss_per_strategy is checked once a second by the strategy manager and measures lifetime loss, not daily loss.
  • close_all_positions skips risk checks and sends IOC limits 10% through the mark. That rule is wrong for negative prices, and a position restored from the position store has no broker mapping, so it stays open.
  • A per-instrument entry under risk_limits.instruments defaults to 1,000,000 and 100,000, not to the strategy's own limits.
  • POST /api/strategies/:id/resume after a loss-limit halt re-halts within a second, because the loss check also runs on stopped strategies.
  • PUT /api/strategies/:id/risk, halts and strategy start and stop changes live in memory only.

See Positions, PnL and risk.

A rejected modify marks the live order REJECTED

StrategyBase::on_order_reject marks the order REJECTED even when the reject answers a modify, and the web server then drops it from /api/orders. The order may still be resting at the broker.

Example strategy config and comments

  • A PUT that changes instrument or broker on MarketMaker is not reflected in its subscriptions. Restart the engine for that.
  • In NLEVEL_WMID mode MarketMaker::on_quote also sets the fair value and the EMAs.
  • strategies/market_maker.json uses BTC/USD on Coinbase, where the product id is BTC-USD, and nlevel_depth 20, which is clamped to 10.
  • The header comments in market_maker.cpp and order_stacker.cpp list ALPACA as a broker, and the on_stop thread comment in order_stacker.cpp is out of date.

PENDING_CANCEL is never set

The status exists in the enum, but nothing in the engine assigns it.

Positions and PnL

avg_price goes stale after a FIFO close

PositionTracker does not recompute avg_price after a fill closes lots, so unrealized and total PnL are overstated until the position goes flat.

Fills without a fee cost nothing

set_fee_structure is only called in tests, and the call in trading_engine.cpp is commented out. A fill that arrives with no fee is booked at zero cost. IBroker::get_fees and the fee in the register event are unused, so MarketMaker's taker_fee_rate_ is always 0.

Restarts can book a fill twice

The position store drops replayed fills only for brokers that keep a fill journal. No in-tree broker does. Coinbase tracks cumulative fill state in memory, so after a restart a snapshot can book an order's whole cumulative fill again.

Endpoints value positions differently

GET /api/positions values a position with no mark against 0 and uses the mid. GET /api/pnl marks a long at the bid and a short at the ask.

Brokers

Hyperliquid order entry cannot connect

HyperliquidOrderConnector::private_key_ is read but never assigned. No code reads HYPERLIQUID_PRIVATE_KEY, although the error message names it. connect() always logs "Private key not set" and the order worker never starts.

What it means: Hyperliquid is market data only in this release.

Other Hyperliquid gaps

  • register_order_connector publishes BrokerId::COINBASE and a 0.005 fee, while get_fees says 0.0005. Only the log is affected.
  • on_user_fill sets remaining_quantity to 0, so a partial fill reads as FILLED.
  • abs(fee) turns a maker rebate into a cost.
  • BRACKET orders go out as plain limit orders.
  • A failed modify or cancel logs an error and publishes no event, so a modified order stays in PENDING_MODIFY.
  • unsubscribe removes the instrument from local lists only. The venue subscription stays open.
  • The register event does not copy shm_name.
  • Market data has no reconnect path, md_connected stays true after a drop, and subscribe_all() is never called.
  • Neither Hyperliquid connector has reconnect or resubscribe logic.
  • DAY throws and becomes a reject.

Coinbase gaps

  • unsubscribe unsubscribes LEVEL2 and ORDER_BOOK together.
  • DAY is rejected. GTD is mapped without an end time in the call.
  • There is no fill journal, so fills in flight at a crash are lost.
  • Market-by-order subscriptions are ignored with a warning.
  • Futures positions on the user channel are logged only.
  • Candle and status handlers are TODO.
  • The connectors memcpy 31 bytes from a std::string into the instrument name field, which over-reads a name shorter than 31 characters.

Connector keys differ

Market-data connectors read shm_name, order connectors read callback_shm_name, and Coinbase queue_size and control_size each feed two buffers with different defaults. See Configuration.

Web API and dashboard

No authentication

Neither REST nor WebSocket checks credentials or the Origin header. The server listens on every interface, because config_.host is only logged. CORS is * by default and the server ignores Content-Type, so a page on another site can place orders with a simple cross-site POST.

What it means: bind it to a trusted network or put an authenticating proxy in front. See REST API.

No OPTIONS route

There is no handler for OPTIONS, HEAD or PATCH, and a POST to an unknown path gets no reply. uWebSockets closes the connection, so a browser CORS preflight fails.

POST /api/orders validation

  • A limit order with no price passes validation, because the check price <= 0.0 is false for NaN, and it is queued with a null price.
  • quantity is never checked for sign.
  • Every order is submitted with post_only true except on CME and ICE. The Hyperliquid connector turns that into ALO whatever the time in force.
  • The response omits the generated client_order_id. Read it from GET /api/orders.

Persistence

  • PUT /api/ladder-config replaces the in-memory config before it parses default_qty, so a non-numeric value answers 400 but is already stored. It never persists, so the typed default quantity is lost on restart.
  • PUT /api/strategies/:id/config answers 200 even when persisting finds no file or fails. Only a log line says so.

Smaller points

  • POST /api/strategies/:id/halt and resume do not check that the strategy exists, and GET /api/pnl/:id returns zeros for an unknown id.
  • pnl_update is driven by top-of-book events only. A fill alone sends none.
  • A stale TODO: Implement actual strategy control comment sits above working code.
  • The browser policy helper and scripts/slick-trader-web.bat are Windows only.
  • The ladder hard-codes broker ids 5 and 6 as the CME and ICE grid brokers.
  • config/config_real.json (untracked) uses keys no code reads. Start from config/config_example.json.