DEV Community

Nyria
Nyria

Posted on

How to auto-trade the calls from a Discord trading server (without a bot token)

How to auto-trade the calls from a Discord trading server (without a bot token)

Most people who trade from a Discord server do the same thing: a call lands, the phone buzzes, they open the broker app, type the ticket, and get filled somewhere between thirty seconds and never. The server is the signal. The human is the bottleneck.

I spent a while trying to close that gap with my own code, and I build Nyria now, which does it as a product. This post covers what I learned the hard way with a self-written bot, and then the setup I use today, which takes no bot token, no server and no code. Disclosure up front so you can weigh the rest.

The do-it-yourself route, and where it leaks

The obvious plan: create a Discord application, get a bot token, invite the bot to the server, listen for on_message, parse the text, hit the broker API.

@client.event
async def on_message(message):
    if message.channel.id != CALLS_CHANNEL:
        return
    text = message.content or embed_text(message)
    side, ticker = parse(text)
    broker.place_order(ticker, side, qty)
Enter fullscreen mode Exit fullscreen mode

It works for an afternoon. Then the problems arrive in this order:

  1. Permissions. You can only invite a bot to a server where you have Manage Server. A paid room you merely belong to will not let you add one, and reading it through your own user account is against Discord's terms and gets accounts banned.
  2. Formats. Callers post plain text, embeds, screenshots, quoted tweets. Your parse() grows a case for each and still misses the one written at 9:31 in a hurry.
  3. Noise. The same channel carries "nice fill", questions and someone's lunch. Every false positive is a real order.
  4. Hosting. The listener has to be awake at 3 AM when the crypto call hits. Laptops sleep. Free tiers restart.
  5. Exits. An entry is one message; the exit is another, hours later, in different words. Matching them against what the account is actually holding is the part most home-grown bots never finish.

None of these are hard individually. Together they are a part-time job that pays nothing until the trading does.

The setup I use now

Nyria has its own Discord bot. You invite it to a server you run and it asks for one permission, View Channels. There is no token to manage, nothing to host, and it never reads messages on your personal account. The steps, in the order the app walks you through them:

1. Connect Discord. Integrations, Discord card, Connect Discord. Discord asks for two scopes: identify, to map your Discord user to your Nyria account, and guilds, to list the servers you belong to. That is all.

2. Create a strategy with Discord as the source. On the channel step, select Invite bot to server. You need Manage Server in that server, which is the same rule as any Discord bot. If the caller you follow runs the room and you don't, the fix is at the end of this post.

3. Pick the channel and narrow it. One channel per strategy. Add an Author filter when several people post in the same channel, and a Keyword filter such as ALERT when calls share the channel with chatter. The preview shows the last 25 messages so you can see exactly what the bot will read.

4. Teach it the format from real messages. On the strategy's Alert format card, assign one past message to each trade type you enable: long entry, long exit, shorts if you trade them. Nyria shows what each message would have traded. If it reads one wrong, assign a different message or change the strategy before any bot runs. Nobody in the channel changes how they write.

5. Deploy on paper first. Deploy bot, choose Nyria Paper, set a budget per entry. Paper is free and needs no card. Let a few calls fire and read each fill on the bot's Logs tab, next to the message that caused it.

6. Then the broker. When the paper fills track the posts, deploy a second bot on your Alpaca, Tradier, tastytrade or Charles Schwab account with the same sizing. The next message that passes the filters places a trade.

What a call needs to contain

A ticker, a direction and an action. The wording is the caller's own. These all read:

Entering BTC long at support
BTO AAPL 345c 11/20 @ 12.50
long SPY
STC SPY 772c
sold half, trimming the rest at 780
Enter fullscreen mode Exit fullscreen mode

Embeds are read first, then a quoted tweet, then the plain text. A message with no size, no price and no venue, like long SPY, is still a complete alert: the strategy and the bot supply the size (budget per entry), the order type (market, or limit at the alert's price if it names one) and the account.

How exits work

Nothing waits at the broker between messages. An exit is an exit alert: STC SPY 772c, or a plain "sold" with no contract, closes what the entry opened in the same instrument, matched against what the bot is holding. The next move is always the next message.

This is the design choice that made my own bot hard: it forces you to think of the channel as the whole state machine, which is also why it holds up.

What to watch on the Logs tab

Every order sits beside the alert that caused it, with the receive time and the fill time to the millisecond. Every refusal does too, written in plain words: the budget per entry is lower than one unit costs, the message passed the filters but named no ticker, the market is closed for that asset. Nothing is ordered on a refusal. Read the log for a week on paper and you will know exactly which messages in that channel are trades and which are talk.

If you don't run the server

The bot can't join a paid Discord you only belong to, and nothing legitimate can. Two honest options:

  • Ask the caller to publish their calls as a strategy on Nyria. Members subscribe and deploy a bot in their own broker account; the caller gets paid per tier, through Nyria, Stripe or Whop. Many callers want this once they see their members are retyping every entry.
  • Run your own server for your own alerts: TradingView webhooks, a script, your own posts. Same setup, no permission problem.

Where to start

Make a free account at nyria.io, create a strategy with Discord as the source, point it at a channel you run and deploy a paper bot. No card, no token, no server to keep awake. When the paper fills match what the channel posts, you'll know whether it is worth pointing at a real account.

Top comments (0)