bitget-tk

n8n community node for Bitget exchange β€” open, close, and manage futures trades

Package Information

Released: 5 mo ago
Downloads: 9 weeklyΒ /Β 690 monthly
Latest Version: 3.1.1
Author: Your Name

Documentation

n8n-nodes-bitget

Custom n8n community node for Bitget Exchange β€” full futures trading control from your n8n workflows.


βœ… Supported Operations

πŸ“Š Account

Operation Description
Get Account Info Fetch balance and margin details
Get Positions List all open futures positions
Set Leverage Set leverage multiplier (per symbol, per side)

πŸ“‹ Orders

Operation Description
Place Order Open market or limit order with optional TP/SL at entry
Modify Pending Order Change price, size, TP, or SL on an unfilled order
Cancel Order Cancel a pending order by orderId
Close Position Market-close all contracts for a symbol
Get Order Detail Fetch fill status and details for a specific order
Get Open Orders List all pending/unfilled orders

🎯 TP/SL Management

Operation Description
Set TP/SL on Pending Order Add/update TP and SL on an unfilled pending order
Set TP/SL on Open Position Add/update TP and SL on a filled open position
Set TP/SL by Hold Side Set TP/SL specifically for the long or short side

πŸ“ˆ Market

Operation Description
Get Ticker Get current mark/last price for any trading pair

πŸ”§ Installation

Self-hosted n8n (GUI)

  1. Go to Settings β†’ Community Nodes β†’ Install
  2. Enter: n8n-nodes-bitget
  3. Click Install and restart n8n

Manual (Docker / CLI)

cd ~/.n8n
npm install n8n-nodes-bitget
# Restart n8n

Local Development

git clone <this-repo>
cd n8n-nodes-bitget
npm install
npm run build
npm link

cd ~/.n8n/custom
npm link n8n-nodes-bitget
n8n start

πŸ”‘ API Key Setup

  1. Log in to Bitget
  2. Go to Profile β†’ API Management β†’ Create API Key
  3. Enable: βœ… Futures Trade, βœ… Read β€” disable ❌ Withdraw
  4. Add your n8n server IP to the IP whitelist
  5. Note down: API Key, Secret Key, Passphrase

In n8n β†’ Credentials β†’ New β†’ Bitget API β†’ enter all three.


πŸ“– Example Workflows

Open a BTC Long with TP/SL

Trigger β†’ Bitget (Place Order)
  Symbol: BTCUSDT | Side: Buy | Type: Market | Size: 1
  Take Profit Price: 105000 | Stop Loss Price: 95000

Modify a Pending Order Entry + SL

Trigger β†’ Bitget (Modify Pending Order)
  Order ID: <id> | New Price: 98500 | New Stop Loss: 94000

Update TP/SL on Open Position

Trigger β†’ Bitget (Set TP/SL on Open Position)
  Symbol: BTCUSDT | TP: 108000 | SL: 96000 | Trigger: Mark Price

Update TP/SL on Pending (Unfilled) Order

Trigger β†’ Bitget (Set TP/SL on Pending Order)
  Order ID: <id> | TP: 105000 | SL: 95000

Adjust Leverage

Trigger β†’ Bitget (Set Leverage)
  Symbol: BTCUSDT | Leverage: 20 | Hold Side: Long

⚠️ Notes

  • Uses Bitget API v2
  • USDT-FUTURES is most common for USDT-margined contracts
  • TP/SL trigger types: Mark Price (recommended), Last Price, Index Price
  • Modifying a pending order requires the original orderId
  • For hedge mode positions, use Set TP/SL by Hold Side to target long or short separately
  • Always test with small sizes in a testnet or sandbox first

πŸ” Authentication

Every request is signed automatically using HMAC-SHA256:

signature = Base64(HMAC-SHA256(timestamp + METHOD + /path + body, secretKey))

No manual signing needed β€” just provide your credentials in n8n.

Discussion