Exchange Order Node
The Exchange Order node executes real trades on your connected exchange account. It supports market and limit orders across multiple exchanges — Alpaca for stocks, Coinbase for crypto, and several others via CCXT. Every field can be hardcoded or dynamically driven by upstream nodes, so you can build fully autonomous trading workflows.
Configuration
Order Configuration
Configuration
| Field | Description |
|---|---|
| Exchange | The exchange to execute on. Alpaca (stocks + crypto), Coinbase (crypto), Hyperliquid (crypto perps), OKX (crypto), Papernick (paper trading), or Trade XYZ. |
| Credential | API credentials for the selected exchange. The dropdown filters to credentials matching your chosen exchange. You can create new credentials inline. |
| Symbol | The trading pair — e.g., BTC/USD, ETH/USDT, or AAPL for stocks on Alpaca. Supports the f(x) toggle for dynamic values from upstream nodes. |
| Side | buy or sell. Can be hardcoded or driven dynamically by an upstream LLM or Function node. |
| Order Type | market (executes immediately at current price) or limit (waits until the target price is reached). Default: market. |
| Amount | The quantity of the asset to trade. Supports the f(x) toggle. This is in asset units, not dollar value — see the warning below. |
| Limit Price | Only shown when Order Type is limit. The price at which you want the order to fill. Supports the f(x) toggle. |
| Description | Optional human-readable note describing the order (e.g., "Buy BTC when RSI drops below 30"). |
Amount is in asset units, not dollars. If you want to buy $100 worth of BTC at $67,000, the amount is 100 / 67000 = 0.001493 — not 100. Use a Function node upstream to calculate the correct quantity from a dollar amount.
The f(x) Dynamic Field Toggle
Several fields in the Exchange Order node — Symbol, Side, Amount, and Limit Price — support a toggle between static mode and expression mode. Click the f(x) button next to a field to switch modes.
- Static mode (default): You type a fixed value directly —
BTC/USD,buy,0.5. - Expression mode: You reference a value from an upstream node using the {edge_label.field} syntax — for example, {sizing.quantity} to pull the amount from a connected Function node.
This is what makes the Exchange Order node powerful in automated workflows. Instead of hardcoding "buy 0.1 BTC," you can wire up an LLM to decide the side, a Function node to calculate the quantity, and a Conditional node to gate when the order fires — all flowing dynamically into the Exchange Order at runtime.
Supported Exchanges
| Exchange | Asset Types | Notes |
|---|---|---|
| Alpaca | Stocks, crypto | Supports paper trading mode. Default exchange. |
| Coinbase | Crypto | Requires API key, secret, and passphrase. |
| Hyperliquid | Crypto perpetuals | Uses wallet keys. Supports sub-accounts via main account address. |
| OKX | Crypto | Supports demo trading mode for testing. |
| Papernick | Simulated | NickAI's built-in paper trading exchange for testing workflows without risking real funds. |
| Trade XYZ | Crypto | Uses wallet keys. Supports sub-accounts. |
When you change the exchange, the credential dropdown resets and filters to credentials matching that exchange type. The symbol picker also updates to show relevant trading pairs.
Symbol Normalization
You don't need to worry about getting the symbol format exactly right. The node automatically normalizes common variations:
BTCbecomesBTC/USDBTCUSDbecomesBTC/USDETHbecomesETH/USD
This works for all major crypto symbols (BTC, ETH, SOL, AVAX, DOGE, LTC, LINK, UNI, AAVE, DOT, and more). For stocks on Alpaca, use the standard ticker symbol (e.g., AAPL, TSLA).
Workflow Examples
AI-Driven Trading
The most common pattern: an LLM analyzes market data, a Conditional gates on the signal, and the Exchange Order executes the trade.
In this workflow, the LLM returns a structured signal. The Conditional checks if the recommendation is "buy." If true, the Exchange Order fires. If false, an email notification lets you know the agent passed on the trade.
Calculated Position Sizing
When you need precise control over how much to buy, use a Function node to calculate the quantity based on your portfolio and risk parameters.
The Function node receives the current price and your portfolio balance, calculates 2% of your cash as the position size, divides by the current price to get the asset quantity, and outputs {sizing.quantity}. The Exchange Order uses that value via the f(x) toggle on the Amount field.
Limit Order with Dynamic Price
Set a limit order at a calculated price — for example, 2% below the current market price to catch a dip.
The Function node calculates the limit price and quantity, then the Exchange Order references {order_params.limit_price} and {order_params.quantity} in expression mode. Set the Order Type to limit and both Amount and Limit Price fields to f(x) mode.
Multi-Asset Rebalancing
Run parallel branches to rebalance across multiple assets in a single workflow execution.
Each Exchange Order node reads its own edge label for the side, symbol, and amount — {btc_order.side}, {eth_order.side}, {sol_order.side} — so a single Function node can drive multiple trades with different parameters.
Pricing
The Exchange Order node is free — it costs 0 credits per execution. The trade itself executes on your exchange account using your own funds and is subject to the exchange's own fees and commissions. NickAI does not charge anything on top of what your exchange charges.
Output
After the order executes, the node outputs a structured order object with full trade details.
| Path | Description |
|---|---|
| {exchange_order.order.id} | The exchange's order ID. Useful for tracking or logging. |
| {exchange_order.order.symbol} | The normalized trading symbol (e.g., BTC/USD). |
| {exchange_order.order.side} | buy or sell. |
| {exchange_order.order.type} | market or limit. |
| {exchange_order.order.amount} | The quantity that was ordered. |
| {exchange_order.order.price} | The execution price (for market orders) or the submitted price. |
| {exchange_order.order.limitPrice} | The limit price, if this was a limit order. |
| {exchange_order.order.createdAt} | ISO 8601 timestamp of when the order was created. |
| {exchange_order.order.status} | Order status from the exchange (e.g., filled, submitted, pending). |
exchange_order with your actual edge label. If the edge connecting this node to the next is labeled trade, use {trade.order.id}, {trade.order.status}, etc.You can connect the Exchange Order output to downstream nodes for post-trade logic — for example, sending a notification with the fill price, logging the trade to a storage node, or checking the order status in a Conditional before proceeding.
Error Handling
The node validates all inputs before submitting the order. Common errors you may encounter:
- "Symbol is required" — The symbol field is empty or resolved to an empty expression. Check your upstream node output.
- "Side must be either 'buy' or 'sell'" — The side field resolved to something other than
buyorsell. If using expression mode, make sure the upstream node outputs exactly one of those strings. - "Amount must be a positive number" — The amount is zero, negative, or not a valid number. If using expression mode, verify the upstream node returns a numeric value.
- "Limit price is required and must be positive for limit orders" — You selected limit order type but didn't provide a valid limit price.
- "Credential not found" — The selected credential was deleted or doesn't belong to your account. Re-select a credential in the node configuration.
- "Invalid credential type" — You selected a Coinbase credential for an Alpaca exchange (or similar mismatch). The credential type must match the selected exchange.
When an order fails, the node returns {exchange_order.error} with the error message. You can route this through a Conditional node to handle failures gracefully — for example, retrying or sending an alert.
Next Steps
- Function Node — Calculate position sizes, convert dollar amounts to asset quantities, or prepare dynamic order parameters.
- Conditional Node — Gate your trades on signals, thresholds, or risk checks before the order fires.
- Price Data Node — Fetch live market prices to feed into your trading logic.
- Portfolio Node — Check your current positions and balances before placing orders.