Trading Bot Suite

Autonomous market-making bots that keep your internal exchange pairs alive with continuous depth and trade volume

What the Trading Bot Does

The Trading Bot Suite runs autonomous market-making bots on the pairs you configure. Every tick it places a ladder of 20–30 orders around a target price, mixes in micro-fills and occasional refresh ticks, and produces a realistic trade tape — so your exchange looks busy and your orderbook stays deep even when real users are sparse.

🤖 Core Bot Features

  • Ladder Orderbook: 20–30 layered orders per side around a target price every tick
  • Weighted-Random Actions: mix of refresh, micro-fill, trade-only, and depth-pad ticks for a realistic tape
  • Per-Pair Configuration: frequency, ladder levels, spread, daily volume cap, schedule window
  • External Heartbeat Daemon: Node.js worker drives ticks over a signed REST endpoint
  • Signed tick requests: the daemon signs every request so only your install will accept them; admin can rotate the secret at any time
  • Commission Bypass: bot trades skip commissions so service balances do not drain
  • BOT Badge: bot accounts are flagged in the WordPress user list for transparency

How It Works at a Glance

You configure each bot from the Trading Bots admin page (per-pair settings, frequency, ladder depth, schedule). A heartbeat service running on the wpcrypto.net side wakes each enabled bot on its scheduled cadence, the bot then lays its ladder and trades, and the run is logged. You never have to start, stop, or babysit anything once a bot is published.

Service Users

The bot uses two dedicated WordPress accounts for clean accounting:

  • bot_alice — always SELLS into the orderbook
  • bot_bob — always BUYS from the orderbook

Both accounts get the wpcrypto_bot role and a BOT badge in the user list. Make sure each account holds enough base/quote balance before activating a bot — empty balances cause the ladder to fail silently.

Creating a Bot

Go to WordPress Admin → WPCrypto → Trading Bots → Add. The form mirrors the standard WPCRYPTO admin layout used by Coins Manager and Pairs Manager.

Field Purpose
nameFriendly label shown in the bot list (e.g. "MYX Volume Test")
symbol / base_coin / quote_coinThe trading pair the bot will work, e.g. MYXUSDT
modevolume_only, range, or pump (controls how the target price moves over time)
frequency_secSeconds between ticks; lower means more orders per minute
min_volume / max_volumePer-tick volume range so each fill looks human
ladder_levelsHow many orders per side every tick (20–30 is typical)
ladder_spread_pctDistance between adjacent ladder rungs
max_concurrent_ordersCap on resting orders to keep memory bounded
daily_cap_quoteOptional quote-volume ceiling per day
respect_real_usersIf enabled, the bot avoids stepping on real-user fills
schedule_start / schedule_endOptional active window (e.g. only run during market hours)

Per-Tick Action Engine

Each tick the engine picks one weighted-random action so the orderbook does not look mechanical:

Action What it does Weight
micro_fillSmall market-like fill near best bid/ask~45
trade_onlyPair of matching orders that produces a printed trade~30
depth_padAdds extra depth to the ladder without producing a trade~15
depth_refreshCancels stale orders and lays a fresh full ladder~10

Weights are tuned so the trade tape stays alive without bleeding the bot balances. The full ladder is refreshed periodically (default every 12 ticks) to prevent stale resting orders from piling up.

Heartbeat Daemon

The bot does not poll itself — an external Node.js daemon registered against the manager fires the ticks. The daemon:

  • Reads the registry of active bot sites from the central manager
  • Sends signed tick requests to each site on schedule
  • Soft-fails when a site is slow or unreachable; reports failures only after a threshold

🔐 Replay-protected signing

Each tick request carries a timestamp and a signature so it can only be replayed inside a short window and only by your own daemon. You can rotate the secret from the Trading Bots admin page at any time — old requests are then refused immediately.

Admin Page

The Trading Bots admin page lists every configured bot with its live state, last tick time, and current balances. The list mirrors the WPCRYPTO admin style (header info card, stats, table) used elsewhere in the plugin.

  • Configured Bots: count of bot configuration rows
  • Last Tick: timestamp of the most recent successful tick per bot
  • Service Balances: bot_alice and bot_bob balances for each base/quote pair the bots are using
  • Heartbeat State: enabled/disabled, last successful ping, last error
  • Rotate Secret: generate a new HMAC secret and invalidate the old one in a single click

Operational Notes

⚠️ Before You Activate a Bot

  • Fund bot_alice with enough base coin and bot_bob with enough quote coin for the pair
  • Set realistic min_volume / max_volume — values that overlap your typical real-user order size
  • Cap daily_cap_quote on production pairs you do not want to over-rotate
  • If you change the HMAC secret, restart the heartbeat daemon so it picks up the new value
  • Disable a bot before changing its symbol or ladder_levels drastically to avoid mid-tick race conditions

What the Bot Records

For every configured bot the admin page shows its current configuration (pair, mode, frequency, ladder settings, schedule) and a tick-by-tick run log with timestamps, the action it picked, orders placed and basic stats. You never have to touch storage yourself.