List My Orders
Retrieves all open orders across all trading pairs for your Gate.io account. Essential for monitoring active orders and implementing order management strategies.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Client Id - The unique client identifier from the Connect node. Can be left empty if using direct credentials.
Options
- Api Key - Gate.io API key credential (optional if using Client Id from Connect node).
- Secret Key - Gate.io API secret key credential (optional if using Client Id from Connect node).
Output
- Result - An array of open order objects, where each order contains:
currency_pair- The trading pair (e.g.,BTC_USDT)total- Total number of orders for this pairorders- Array of order details for this pair- Each order in the array includes: id, side (buy/sell), amount, price, status, create time, etc.
How It Works
The List My Orders node executes the following steps:
- Authenticates using either Client Id or direct credentials
- Queries Gate.io API for all open orders across all trading pairs
- Groups orders by currency pair
- Returns an array with orders organized by trading pair
Requirements
- Either a valid Client Id from Connect node OR API credentials
- Read permissions on your API key
- You must have created orders with this API key to see results
Error Handling
The node will return specific errors in the following cases:
- ErrListMyOrders - Failed to retrieve open orders from Gate.io
Usage Notes
- Only returns open orders (not filled or cancelled orders)
- Returns orders across all trading pairs
- Orders are grouped by currency pair in the result
- Empty array is returned if you have no open orders
- This is read-only and doesn't require trading permissions
- Historical or filled orders are not included
Best Practices
- Use this node to monitor all your active orders
- Implement order cleanup by cancelling stale orders
- Check for open orders before placing new ones
- Use in loops to continuously monitor order status
- Filter results by currency pair if needed
- Implement order timeout logic based on creation time
- Store order IDs for later cancellation or tracking
Example Usage Scenarios
List All Open Orders
Inputs:
- Client Id: (from Connect node)
Output:
[
{
currency_pair: "BTC_USDT",
total: 2,
orders: [
{ id: "123", side: "buy", amount: "0.001", price: "50000", ... },
{ id: "124", side: "sell", amount: "0.001", price: "55000", ... }
]
},
{
currency_pair: "ETH_USDT",
total: 1,
orders: [
{ id: "125", side: "buy", amount: "0.1", price: "2000", ... }
]
}
]
With Direct Credentials
Inputs:
- Client Id: (empty)
Options:
- Api Key: (your credential)
- Secret Key: (your credential)
Output: Array of open orders without Connect node
Example Flow: Monitor All Orders
[Connect]
|
+-> [List My Orders]
|
+-> [For Each: pair_orders in result]
| |
| +-> [Log: pair_orders.currency_pair]
| +-> [Log: Total Orders: pair_orders.total]
| |
| +-> [For Each: order in pair_orders.orders]
| |
| +-> [Log: Order ID: order.id]
| +-> [Log: Side: order.side, Price: order.price]
|
+-> [Disconnect]
Example Flow: Cancel All Open Orders
[Connect]
|
+-> [List My Orders]
|
+-> [For Each: pair_orders in result]
| |
| +-> [For Each: order in pair_orders.orders]
| |
| +-> [Cancel Order]
| Inputs:
| - Order ID: order.id
| - Currency Pair: pair_orders.currency_pair
|
+-> [Log: All orders cancelled]
|
+-> [Disconnect]
Example Flow: Cancel Old Orders
[Connect]
|
+-> [List My Orders]
|
+-> [Get Current Timestamp]
|
+-> [For Each: pair_orders in result]
| |
| +-> [For Each: order in pair_orders.orders]
| |
| +-> [Calculate: age = current_time - order.create_time]
| |
| +-> [If: age > 1 hour]
| |
| +-> [Cancel Order]
| |
| +-> [Log: Cancelled old order: order.id]
|
+-> [Disconnect]
Example Flow: Count Orders by Type
[Connect]
|
+-> [List My Orders]
|
+-> [Initialize: buy_count = 0, sell_count = 0]
|
+-> [For Each: pair_orders in result]
| |
| +-> [For Each: order in pair_orders.orders]
| |
| +-> [If: order.side = "buy"]
| | +-> [Increment: buy_count]
| |
| +-> [Else]
| +-> [Increment: sell_count]
|
+-> [Log: Total buy orders: buy_count]
+-> [Log: Total sell orders: sell_count]
|
+-> [Disconnect]
Example Flow: Order Status Dashboard
[Schedule: Every 5 Minutes]
|
+-> [Connect]
|
+-> [List My Orders]
|
+-> [Process Data]
| |
| +-> Count total orders
| +-> Group by currency pair
| +-> Calculate total locked value
| +-> Find oldest order
|
+-> [Update Dashboard/Database]
+-> [Send Report if threshold exceeded]
|
+-> [Disconnect]
Understanding the Result Structure
The result is an array where each element represents a currency pair:
[
{
currency_pair: "BTC_USDT", // Trading pair
total: 2, // Number of open orders for this pair
orders: [ // Array of order objects
{
id: "123456", // Order ID
text: "custom-id", // Custom order identifier
create_time: "1234567", // Unix timestamp
update_time: "1234567", // Last update timestamp
currency_pair: "BTC_USDT",
status: "open", // Order status
type: "limit", // Order type
account: "spot", // Account type
side: "buy", // buy or sell
amount: "0.001", // Order amount
price: "50000", // Order price
time_in_force: "gtc", // Time in force
left: "0.001", // Amount not yet filled
filled_total: "0", // Total filled value
fee: "0", // Fee paid
fee_currency: "BTC", // Fee currency
// ... other fields
}
]
}
]
Filtering Orders
Find Orders for Specific Pair
const btcOrders = result.find(p => p.currency_pair === "BTC_USDT");
if (btcOrders) {
console.log(`Found ${btcOrders.total} BTC orders`);
btcOrders.orders.forEach(order => {
console.log(`Order ${order.id}: ${order.side} ${order.amount} at ${order.price}`);
});
}
Find All Buy Orders
const allBuyOrders = [];
result.forEach(pair => {
const buyOrders = pair.orders.filter(o => o.side === "buy");
allBuyOrders.push(...buyOrders);
});
Find Large Orders
const largeOrders = [];
result.forEach(pair => {
pair.orders.forEach(order => {
const value = parseFloat(order.amount) * parseFloat(order.price);
if (value > 1000) { // Orders over $1000
largeOrders.push(order);
}
});
});
Example: Order Management System
[Connect]
|
+-> [List My Orders]
|
+-> [Analyze Orders]
| |
| +-> Find orders with prices far from market
| +-> Find orders older than 24 hours
| +-> Find orders with small amounts
|
+-> [For Each: stale_order]
| |
| +-> [Get Current Price for pair]
| +-> [Calculate: price_diff_percent]
| |
| +-> [If: price_diff > 5%]
| |
| +-> [Cancel Order]
| +-> [Create New Order at better price]
|
+-> [Disconnect]
Common Patterns
Check If Any Orders Exist
const hasOpenOrders = result.length > 0;
const totalOrders = result.reduce((sum, p) => sum + p.total, 0);
Cancel All Orders for a Specific Pair
[List My Orders]
|
+-> [Find: pair = "BTC_USDT"]
|
+-> [For Each: order in pair.orders]
|
+-> [Cancel Order: order.id, "BTC_USDT"]
Order Timeout Logic
[List My Orders]
|
+-> [For Each: pair in result]
|
+-> [For Each: order in pair.orders]
|
+-> [Get Order: order.id] (check detailed status)
+-> [If: not filled after 1 hour]
+-> [Cancel] -> [Place new order]
Related Nodes
- Connect - Establishes the client session needed for this node
- Get Order - Get detailed information about a specific order
- Cancel Order - Cancel orders found by this node
- Buy Order - Create buy orders that appear in this list
- Sell Order - Create sell orders that appear in this list