List Recent Trades
Retrieves the most recent trades executed on Binance for a specific trading pair.
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.
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 identifier from the Connect node (optional if using direct credentials).
- Currency Pair - The trading pair symbol (e.g.,
BTCUSDT,ETHUSDT,BNBUSDT). - Limit - Maximum number of trades to retrieve (default: 5 if not specified or ≤ 0).
Options
- Api Key - (Optional) Binance API key credential. Use if not providing Client Id.
- Secret Key - (Optional) Binance API secret key credential. Use if not providing Client Id.
Output
- Result - An array of recent trade objects showing execution prices, quantities, and timestamps.
How It Works
The List Recent Trades node retrieves the latest executed trades from the Binance order book.
When executed, the node:
- Retrieves the Binance client (from Client Id or creates one from credentials)
- Validates Currency Pair and Limit inputs
- Queries Binance's recent trades endpoint
- Returns an array of trade records
Requirements
- Either a Client Id from Connect node OR API credentials in options
- Valid trading pair symbol
- Appropriate API permissions (reading enabled)
Error Handling
The node will return specific errors in the following cases:
- ErrInternal - Failed to retrieve input values
- ErrInvalidArg - Empty Currency Pair
- ErrListRecentTrades - Failed to retrieve trades from Binance
- ErrSetResult - Failed to set the output result
Usage Notes
- Returns actual executed trades (market fills)
- Trades are sorted from most recent to oldest
- Includes both buyer and seller initiated trades
- Limit defaults to 5 if not provided or ≤ 0
- Maximum limit is typically 1000
- Useful for analyzing recent price action and volume
Trade Response Structure
Each trade object includes:
{
"id": 123456789,
"price": "50000.50",
"qty": "0.001",
"quoteQty": "50.00",
"time": 1640000000000,
"isBuyerMaker": false,
"isBestMatch": true
}
Trade Fields
- id - Unique trade ID
- price - Execution price
- qty - Quantity traded (base asset)
- quoteQty - Quote asset amount (price × qty)
- time - Execution timestamp (milliseconds)
- isBuyerMaker - If true, buyer placed limit order (maker); if false, buyer used market order (taker)
- isBestMatch - Whether this was the best price match
Example: Get Latest Bitcoin Trades
Scenario: View the most recent 10 BTC trades
Inputs:
- Client Id: (from Connect node)
- Currency Pair:
BTCUSDT - Limit:
10
Output: Array of 10 most recent trade executions.
Example: Real-Time Price from Trades
[Timer: Every 5 seconds]
|
v
[Connect]
|
v
[List Recent Trades]
| Currency Pair: BTCUSDT
| Limit: 1
v
[Extract: latest_price = result[0].price]
|
v
[Display: "Latest BTC trade: $" + latest_price]
|
v
[Disconnect]
Example: Volume Analysis
[Connect]
|
v
[List Recent Trades]
| Currency Pair: ETHUSDT
| Limit: 100
v
[Calculate Volume]
|
v
[Sum: total_volume = sum of all qty]
[Sum: total_value = sum of all quoteQty]
|
v
[Calculate: avg_price = total_value / total_volume]
|
v
[Log: "Last 100 trades:"]
[Log: " Total Volume: " + total_volume + " ETH"]
[Log: " Total Value: $" + total_value]
[Log: " Avg Price: $" + avg_price]
|
v
[Disconnect]
Example: Buy/Sell Pressure
[List Recent Trades]
| Currency Pair: BTCUSDT
| Limit: 50
v
[Analyze Order Flow]
|
v
[Filter: buy_initiated = where !isBuyerMaker]
[Filter: sell_initiated = where isBuyerMaker]
|
v
[Calculate: buy_volume = sum buy_initiated qty]
[Calculate: sell_volume = sum sell_initiated qty]
|
v
[Calculate: buy_pressure = buy_volume / (buy_volume + sell_volume)]
|
v
[If: buy_pressure > 0.6]
|
+---> [Alert: "Strong buying pressure detected"]
|
[Else If: buy_pressure < 0.4]
|
+---> [Alert: "Strong selling pressure detected"]
Example: Price Movement Detection
[List Recent Trades: Limit 20]
|
v
[Extract: first_trade = result[0].price] // Most recent
[Extract: last_trade = result[19].price] // Oldest of the 20
|
v
[Calculate: price_change = first_trade - last_trade]
[Calculate: change_percent = (price_change / last_trade) * 100]
|
v
[If: abs(change_percent) > 0.5]
|
v
[Alert: "Rapid price movement: " + change_percent + "%"]
Understanding isBuyerMaker
isBuyerMaker = false:
- Buyer used market order (taker)
- Aggressive buy
- Price went up to hit ask
- Bullish signal
isBuyerMaker = true:
- Buyer placed limit order (maker)
- Seller hit the bid
- Aggressive sell
- Bearish signal
Analyzing Trade Data
// Calculate volume-weighted average price (VWAP)
const totalValue = trades.reduce((sum, trade) =>
sum + (parseFloat(trade.price) * parseFloat(trade.qty)), 0
);
const totalVolume = trades.reduce((sum, trade) =>
sum + parseFloat(trade.qty), 0
);
const vwap = totalValue / totalVolume;
// Count aggressive buys vs sells
const aggressiveBuys = trades.filter(t => !t.isBuyerMaker).length;
const aggressiveSells = trades.filter(t => t.isBuyerMaker).length;
// Find largest trade
const largestTrade = trades.reduce((max, trade) =>
parseFloat(trade.quoteQty) > parseFloat(max.quoteQty) ? trade : max
);
Use Cases
Price Discovery:
- Get the very latest execution price
- More accurate than ticker for instant price
- See actual trade executions
Volume Analysis:
- Calculate recent trading activity
- Identify volume spikes
- Track participation
Order Flow Analysis:
- Detect buying/selling pressure
- Analyze market aggression
- Identify market sentiment
Trade Confirmation:
- Verify your order execution
- Check if recent trades include yours
- Analyze fill quality
Market Microstructure:
- Study trade patterns
- Analyze price impact
- Understand market dynamics
Trading Tips
- Last Trade Price is the most current price, more real-time than ticker
- High ratio of aggressive buys (isBuyerMaker=false) suggests bullish sentiment
- Large trades can indicate institutional activity
- Trade frequency shows market activity level
- Price clustering at certain levels indicates support/resistance
Best Practices
- Use a reasonable limit (10-100 trades for most analyses)
- Consider timestamp age - trades can happen milliseconds apart or minutes
- Combine with order book data for complete market picture
- Calculate VWAP for better average price estimation
- Monitor isBuyerMaker for sentiment analysis
- Look for unusual patterns (large trades, rapid succession)
- Don't confuse with your own trade history (this shows all market trades)
Calculating Metrics
Volume-Weighted Average Price (VWAP):
const vwap = trades.reduce((sum, t) =>
sum + (parseFloat(t.price) * parseFloat(t.qty)), 0
) / trades.reduce((sum, t) => sum + parseFloat(t.qty), 0);
Buying Pressure:
const buyVolume = trades
.filter(t => !t.isBuyerMaker)
.reduce((sum, t) => sum + parseFloat(t.qty), 0);
const totalVolume = trades
.reduce((sum, t) => sum + parseFloat(t.qty), 0);
const buyingPressure = buyVolume / totalVolume; // 0-1 scale
Trade Frequency:
const oldestTime = trades[trades.length - 1].time;
const newestTime = trades[0].time;
const timeSpan = newestTime - oldestTime; // milliseconds
const tradesPerSecond = trades.length / (timeSpan / 1000);
Common Patterns
Latest Price:
List Recent Trades (limit: 1)
Extract: latest_price = result[0].price
Use as current price
Sentiment Analysis:
List Recent Trades (limit: 50)
Analyze isBuyerMaker distribution
Calculate buy/sell pressure
Make trading decision
Volume Spike Detection:
List Recent Trades (limit: 100)
Calculate average trade size
Find trades > 3x average
Alert on large trades
Difference from Other Price Nodes
| Node | Use Case | Update Speed |
|---|---|---|
| List Recent Trades | Real-time executions | Instant (per trade) |
| Get Price | Average price | ~5 minutes |
| Get Price Change Info | 24h statistics | Continuous |
| List Orders | Order book depth | Real-time quotes |
Performance Considerations
- Recent trades update continuously (new trades every second in active pairs)
- Requesting large limits increases response size
- Consider polling frequency based on your needs
- Cache results briefly if not requiring sub-second updates
- Balance between data freshness and API rate limits