An AI trading agent for OKX, from spot to perps

Connect OKX and Nick runs your plan across spot, futures and perpetual swaps, including EU X-Perps if you trade from Europe. It reads OKX prices and funding, sizes each order the way you choose, attaches the stop-loss and take-profit on spot and standard perps, and keeps your portfolio in view.

Connect OKX and let Nick trade spot, futures and perps for you, including EU X-Perps.

Try for free now

Up to 1,000 free credits as you set up. No card. No time limit.

What you can build with OKX

Each runs on your schedule and does nothing until you activate it.

  1. Trend entry with a trailing stop

    Ride a BTC trend on OKX spot with a stop that follows the price up.

    Every hour, read BTC-USDT from OKX. If the 20-hour moving average crosses above the 50-hour, buy $300 of BTC spot on OKX and place a trailing stop 3% below. Post the trade to my Slack channel.

    Try it in Nick
  2. EU X-Perps funding fade

    Short SOL on your OKX EU account when funding runs hot, and close it when funding cools.

    Every 4 hours, read the SOL funding rate from CoinGlass and my OKX EU portfolio. If funding is above 0.03% and I hold no SOL X-Perp position, place a limit order to short $150 of the SOL X-Perp 0.5% above the current price. If I hold the short and funding has dropped below 0.01%, close it at market. Send me a Telegram alert with each fill.

    Try it in Nick
  3. Sunday TWAP trim

    Keep SOL from taking over your OKX account, trimmed gradually instead of all at once.

    Every Sunday at 20:00, read my OKX portfolio. If SOL is more than 25% of my account, sell the excess as a TWAP over 1 hour. Email me my balances before and after.

    Try it in Nick

Connect OKX with an API key

  1. 1
    In OKX, create an API key for NickAI with read and trade permissions. Leave withdraw off.
  2. 2
    Copy the API key, the secret key and the passphrase you set.
  3. 3
    In NickAI, paste all three and pick the OKX region where you created the key. Nick can now read your account and place orders.

Your key is encrypted at rest and used only to read your account and place the trades you approve or automate. Without withdraw permission, the key cannot move funds out of OKX.

Try for free now

What your OKX agent can do

Your agent trades every OKX market type you use, with the order types and position modes you already rely on.

Spot, futures, perps and EU X-Perps

Trade OKX spot and derivatives, including EU X-Perps, in hedge or one-way mode with leverage set per instrument.

Trailing stops and attached exits

Market, limit, stop, stop-limit and trailing stop orders with GTC, IOC or FOK, plus an attached stop-loss and take-profit. EU X-Perps take market and limit orders.

TWAP for larger size

Work a bigger order over a window you set instead of sending it to the book at once.

Your OKX portfolio in every run

The Portfolio node reads OKX balances, positions, PnL and open orders, so your agent sizes from your real account.

OKX trading at a glance

Your agent reads OKX prices and funding, checks your rules, and places spot or derivatives orders when they pass.

Get started now

Prices and funding

OKX candles plus CoinGlass funding and open interest.

01

Your rules

Indicators, thresholds and the models you pick.

02

Orders

Spot or perps, with exits attached or worked by TWAP.

03

OKX prices in, OKX spot and perp orders out

OKX is a source in the Price Data node, the Portfolio node reads your OKX account, and the Exchange Order node trades spot, futures and perpetual swaps with trailing stops, attached exits, reduce-only and TWAP, and EU X-Perps with market and limit orders.

Create your agent, the way you want

Describe it to Nick in plain English, start from a template, or build it from the AI assistant you already use.

Full walkthrough

From your OKX balance to a running agent

Check your balance, place limit and market orders, cancel one, then describe a strategy and let Nick run it every hour.

Yes. Connect your OKX EU account and your agent can trade X-Perps with market and limit orders, in hedge or one-way mode. Attached stop-loss and take-profit are not available on X-Perps yet, so set exits as a separate rule in your workflow.

An OKX API key, secret and passphrase, plus your server region. Create the key with trading permission only, and your funds stay in your OKX account.

Market, limit, stop, stop-limit and trailing stop orders with GTC, IOC or FOK, an attached stop-loss and take-profit, reduce-only, and TWAP. Perps run in hedge or one-way mode.

Yes. Tick demo when you connect to use OKX demo trading, or run the strategy on PaperNick, Nick's paper trading venue, first.

Yes. Add order steps for Hyperliquid, Coinbase, Alpaca or Polymarket to the same workflow and run them from one workspace.