dYdX

Interact with dYdX v4 API

Overview

This node integrates with the dYdX v4 API, a decentralized trading platform, to perform various account and trading operations. Specifically, the "Place Order" operation allows users to submit limit orders on specified markets, enabling automated trading strategies or manual order placement within n8n workflows.

Common scenarios include:

  • Automatically placing buy or sell limit orders based on external signals or market conditions.
  • Integrating dYdX trading actions into larger automation pipelines, such as portfolio rebalancing or alert-triggered trades.
  • Testing trading strategies by programmatically submitting orders without manual intervention.

Example: A user can configure this node to place a buy order for BTC-USD at a specific price and size whenever a certain condition is met in their workflow.

Properties

Name Meaning
Market Market symbol where the order will be placed (e.g., BTC-USD).
Side Direction of the order: either Buy or Sell.
Price Limit price at which to place the order.
Size Quantity/size of the asset to buy or sell in the order.

Output

The output JSON object for the "Place Order" operation contains:

  • success: A boolean indicating if the order was successfully placed (true).
  • hash: A string representing the transaction hash or unique identifier of the placed order on the blockchain.

No binary data output is produced by this operation.

Example output:

{
  "success": true,
  "hash": "0x123abc456def..."
}

Dependencies

  • Requires an API key credential for authenticating with the dYdX v4 API.
  • The node internally uses services to interact with the dYdX network and requires network configuration from the credentials.
  • No additional environment variables are explicitly required beyond the API authentication.

Troubleshooting

  • Common issues:

    • Invalid or missing market symbol may cause order placement failure.
    • Incorrect price or size values (e.g., zero or negative) will likely result in errors.
    • Network or authentication failures due to invalid API credentials.
  • Error messages:

    • Errors thrown during order placement are caught and returned as error messages in the output if "Continue On Fail" is enabled.
    • Typical error messages might relate to invalid parameters or failed API calls.
  • Resolution tips:

    • Verify that the market symbol matches supported dYdX markets.
    • Ensure price and size are positive numbers.
    • Confirm API credentials are valid and have necessary permissions.
    • Enable "Continue On Fail" to handle errors gracefully in workflows.

Links and References

Discussion