Gainium icon

Gainium

Operates with official Gainium API

Overview

This node operation updates an existing Combo Deal in the Gainium trading platform via its official API. It allows users to modify various settings of a Combo Deal, such as order counts, take profit and stop loss percentages, average price, volume scaling, and other advanced parameters.

Typical use cases include:

  • Adjusting risk management parameters (e.g., stop loss or take profit levels) for an active Combo Deal.
  • Changing the number of orders or active orders within a Combo Deal.
  • Modifying scaling factors or enabling/disabling features like smart orders or dollar-cost averaging (DCA).
  • Updating the deal configuration dynamically based on market conditions or strategy changes.

For example, a trader might want to update the take profit percentage and enable smart orders on a running Combo Deal to optimize exit points without stopping the deal.

Properties

Name Meaning
Please refer to official documentation of Gainium API for request formats. A notice reminding users to consult the official Gainium API documentation for correct request formats.
This operation requires write permission of API keys. A notice indicating that this operation needs API keys with write permissions.
Paper Trading Boolean flag indicating whether to perform the update in paper trading mode (simulated environment) or real trading mode.
Deal Id The unique identifier of the Combo Deal to update.
Deal Settings A JSON object containing all the settings for the Combo Deal. The object includes fields such as:
- ordersCount (number)
- tpPerc (take profit percentage as string)
- slPerc (stop loss percentage as string)
- profitCurrency (e.g., "base")
- avgPrice (average price as number)
- useTp, useSl, useDca, useSmartOrders (booleans to enable/disable features)
- activeOrdersCount (number)
- volumeScale (string)
- stepScale (number)
- comboTpBase (string, e.g., "full")

Output

The node outputs a JSON object under the json field containing the response data from the Gainium API after updating the Combo Deal. This typically includes confirmation of the updated deal details or status information returned by the API.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential with write permissions to authenticate requests to the Gainium API.
  • The node uses HMAC SHA-256 signing for request authentication, relying on the Web Crypto API available in the runtime environment.
  • Requires proper configuration of the Gainium API base URL, token, and secret in the node credentials.
  • Network access to the Gainium API endpoints is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrectly formatted JSON in the "Deal Settings" property can lead to parsing errors.
    • Insufficient API key permissions (missing write access) will prevent successful updates.
    • Using real trading mode without proper account setup may cause errors.
  • Error messages:

    • "HMAC generation failed: Web Crypto API not available": Indicates the runtime environment does not support the required cryptographic functions. Ensure the environment supports Web Crypto API.
    • "Error: <reason>": Returned from the Gainium API when the request fails; check the reason message for specifics (e.g., invalid parameters, unauthorized access).
    • "Invalid JSON in filterModel": If JSON input properties are malformed, fix the JSON syntax.
  • Resolutions:

    • Verify API credentials and their permissions.
    • Validate JSON inputs before execution.
    • Use paper trading mode for testing to avoid unintended real trades.
    • Consult Gainium API documentation for correct parameter usage.

Links and References

  • Gainium Official API Documentation (Please replace with actual URL)
  • Gainium API Authentication and Signing Guide (referenced implicitly in notices)
  • n8n HTTP Request Node Documentation (for understanding underlying HTTP calls)

Discussion