Gainium icon

Gainium

Operates with official Gainium API

Overview

The "Change Bot Pairs" operation in the Gainium node allows users to modify the trading pairs associated with a specific bot on the Gainium platform. This operation supports two configuration modes:

  • Simple mode: Users provide a comma-separated list of trading pairs and specify whether to add, remove, or replace these pairs in the bot's configuration.
  • Advanced mode: Users supply a custom JSON object detailing specific pairs to add or remove, allowing for more complex pair management.

This operation is useful when managing automated trading bots that need to adjust their target trading pairs dynamically based on market conditions or strategy changes. For example, a user might want to quickly add new cryptocurrency pairs to a bot or remove underperforming pairs without recreating the bot.

Properties

Name Meaning
Bot Id The unique identifier of the bot whose pairs you want to change.
Bot Name The name of the bot (optional, may be used for identification).
Configuration Mode Choose between "Simple (Set Pairs with Mode)" or "Advanced (Custom JSON)" to define how pairs are set.
Pairs To Set (Simple mode) Comma-separated list of trading pairs to add/remove/replace, e.g., BTC_USDT,ETH_USDT.
Pairs To Set Mode (Simple mode) Mode of operation on pairs: Add, Remove, or Replace.
Pairs To Change (Advanced mode) JSON object specifying arrays of pairs to add or remove, e.g., { "remove": ["BTC_USDT"], "add": ["ETH_USDT"] }.
Paper Trading Boolean flag indicating whether to apply changes in paper trading mode (true) or real trading mode (false).

Output

The output JSON contains the response data from the Gainium API after attempting to change the bot pairs. Typically, this will include confirmation of the updated pairs or details about the bot's new configuration state.

The exact structure depends on the API response but generally includes fields such as success status, updated pairs list, and any relevant metadata.

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.
  • Network access to the Gainium API endpoint specified in the credentials' base URL.
  • Proper permissions on the API key are required, specifically write access to modify bot settings.

Troubleshooting

  • Common issues:

    • Invalid or missing bot ID or bot name can cause the API to reject the request.
    • Incorrectly formatted JSON in advanced mode (Pairs To Change) will result in errors.
    • Insufficient API key permissions (missing write access) will prevent changes.
    • Network or authentication failures due to invalid tokens or signatures.
  • Error messages:

    • "Error: <reason>" — Generic error returned from the API; check the reason message for specifics.
    • "HMAC generation failed: Web Crypto API not available" — Indicates environment does not support required cryptographic functions.
    • "Invalid JSON in filterModel" — Occurs if JSON input fields are malformed; ensure valid JSON syntax.
  • Resolutions:

    • Verify bot identifiers and names are correct.
    • Validate JSON inputs using external tools before submission.
    • Confirm API key has necessary permissions.
    • Ensure the execution environment supports Web Crypto API or equivalent.

Links and References

Discussion