Gainium icon

Gainium

Operates with official Gainium API

Overview

The "Start Deal" operation in the Deals resource of this Gainium API node initiates a new trading deal for a specified bot. This node action is useful for users who want to programmatically start trading deals on their configured bots, either in real or paper trading mode. It supports specifying the bot type (e.g., DCA or Combo), the bot's unique identifier, and optionally the trading pair symbol.

Practical examples include:

  • Automatically starting a new deal on a DCA bot when certain market conditions are met.
  • Initiating a combo bot deal with a specific trading pair symbol during a trading strategy workflow.
  • Using paper trading mode to simulate deal starts without risking real funds.

Properties

Name Meaning
Bot Type The type of bot to start a deal for. Options: "DCA", "Combo".
Bot Id The unique identifier of the bot for which the deal will be started.
Symbol (Optional) The trading pair symbol, e.g., "BTC/USDT", to specify the market for the deal.
Paper Whether to use paper trading mode (true) or real trading mode (false).

Note: There is also a notice property reminding users to refer to the official Gainium API documentation for request formats.

Output

The output JSON contains the response data from the Gainium API after attempting to start the deal. Typically, it includes details about the newly started deal such as its ID, status, and parameters returned by the API.

The node does not explicitly handle binary data output for this operation.

Example output structure (simplified):

{
  "data": {
    "dealId": "string",
    "status": "string",
    "botId": "string",
    "symbol": "string",
    "botType": "string",
    "paperContext": false
  }
}

Dependencies

  • Requires an API key credential for authenticating with the Gainium API.
  • The node uses HMAC SHA-256 signing for requests, relying on Web Crypto API availability.
  • Network access to the Gainium API base URL configured in credentials.
  • Proper configuration of the Gainium API credential with base URL, token, and secret.

Troubleshooting

  • HMAC generation failed: If the environment does not support the Web Crypto API, the node will throw an error indicating HMAC generation failure. Ensure the runtime environment supports Web Crypto.
  • Error: [reason]: The node throws errors if the API returns a status of "NOTOK" with a reason message. Check the reason for issues like invalid parameters, authentication failures, or rate limits.
  • Invalid JSON in parameters: Some operations require JSON strings for settings; ensure these are valid JSON to avoid parsing errors.
  • Missing required parameters: The botId and botType are mandatory; missing these will cause errors.
  • Network or credential misconfiguration: Verify that the API base URL and credentials are correctly set up in n8n.

Links and References

  • Gainium Official API Documentation: Refer to the official Gainium API docs for detailed request and response formats, especially for the "startDeal" endpoint.
  • n8n Documentation: For guidance on setting up API credentials and using custom nodes.

This summary focuses specifically on the "Deals" resource and the "Start Deal" operation as requested.

Discussion