Skip to content
OKX logo

Alerts to orders

Automate Discord alerts to OKX

Nyria places Discord alerts as market orders on OKX spot pairs. It reads one channel in a server you run. The exchange connects with an API key, secret and passphrase.

Crypto spot
The Create strategy form: a strategy name typed in, Discord picked as its alert source and a channel in a server you run chosen, then Next to what it trades, where Stocks is picked
In #options-alerts, Desk posts BTO SPY 780C 11/20 @ 2.15. In #nyria-fills, Nyria posts Filled on Nyria Paper: Buy to open SPY 780C 11/20.

Setup steps

Invite the Nyria bot to a Discord server you run. Pick the alerts channel in a Nyria strategy. Then connect your OKX account in Nyria with your own OKX API key. Each call posted there becomes a spot order in your own OKX account. Each bot sizes its orders from its budget per entry.

  1. 1Connect OKX. In OKX, open okx.com/account/my-api and create an API key with a passphrase. Turn on Read and Trade, leave Withdraw off, and link Nyria's IP address to the key. In Nyria, select Integrations, then the OKX card, paste the API key, secret key and passphrase, then select Connect OKX.
  2. 2Link Discord. In Nyria, open Integrations and scroll to Third-party integrations. Open the Discord card and select Connect Discord. Nyria asks Discord only for your identity and server list.
  3. 3Invite the bot and pick the channel. Select Create strategy and pick Discord. On the Discord channel step, select Invite bot to server and authorize it. You need the Manage Server permission to invite the bot. Choose the server and the alerts channel. Set an Author or Keyword under Message filters if others post there.
  4. 4Check real messages. Open the Alert format card on the strategy's Integration tab. Assign a past message from the channel to each side the strategy uses. Long entry and Long exit, for example. Nyria shows the symbol and side it would have traded.
  5. 5Deploy a bot. On the strategy, select Deploy bot. Pick the OKX account on the Account step and set a Budget per entry. Live bots need a Nyria Pro plan or a Premium strategy you have bought. The next alert becomes an order.

What a Discord alert must say

Nyria needs the ticker, the side, and whether it opens or closes a position. It reads plain text or JSON in your own wording. There is no template to follow. Spot crypto can't be shorted, so a short alert closes the long.

Write the call the way the caller already does. Buy ETH, or a plain sentence that names the coin. Nyria reads one channel, from any member, bot or webhook. It ignores threads, DMs and later edits.

An alert cannot set the size: each bot's budget per entry does. Exits come from your exit alerts.

A crypto entry

Long BTC here

Buy BTC spot. The message has no size, so each bot's budget per entry sets it.

An exit, written as a sentence

Closing BTC here

Close the open BTC position, matched against what the bot is holding.

What OKX does with it

OKX connects with an API key, not a sign-in. Nyria stores the API key, secret key and passphrase encrypted at rest. Without withdrawal permission, the key can't move funds out. OKX isn't available in every country, so check OKX's terms for yours.

Options aren't offered on this connection. An options alert places no order at OKX.

Nyria trades OKX spot pairs quoted in USDT, USDC or EUR.

Each alert becomes a market order, sized by each bot's budget per entry. Nothing waits at the broker between alerts. The exit comes from your alert.

Questions

Does Nyria read every message in the server?
No. Only the channel you pick, and only the author or keyword you filter on. Replies and questions from everyone else place nothing. Messages elsewhere in the server are ignored.
Which OKX API key does Nyria need?
A key with Read and Trade turned on and Withdraw left off. Set a passphrase when you create it. OKX can't recover it.
Why did my OKX API key expire?
OKX expires a trading key with no IP address after 14 days without use. Link Nyria's IP address to the key so it keeps working. Email contact@nyria.io for the address.
Which OKX pairs can a Discord alert trade?
OKX spot pairs quoted in USDT, USDC or EUR. Every alert becomes a market order, sized by each bot's budget per entry.
Does Nyria hold my OKX login?
No. An OKX API key doesn't need your password. Nyria stores the API key, secret key and passphrase encrypted at rest.
Who sets the size of an OKX order?
The bot does. Each bot sizes its orders from its budget per entry, and an alert never sets the size.
How fast does an alert become an order?
Sub-second, alert to order.

From the sources

Next

OKX orders, by alert source

Send your first Discord alert

Trade and test free on paper. No card required.