Overview
This node interacts with the Binance API to adjust the leverage and margin type for a specified futures trading symbol. It is useful in automated trading workflows where you need to programmatically set or update leverage and margin settings for your futures positions on Binance.
Common scenarios:
- Automatically adjusting leverage before opening new futures trades.
- Switching between isolated and crossed margin modes as part of risk management strategies.
- Integrating leverage adjustments into larger trading automation pipelines.
Practical example:
A user wants to increase leverage to 50x and switch to "ISOLATED" margin mode for the BTCUSDT perpetual contract before executing a trade, ensuring their position uses the desired risk parameters.
Properties
| Name | Type | Meaning |
|---|---|---|
| Symbol Name or ID | options | The futures trading pair (symbol) to adjust. You can select from a list or specify an ID using an expression. |
| Leverage | number | The leverage multiplier to set for the selected symbol. Must be between 1 and 75. |
| Margin Type | options | The margin mode to use for the position. Options are "ISOLATED" (isolated margin per position) or "CROSSED" (shared margin across all positions). |
Output
The output will contain a json field reflecting the response from the Binance API after attempting to set the leverage and margin type. The structure typically includes:
{
"symbol": "BTCUSDT",
"leverage": 50,
"marginType": "ISOLATED",
// ...other fields returned by Binance API
}
symbol: The trading pair affected.leverage: The leverage value that was set.marginType: The margin type applied.- Additional fields may be present depending on the Binance API's response.
Dependencies
- External Service: Requires access to the Binance API.
- API Credentials: Needs valid Binance API key and secret configured in n8n credentials under
binanceApi. - n8n Configuration: No special environment variables required beyond standard credential setup.
Troubleshooting
Common issues:
- Invalid symbol: If the symbol does not exist or is not enabled for futures trading, the API will return an error.
- Leverage out of range: Attempting to set leverage outside the allowed range (1–75) will result in an error.
- Insufficient permissions: If the API key lacks futures trading permissions, requests will fail.
- Margin type not supported: Some symbols may not support both margin types.
Error messages and resolutions:
"Invalid symbol": Double-check the symbol name/ID."Leverage not changed": Ensure the leverage value is different from the current setting and within allowed limits."No such marginType": Use only "ISOLATED" or "CROSSED"."API-key format invalid": Verify your Binance API credentials in n8n.