Skip to content
OKX logo

Alerts to orders

Automate Telegram alerts to OKX

Nyria places Telegram alerts as market orders on OKX spot pairs. It joins a group or channel you run as a read-only admin. The exchange connects with an API key, secret and passphrase.

Crypto spot
My strategies, then Create strategy: a strategy name typed in, Telegram picked as its alert source, the Nyria Test Alerts chat chosen and the keyword AMZN typed in, then Next to what it trades, where Stocks is picked

Setup steps

Add Nyria as a read-only admin of a Telegram group or channel you run. Pick that chat 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 Telegram. In Nyria, select Create strategy, pick Telegram and select Connect Telegram. Telegram opens a chat with @NyriaAlertsBot. Press Start, then tap Link in its reply.
  3. 3Add Nyria to your chat. Select Add Nyria to a group or Add Nyria to a channel. Make Nyria an admin. You need to own the chat or be an admin who can add admins. Nyria asks for one right, manage chat, and only reads. Pick the chat. Set an Author or Keyword filter if others post there.
  4. 4Check a real message. Choose a real message in the preview. The strategy stays inactive until Nyria reads one correctly. The Logs tab shows the symbol and side it read.
  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 Telegram 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 poster already does. Buy ETH, or a plain sentence that names the coin. Messages that other bots post in a group are not read.

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

What if a Telegram message is edited or arrives late?
An edited message places no order, so post a new one. An alert over a minute old, or behind a newer one, opens nothing. A close in it still runs.
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 Telegram 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 Telegram alert

Trade and test free on paper. No card required.