MarketDeck docs
daemon
Start, stop, query, and stream from the long-running marketdeck daemon — push-style feeds for plugins.
The daemon is a tiny long-running process that owns the WebSocket-driven feeds plugins need: live mids, webData2, the real-trailing tick loop, the cross-process status feed, and the HTTP log stream. It is intentionally not an RPC bus for business operations — those stay subprocess calls. See Architecture for why.
Usage#
marketdeck daemon <subcommand> [flags]
Subcommands#
| Subcommand | What it does | |
|---|---|---|
| `start [--foreground | --background]` | Spawn the daemon. Background detaches and writes a pid file. |
stop | Send SIGTERM. Waits up to 5 s for a clean shutdown. | |
status | PID, uptime, per-channel + per-method stats. | |
attach [--channel mids,status] [--duration N] | Stream events for the given channels. | |
call <method> [--params JSON] | One-shot admin/feed-control method. |
Examples#
marketdeck daemon start --background
marketdeck daemon status --format text
marketdeck daemon attach --channel mids --duration 30
marketdeck daemon attach --channel realTrailing
marketdeck daemon call getMid --params '{"coin":"BTC"}' --format text
marketdeck daemon call midsStatus
marketdeck daemon stop
Channels#
| Channel | What flows through |
|---|---|
mids | Hyperliquid mid-price deltas — only changed coins per frame. |
mids-bybit / mids-aster | Per-exchange mid-price deltas for favorited symbols. |
favorites | Favorite-market change notifications so mids relays can resubscribe. |
paperTick | Paper-trading evaluator events. |
webData2 | Per-wallet webData2 frames; subscribers register addresses via subscribeWebData2. |
status | Cross-feed health summary. |
http-log | Live tail of the HTTP request log. |
realTrailing | Trailing-stop ratchet / failure events. |
Methods#
Built-in: ping, subscribe, unsubscribe, channels, methods.
Feed methods (registered by their feeds at boot):
| Method | What it returns |
|---|---|
getMid | {coin, mid}. |
getAllMids | {coin: priceStr} map. |
subscribeDex | Open a builder-dex channel on the live mids stream. |
midsStatus | Connection state + known-coin count. |
getBybitMid / getAsterMid | One symbol from the per-exchange mid cache. |
getAllBybitMids / getAllAsterMids | Full per-exchange mid cache. |
bybitMidsStatus / asterMidsStatus | Per-exchange mids feed state. |
subscribeWebData2 | Add an address to the multiplexed webData2 stream. |
realTrailingStatus | Trail loop counters + last-tick timestamp. |
realTrailingTickNow | Force one trail evaluation out-of-band. |
Business reads and writes are intentionally absent. Use the CLI instead, for example marketdeck positions all --format json, marketdeck wallets state <wallet> --format json, or marketdeck paper close ... --format json.
Socket#
The default Unix socket lives at ~/.cache/marketdeck/daemon.sock. Plugins connect there using the same NDJSON framing the CLI uses.