Gainium icon

Gainium

Operates with official Gainium API

Overview

This node interacts with the Gainium API to retrieve and manage various types of trading bots, specifically including DCA (Dollar-Cost Averaging) bots. The "Get User DCA Bots" operation fetches a list of the user's DCA bots filtered by status and optionally paginated. This is useful for traders who want to programmatically monitor or analyze their active, closed, archived, or errored DCA bots on the Gainium platform.

Practical examples:

  • Automatically retrieving all open DCA bots to monitor their performance.
  • Fetching archived DCA bots for historical analysis.
  • Paginating through large numbers of DCA bots when not returning all at once.

Properties

Name Meaning
Status Filter bots by their status. Options: Open, Closed, Archive, Error, Range
Page Number Page number to retrieve when pagination is enabled (ignored if "Return All" is true)
Paper Trading Boolean flag indicating whether to use paper trading mode (true) or real trading (false)
Return All Boolean flag to return all results across pages (true) or just one page (false)
Please refer to official documentation of Gainium API for request formats. Notice message directing users to Gainium API docs for detailed request formats

Output

The output JSON contains a data field which holds the retrieved bots information. Depending on the API response structure, this can be:

  • An object with either:
    • result: an array of bot objects (when the API returns a result field)
    • items: an array of bot objects (when the API returns an items field)
  • Or a direct array of bot objects under items.

Additionally, the output includes metadata such as total counts:

  • For "return all" requests, the output includes either { result: [...], totalResults: number } or { items: [...], itemsCount: number }.
  • For paginated requests, only the current page's data is returned.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating with the Gainium API.
  • The node uses HMAC SHA-256 signing for request authentication, relying on the Web Crypto API available in the environment.
  • Requires network access to the Gainium API base URL configured in the credentials.
  • No additional external dependencies beyond standard HTTP requests and cryptographic signing.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrect status filter values may result in empty responses.
    • Pagination parameters must be valid positive integers; otherwise, unexpected results or errors may occur.
    • If the Web Crypto API is unavailable in the runtime environment, HMAC signature generation will fail.
  • Error messages:

    • "Error: <reason>" — indicates an error response from the Gainium API, where <reason> is provided by the API.
    • "HMAC generation failed: Web Crypto API not available" — indicates that the environment does not support required cryptographic functions.
    • "Operation Get User DCA Bots is not supported" — indicates a misconfiguration or unsupported operation requested.
  • Resolutions:

    • Verify API credentials are correctly set up and have necessary permissions.
    • Ensure the environment supports Web Crypto API or run n8n in a compatible environment.
    • Use valid input parameters according to Gainium API documentation.
    • Check network connectivity to the Gainium API endpoint.

Links and References

Discussion