Actions23
- General Actions
- Bots Actions
- Deals Actions
- User Actions
Overview
This node integrates with the Gainium API to manage trading deals. Specifically, the "Close Deal" operation allows users to close an existing deal using different methods such as canceling it or closing by limit or market orders. This is useful in automated trading workflows where you want to programmatically finalize or terminate a deal based on certain conditions or triggers.
Practical examples include:
- Automatically canceling a deal if certain risk thresholds are met.
- Closing a deal at market price when a profit target is reached.
- Closing a deal by limit order to secure profits at a predefined price.
Properties
| Name | Meaning |
|---|---|
| Please refer to official documentation of Gainium API for request formats. | A notice prompting users to consult Gainium API docs for detailed request formats. |
| Close Type | Method to use when closing the deal. Options: Cancel, Close by Limit, Close by Market, leave |
| Bot Type | The type of bot managing the deal. Options: DCA, Combo |
| Deal Id | The unique identifier of the deal to be closed |
| Paper | Boolean flag indicating whether to use paper trading (simulated) or real trading |
Output
The output JSON contains the response data from the Gainium API after attempting to close the deal. It typically includes details about the closed deal status or any error messages returned by the API.
Example structure:
{
"data": {
// API response fields related to the closed deal
}
}
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 signatures for request authentication.
- Requires network access to the Gainium API endpoint specified in the credentials.
- No additional external dependencies beyond standard n8n HTTP request helpers.
Troubleshooting
Common issues:
- Invalid or missing deal ID will cause the API to reject the request.
- Incorrect "Close Type" or "Bot Type" values may result in errors.
- Network connectivity problems can prevent successful API calls.
- Using real trading without proper permissions or funds may cause failures.
Error messages:
Error: <reason>— Indicates the API returned a failure reason; check the message for specifics.HMAC generation failed: Web Crypto API not available— Node environment lacks required crypto support.Could not determine operation for resource: deals— Operation parameter missing or invalid.
Resolutions:
- Verify all required parameters are correctly set.
- Ensure API credentials are valid and have necessary permissions.
- Confirm network connectivity to Gainium API.
- Consult Gainium API documentation for correct usage of close types and bot types.
Links and References
- Gainium API Documentation (Please replace with actual URL)
- Gainium API official docs for deal management and close deal operation details.