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#

SubcommandWhat it does
`start [--foreground--background]`Spawn the daemon. Background detaches and writes a pid file.
stopSend SIGTERM. Waits up to 5 s for a clean shutdown.
statusPID, 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#

ChannelWhat flows through
midsHyperliquid mid-price deltas — only changed coins per frame.
mids-bybit / mids-asterPer-exchange mid-price deltas for favorited symbols.
favoritesFavorite-market change notifications so mids relays can resubscribe.
paperTickPaper-trading evaluator events.
webData2Per-wallet webData2 frames; subscribers register addresses via subscribeWebData2.
statusCross-feed health summary.
http-logLive tail of the HTTP request log.
realTrailingTrailing-stop ratchet / failure events.

Methods#

Built-in: ping, subscribe, unsubscribe, channels, methods.

Feed methods (registered by their feeds at boot):

MethodWhat it returns
getMid{coin, mid}.
getAllMids{coin: priceStr} map.
subscribeDexOpen a builder-dex channel on the live mids stream.
midsStatusConnection state + known-coin count.
getBybitMid / getAsterMidOne symbol from the per-exchange mid cache.
getAllBybitMids / getAllAsterMidsFull per-exchange mid cache.
bybitMidsStatus / asterMidsStatusPer-exchange mids feed state.
subscribeWebData2Add an address to the multiplexed webData2 stream.
realTrailingStatusTrail loop counters + last-tick timestamp.
realTrailingTickNowForce 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.