Skip to main content

List Pairs

Retrieves all available cryptocurrency trading pairs on Gate.io exchange. Essential for discovering tradeable pairs, validating pair names, and building multi-pair trading 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​

This node has no inputs. It retrieves all available trading pairs.

Output​

  • Result - An array of currency pair objects, where each object contains:
    • id - Trading pair identifier (e.g., BTC_USDT)
    • base - Base currency (e.g., BTC)
    • quote - Quote currency (e.g., USDT)
    • fee - Trading fee percentage
    • min_base_amount - Minimum order amount in base currency
    • min_quote_amount - Minimum order amount in quote currency
    • amount_precision - Decimal precision for amount
    • precision - Price decimal precision
    • trade_status - Trading status (tradable, untradable, etc.)
    • And other pair-specific fields

How It Works​

The List Pairs node executes the following steps:

  1. Creates a new Gate.io client (no authentication required)
  2. Queries the Gate.io API for all currency pairs
  3. Returns the complete list of trading pair configurations

Requirements​

  • No authentication required (this is public market data)
  • No inputs needed

Error Handling​

The node will return specific errors in the following cases:

  • ErrListCurrency - Failed to retrieve currency pairs from Gate.io API

Usage Notes​

  • This retrieves public data (no authentication needed)
  • Returns all pairs regardless of trading status
  • Check trade_status field to verify if pair is actively tradable
  • Data includes minimum order sizes and precision requirements
  • Result can contain hundreds of trading pairs
  • Use filtering to find specific pairs of interest
  • Trading rules (min amounts, precision) are crucial for order placement

Best Practices​

  • Cache the results to reduce API calls (pairs don't change frequently)
  • Filter by trade_status = "tradable" for active pairs
  • Use min_base_amount and min_quote_amount to validate order sizes
  • Check precision fields to format prices correctly
  • Filter by quote currency to find all pairs trading against USDT, BTC, etc.
  • Validate user-provided pair names against this list
  • Use for discovering new trading opportunities

Example Usage Scenarios​

List All Trading Pairs​

Inputs: (none)

Output:
[
{
id: "BTC_USDT",
base: "BTC",
quote: "USDT",
fee: "0.2",
min_base_amount: "0.00001",
min_quote_amount: "1",
amount_precision: 8,
precision: 2,
trade_status: "tradable",
...
},
{
id: "ETH_USDT",
base: "ETH",
quote: "USDT",
...
},
...
]

Example Flow: Find All USDT Pairs​

[List Pairs]
|
+-> [Filter]
|
+-> [For Each: pair in result]
|
+-> [If: pair.quote = "USDT" AND pair.trade_status = "tradable"]
|
+-> [Add to: usdt_pairs array]
|
[Log: Found X tradable USDT pairs]
[Store: usdt_pairs]

Example Flow: Validate Trading Pair​

[Set: user_pair = "BTC_USDT"]
|
[List Pairs]
|
+-> [Find: pair where pair.id = user_pair]
|
+-> [If: found]
| |
| +-> [Check: pair.trade_status = "tradable"]
| | |
| | +-> True: [Log: Pair is valid and tradable]
| | +-> False: [Error: Pair exists but not tradable]
| |
| +-> [Store: pair.min_base_amount, pair.precision]
|
+-> [Else: Error: Invalid pair name]

Example Flow: Multi-Pair Price Monitor​

[List Pairs]
|
+-> [Filter: quote = "USDT", trade_status = "tradable"]
| |
| +-> [Sort by: 24h volume (if available)]
| +-> [Take: top 10 pairs]
|
+-> [For Each: pair in top_pairs]
|
+-> [Get Price: pair.id]
+-> [Store: prices[pair.id] = price data]
|
[Generate Price Report]

Example Flow: Discover New Listings​

[Schedule: Daily]
|
+-> [List Pairs]
| |
| +-> [Store: current_pairs]
|
+-> [Compare with: yesterday_pairs]
|
+-> [Find: new_pairs = current - yesterday]
|
+-> [If: new_pairs.length > 0]
|
+-> [For Each: pair in new_pairs]
| |
| +-> [Send Alert: New pair listed: pair.id]
|
+-> [Store: current_pairs as yesterday_pairs]

Example Flow: Build Trading Universe​

[List Pairs]
|
+-> [Filter Criteria]
|
+-> trade_status = "tradable"
+-> quote in ["USDT", "BTC"]
+-> min_quote_amount <= max_investment
|
[Store: trading_universe]
|
[For Each: pair in trading_universe]
|
+-> [Get Price]
+-> [Calculate metrics]
+-> [Score for trading potential]

Understanding Pair Configuration​

Critical Fields​

id: Trading pair identifier

pair.id = "BTC_USDT" // Use this for all trading operations

Base and Quote

pair.base = "BTC" // What you're buying/selling
pair.quote = "USDT" // What you're paying/receiving

Minimum Order Sizes

pair.min_base_amount = "0.00001" // Minimum BTC to trade
pair.min_quote_amount = "1" // Minimum USDT value

Precision

pair.precision = 2 // Price has 2 decimal places
pair.amount_precision = 8 // Amount has 8 decimal places

Trading Status

pair.trade_status = "tradable" // Can trade
pair.trade_status = "untradable" // Cannot trade

Filtering Examples​

Find All Pairs for a Specific Base Currency​

const btcPairs = result.filter(p => p.base === "BTC");
// Returns: BTC_USDT, BTC_USD, BTC_EUR, etc.

Find All Pairs Quoting in USDT​

const usdtPairs = result.filter(p => p.quote === "USDT");
// Returns: BTC_USDT, ETH_USDT, GT_USDT, etc.

Find Tradable Pairs Only​

const tradablePairs = result.filter(p => p.trade_status === "tradable");

Find Pairs with Low Minimum Investment​

const lowMinPairs = result.filter(p => {
return parseFloat(p.min_quote_amount) <= 10; // $10 minimum
});

Example: Validate Order Parameters​

[List Pairs]
|
+-> [Find: pair = "BTC_USDT"]
|
[User wants to buy: amount = 0.00005 BTC at price = 50000.123]
|
[Validate]
|
+-> [Check: amount >= pair.min_base_amount]
| +-> 0.00005 >= 0.00001 ✓
|
+-> [Check: amount * price >= pair.min_quote_amount]
| +-> 0.00005 * 50000.123 = 2.5 >= 1 ✓
|
+-> [Check: price precision]
| +-> Round to pair.precision (2 decimals)
| +-> 50000.123 -> 50000.12
|
+-> [Check: amount precision]
| +-> Round to pair.amount_precision (8 decimals)
| +-> 0.00005 already valid
|
[Place Order with validated parameters]

Building a Pair Lookup Function​

// Store pairs for quick lookup
const pairMap = {};
result.forEach(pair => {
pairMap[pair.id] = pair;
});

// Quick lookup
function validatePair(pairId) {
const pair = pairMap[pairId];
if (!pair) {
throw new Error(`Pair ${pairId} not found`);
}
if (pair.trade_status !== "tradable") {
throw new Error(`Pair ${pairId} is not tradable`);
}
return pair;
}

function validateOrderSize(pairId, amount, price) {
const pair = validatePair(pairId);

if (parseFloat(amount) < parseFloat(pair.min_base_amount)) {
throw new Error(`Amount below minimum ${pair.min_base_amount}`);
}

const quoteAmount = parseFloat(amount) * parseFloat(price);
if (quoteAmount < parseFloat(pair.min_quote_amount)) {
throw new Error(`Order value below minimum ${pair.min_quote_amount}`);
}

return true;
}

Common Use Cases​

1. Pair Validation​

Validate user-provided pair names before trading

2. Order Size Validation​

Check minimum order requirements before placing orders

3. Price Formatting​

Use precision settings to format prices correctly

4. Market Discovery​

Find new or high-volume trading pairs

5. Multi-Pair Strategies​

Build trading strategies across multiple pairs

6. Fee Comparison​

Compare trading fees across different pairs

  • Get Price - Get price data for pairs discovered by this node
  • Buy Order - Use pair configuration to validate order parameters
  • Sell Order - Use pair configuration to validate order parameters
  • List Orders - Analyze order book for discovered pairs