Mexc  icon

Mexc

Trade on Mexc

Overview

This node enables users to place spot trading orders on the Mexc cryptocurrency exchange. It supports creating limit buy or sell orders for specified token trading pairs with configurable order parameters such as quantity, price, and time in force.

Common scenarios where this node is beneficial include:

  • Automating cryptocurrency trading strategies by programmatically placing orders.
  • Integrating Mexc trading capabilities into broader workflows for portfolio management or alerting.
  • Quickly executing trades based on external signals or data processed within n8n.

For example, a user could set up a workflow that monitors market conditions and automatically places a limit buy order for BTCUSDT when certain criteria are met.

Properties

Name Meaning
Token Trading Pair The trading pair symbol on Mexc (e.g., "BTCUSDT") to specify which tokens to trade.
Trade Side Direction of the trade: either "Buy" or "Sell".
Order Type Type of order to place; currently only "Limit" orders are supported.
Time in Force How long the order remains active: "Good Till Cancel", "Immediate or Cancel", or "Fill or Kill".
Quantity The amount of the asset to buy or sell.
Price The price at which to place the limit order.

Output

The node outputs an array of JSON objects, each representing the response from the Mexc API after placing an order. The structure of each output JSON corresponds to the order confirmation details returned by the Mexc spot trading API, typically including order ID, status, executed quantity, and other metadata about the placed order.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential and secret key credential for authenticating with the Mexc API.
  • Uses the mexc-api-sdk package internally to interact with the Mexc spot trading endpoints.
  • The node expects these credentials to be configured securely within n8n.

Troubleshooting

  • Authentication errors: Ensure that valid API keys with appropriate permissions are provided. Invalid or missing credentials will cause authentication failures.
  • Order placement errors: Common issues include insufficient balance, invalid trading pair symbols, or incorrect order parameters (e.g., quantity or price out of allowed ranges). Review error messages returned by the Mexc API for specifics.
  • Network or API downtime: Temporary connectivity issues or Mexc service outages can cause request failures. Retrying later or checking Mexc status pages may help.
  • If the node is set to continue on failure, failed executions will include error details in the output JSON for easier debugging.

Links and References

Discussion