Gainium icon

Gainium

Operates with official Gainium API

Overview

This node operation "Add Funds To Deal" allows users to add funds to an existing trading deal managed by a bot on the Gainium platform. It is useful in scenarios where you want to increase the investment amount of a specific deal dynamically, for example, to capitalize on market opportunities or adjust risk exposure.

Practical examples include:

  • Adding additional capital to a cryptocurrency trading deal to increase position size.
  • Adjusting funds in a deal based on external signals or automated strategies.
  • Managing paper trading deals separately from real trading deals by toggling the paper trading context.

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.
Bot Id ID of the bot to which funds will be added.
Deal Id (Optional) ID of the specific deal to add funds to. If not provided, the operation might target a default or active deal associated with the bot.
Symbol (Optional) Trading pair symbol (e.g., BTC/USDT) related to the deal.
Quantity Amount of funds to add to the deal.
Qty Type Specifies whether the quantity is a fixed amount ("Fixed") or a percentage ("Percentage") of the current deal funds.
Asset Type of asset to add funds from; can be either the base currency or the quote currency of the trading pair.
Paper Boolean flag indicating whether to use paper trading mode (true) or real trading mode (false).

Output

The output JSON contains the response data from the Gainium API after attempting to add funds to the specified deal. The structure typically includes:

  • data: An object representing the updated deal information or confirmation of the fund addition.
  • Other metadata fields as returned by the API, such as status or messages.

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.
  • Requires network access to the Gainium API endpoint specified in the credentials.
  • No additional environment variables are needed beyond the configured API credentials.

Troubleshooting

  • Common issues:

    • Missing or invalid Bot Id or Deal Id parameters may cause the API to reject the request.
    • Incorrect quantity format or unsupported quantity type may result in errors.
    • Using paper trading mode without proper setup could lead to unexpected behavior.
    • Network connectivity issues or invalid API credentials will cause authentication failures.
  • Error messages:

    • "Error: <reason>" — Generic error returned from the API indicating why the request failed. Check the reason message for details.
    • "HMAC generation failed: Web Crypto API not available" — Indicates that the environment does not support the required cryptographic functions; ensure the runtime supports Web Crypto API.
    • "Operation Add Funds To Deal is not supported" — Means the operation name was not recognized; verify the operation parameter is correctly set.
  • Resolutions:

    • Verify all required parameters are provided and correctly formatted.
    • Confirm API credentials are valid and have necessary permissions.
    • Ensure the runtime environment supports cryptographic operations.
    • Consult Gainium API documentation for detailed request requirements.

Links and References

Discussion