Back to work

Trench Desk · Discord bot

A trading server built, checked and run from code

A read-only Discord bot and server kit for Solana memecoin communities. It builds and audits the server, scans tokens, scores callers and follows wallets. It never trades.

What the bot handles

  • 12Slash commands
    What it covers
    Eight outside Desk Pro: /ca, /call, /fc, /leaderboard and /stats for members, and /track, /untrack and /wallets for staff. Four for Desk Pro members: /copy, /uncopy, /portfolio and /pnlcard. A pasted address in #ca-lookup also gets a token card.
  • 15Channels built from code
    What it covers
    One blueprint describes 4 roles, 6 categories, 15 channels with their permissions, and 3 AutoMod rules. An audit compares it with the live server and says exactly what drifted. Nothing is built or changed until the apply command is run.
  • 6Public data sources
    What it covers
    DexScreener for market data, Solana JSON-RPC and Helius for on-chain data, pump.fun for a developer's launches, GeckoTerminal and QuickChart for price history and the chart, and Jupiter quotes for paper trades. Calls, wallets, trades and paper positions are kept in SQLite.
  • 0Trades made, keys held
    What it covers
    Trench Desk is read-only. It never signs, trades or holds keys, and it gives no financial advice. Paper copy-trading asks Jupiter for a public price quote and writes a row in its own database; no transaction is built or sent.

How the community uses it

  1. A server is builtFrom one blueprint
  2. A coin is pastedA token card comes back
  3. Calls are scoredBy peak multiple
  4. Wallets are followedSwaps, PnL and paper copies

How it works, in detail

For technical reviewers: four diagrams drawn from the bot's source, and what each step does.

TriggerStepAnswer to senderDrawn from the bot's source

What was checked

Counts from the repository's test suite and the live server run on October 10, 2026.

  • 209Automated checks passed
    Details
    209 of 209 checks pass and the type check is clean, on Node 24.20.0 and discord.js 14.27.0. They run on recorded responses from the public data sources with no network, and cover the planner, the swap parser, PnL, paper fills, the call board and the cards.
  • 21 → 0Setup gaps before and after
    Details
    The first audit of the new server found 21 gaps: 3 roles, 5 categories, 10 channels and 3 AutoMod rules. All 21 actions were applied, and the audit that followed found nothing left to change.
  • 23 → 0Gaps after the update
    Details
    The later update of the server listed 23 actions: renames with no duplicates, a new role, new channels, topics, one permission reset and one AutoMod exemption change. All were applied, and the audit afterwards reported 0 remaining.
  • 35.5%Top-10 holders, pools excluded
    Details
    For one token, the bot's top-10 holder share with liquidity-pool accounts excluded came out at 35.5% against Axiom's 35.48%, after a fix to how pool authority accounts are recognised. Market caps agreed within 1% at each read.
  • 5Swaps posted in 11 minutes
    Details
    One anonymous public wallet followed in the live run: five mainnet swaps across three tokens appeared in the feed within 11 minutes, each linked to Solscan and DexScreener.

Inside the bot · 67 steps in four diagrams

From server to wallet feed

Scroll the steps. Tap any node for what that code does and what it calls.

  1. Server setup1 / 2

    15

    The server is described as code

    How it works
    The blueprint holds 4 roles, 6 categories, 15 channels with who can see, post and use commands in each, and 3 AutoMod rules. The audit reads the live server, matches each blueprint channel by name, then by a former name, then by its stable key, so a rename stays a rename. The plan lists what is missing and what drifted, in words, such as @everyone being allowed SendMessages in a channel. Channels that are not in the blueprint are listed and left alone.
  2. Server setup2 / 2

    21 → 0

    Audit, apply, audit again

    How it works
    pnpm server-audit is a dry run that writes a report. pnpm provision applies it. On the new server the first audit found 21 gaps, 21 of 21 actions were applied, and the audit afterwards found 0. After the later update, 23 actions were applied and the audit again found 0. Permissions are changed one overwrite at a time and only where they drifted.
  3. Token card1 / 2

    3

    Three lookups at once

    How it works
    /ca and a pasted address take the same route. A paste is read only in #ca-lookup, once, to find an address; the text is never stored. DexScreener, the Solana mint account and DexScreener's paid-profile check run together, each with a time limit, and a source that fails shows Unknown instead of stopping the card. The first person to scan a token in the server gets credit.
  4. Token card2 / 2

    6

    Six extra lookups for Desk Pro

    How it works
    Desk Pro members get holder concentration with pool and bonding-curve accounts excluded, a holder count, the developer's share and launches, a same-ticker count, the all-time high and a seven-day chart. They run in parallel, each with its own time limit. LP lock is always marked Not verified, and the all-time high carries a note when the free price history is partial.
  5. Calls1 / 2

    24 h

    One call per token a day

    How it works
    Only members with the Caller role can log a call. A token already called in the last 24 hours is refused with a link to the earlier call. The call is saved with the market cap at call time, which is the number every later multiple is measured against. The reply to the caller is private, so a failed lookup never lands in #calls.
  6. Calls2 / 2

    5 min

    Peaks tracked, callers ranked

    How it works
    Every 5 minutes the open calls from the last 7 days are priced in batches of 30. The peak only rises. Crossing 2x, 5x, 10x, 20x, 50x or 100x triggers a reply under the original call, worked out from the old and new peak so a restart cannot repeat it. Callers are ranked by average peak multiple, then 2x hits, then number of calls, on demand and once a day.
  7. Wallets1 / 3

    1

    Swaps read from balance changes

    How it works
    A wallet is read straight from Solana JSON-RPC. The swap is worked out from the wallet's SOL change and its token changes, and it counts only when exactly one token moved with a real SOL change. That is why it works across pump.fun and other venues without an indexer. Adding a wallet starts from its newest transaction, so history is never replayed, and each trade is posted once.
  8. Wallets2 / 3

    −11.4%

    Realized PnL on every sell

    How it works
    A sell is priced against the buys the bot has seen, by average cost and net of everything the wallet paid. A sell whose buy the bot never saw shows no PnL. In the October 10, 2026 live run the followed wallet realized −11.4% on one token, shown on the sell in the feed.
  9. Wallets3 / 3

    −21.4%

    A paper copy, priced from quotes

    How it works
    A Desk Pro member follows a tracked wallet with /copy. When the wallet buys, the bot asks Jupiter for the same buy; when it sells, for the matching exit; a closed trade posts a PnL card, losses included. Nothing is built or sent. The first live round trip lost 21.4% while the wallet itself lost 11.4% on the same token: the follower is always quoted a moment after the leader, and in a one-minute trade that gap is most of the result.

Build notes

What the bot does, how it was checked, and where it stops.

The server is data

How the blueprint works
One TypeScript blueprint describes the roles, six categories, fourteen text channels, a member-count voice channel, their permission overwrites, three AutoMod rules and the third-party bot it makes room for. A pure planner compares it with a snapshot of the live server, including the permission overwrites read back from Discord, so the audit can say exactly what drifted, such as @everyone being allowed SendMessages in #calls. Channels carry stable keys, so renaming one is a rename rather than a delete and replace, and the apply step edits only the overwrites that changed.

Data comes straight from the sources

Where each number comes from
Market data comes from DexScreener. On-chain data comes straight from Solana JSON-RPC: mint and freeze authority, holder concentration with liquidity-pool accounts excluded, and swaps derived from balance changes in confirmed transactions, so the wallet feed works across pump.fun and other venues without an indexer. Price history and the chart come from GeckoTerminal and QuickChart, and paper copy-trading is priced with Jupiter quotes. Calls, wallets, trades and paper positions live in SQLite. The runtime is Node 24 running TypeScript directly, with discord.js and one image renderer as its only dependencies.

Unknown stays Unknown

What the card does not claim
Values the bot cannot establish say so. LP lock is marked Not verified, a holder figure it cannot read is Unknown, and the all-time high carries a note when the free price history is partial. Rick and Axiom report a full-history all-time high and a six-figure holder count that free data sources cannot match, and the card says so instead of guessing.

Compared with Rick and Axiom

What the comparison found
Rick scanned the same address a minute after Trench Desk, and I had read Axiom's page for it earlier the same day. Market caps agreed within 1% at each read. The bot's top-10 holder share with pools excluded came out at 35.5%, against Axiom's 35.48%. Rick's holder line omits the second-largest wallet the bot shows and reports 31%, which suggests it also excludes a large labeled wallet.

Paper follows, never trades

What the paper copy showed
Desk Pro members can paper-follow a tracked wallet. When the wallet buys, the bot quotes the same buy on Jupiter; when it sells, it quotes the exit and posts a PnL card, losses included. The first live round trip lost 21.4% while the wallet itself lost 11.4% on the same token: the follower is always quoted a moment after the leader, and in a one-minute memecoin trade that gap is most of the result. Measuring it is the honest version of what a copy-trading bot sells.

Reading messages

What the bot reads
The bot reads message text only in the paste-to-scan channel, to find an address, and never stores it. A rules button grants the Member role, tickets open private channels that lock instead of being deleted, AutoMod blocks wallet-drainer phrases and stray contract addresses, and staff actions land in #desk-log.

Checked on recorded responses, then run live

What the live run found
The repository has 209 automated checks on recorded responses, with no network in the check path. The bot also ran live in a Discord server alongside Rick on least-privilege permissions. Running it live surfaced bugs the checks had not: a locked stats channel the bot could no longer see, a permission rule that kept members and Rick from adding reactions, which stopped Rick from working at all, an apply step that resent another app's grant and had the whole request rejected, and an all-time high that covered only six months. Each one is fixed, most with a new check, and the audit of the live server reports zero remaining drift.

What it does not do

The limits
Trench Desk does not trade, sign, copy real trades or give advice. Peaks and wallet activity are read on an interval, so a spike between reads is missed. Swaps are inferred from balance changes, so complex multi-token transactions are skipped. The holder count stops at 5,000, the all-time high covers about a year, the developer's launch history relies on pump.fun's unofficial API, and LP lock is not verified. Milestone replies and AutoMod blocks are covered by checks but were not triggered during the live run, because no tracked call doubled and server owners and bots are exempt from AutoMod.

What I would change for production

The next steps
Move the wallet feed from polling to websocket subscriptions, add a paid price-history source for a true all-time high, store data in Postgres if it runs as more than one instance, sync the Desk Pro role from a payment platform, and host it with Doppler-managed secrets and alerting on poller lag and Discord API errors.

Next

AI Automation for an Online Publishing Team

AI Automation for an Online Publishing Team