> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# recentTrades | Hyperliquid info

> The info endpoint with type: "recentTrades" retrieves the most recent public trades for a specific asset on the Hyperliquid exchange.

<Info>
  You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `info` endpoint with `type: "recentTrades"` retrieves the most recent public trades for a specific asset on the Hyperliquid exchange. This endpoint provides real-time trade data including execution prices, quantities, and timing information, making it essential for market analysis, price discovery, and trading decision-making.

## Parameters

### Request body

* `type` (string, required) — The request type. Must be `"recentTrades"` to retrieve recent trades.
* `coin` (string, required) — Asset identifier (simple names like "BTC", "ETH" for perpetuals; spot format like "@107" for spot trades).

## Response

The response is an array of recent trade objects, each representing a completed trade execution:

### Trade data structure

Each trade object contains the following fields:

**Core trade data:**

* `px` — Trade price as a string for precision
* `sz` — Trade size (quantity traded) as a string
* `side` — Trade side: "A" for Ask/Sell, "B" for Bid/Buy
* `time` — Trade timestamp in milliseconds
* `tid` — Unique trade ID

### Data characteristics

**Trade ordering:**

* Trades are returned in reverse chronological order (most recent first)
* Each trade represents a completed market transaction
* Trade IDs are unique and sequential

**Price and size precision:**

* All prices and sizes are returned as strings to maintain precision
* Precision depends on the asset's tick size and lot size requirements
* No rounding or truncation is applied to the original trade data

### Trade interpretation

**Trade sides:**

* `"B"` (Bid/Buy) — Trade executed by a buyer (market buy or aggressive buy)
* `"A"` (Ask/Sell) — Trade executed by a seller (market sell or aggressive sell)
* Side indicates the direction of the aggressive order that initiated the trade

**Market activity indicators:**

* High frequency of trades indicates active market conditions
* Large trade sizes may indicate institutional activity
* Price progression shows market direction and momentum

### Asset identification

**Perpetual contracts:**

* Use simple asset names: "BTC", "ETH", "AVAX", "SOL"
* Represent standard perpetual futures contracts

**Spot markets:**

* Use indexed format: "@107", "@1", etc.
* Index corresponds to the spot pair position in the universe
* Some assets may have remapped names in user interfaces

## Market data analysis

### Price discovery

**Recent price action:**

* Latest trades show current market pricing
* Trade sequence reveals price movement direction
* Price clustering indicates support/resistance levels

**Volume analysis:**

* Trade sizes indicate market participation levels
* Consistent large trades may indicate institutional activity
* Volume distribution shows market depth and liquidity

### Market sentiment

**Buy/sell pressure:**

* Predominance of "B" trades indicates buying pressure
* Predominance of "A" trades indicates selling pressure
* Balance of sides shows market equilibrium

**Trade frequency:**

* High trade frequency indicates active market conditions
* Low frequency may indicate consolidation or low liquidity
* Irregular patterns may indicate news or event-driven activity

## Real-time applications

### Trading signals

**Momentum indicators:**

* Consecutive trades in one direction indicate momentum
* Price acceleration shows strengthening trends
* Volume spikes may precede significant moves

**Liquidity assessment:**

* Trade frequency indicates market liquidity
* Size distribution shows depth of market participation
* Consistent execution suggests stable liquidity conditions

## Example request

<CodeGroup>
  ```shell Shell theme={"system"}
  curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"type": "recentTrades", "coin": "BTC"}' \
    https://api.hyperliquid.xyz/info
  ```

  ```python Python (hyperliquid-python-sdk) theme={"system"}
  from hyperliquid.info import Info
  from hyperliquid.utils import constants

  info = Info(constants.MAINNET_API_URL, skip_ws=True)

  # The SDK has no dedicated recentTrades wrapper, so post the request directly.
  trades = info.post("/info", {"type": "recentTrades", "coin": "BTC"})
  print(trades)
  ```

  ```typescript TypeScript (@nktkas/hyperliquid) theme={"system"}
  import { HttpTransport, InfoClient } from "@nktkas/hyperliquid";

  const transport = new HttpTransport();
  const info = new InfoClient({ transport });

  const trades = await info.recentTrades({ coin: "BTC" });
  console.log(trades);
  ```
</CodeGroup>

## Use cases

The `info` endpoint with `type: "recentTrades"` is essential for applications that need to:

* **Real-time price feeds**: Display current market prices and recent trading activity
* **Market analysis**: Analyze recent trading patterns, volume, and price movements
* **Trading algorithms**: Make trading decisions based on recent market activity and momentum
* **Price discovery**: Understand current market pricing and recent execution levels
* **Liquidity assessment**: Evaluate market liquidity and trading activity levels
* **Market surveillance**: Monitor trading activity for unusual patterns or market manipulation
* **Trading interfaces**: Display recent trades in trading applications and market data feeds
* **Technical analysis**: Analyze short-term price action and trading volume patterns
* **Market making**: Assess recent trading activity to optimize bid-ask spreads and positioning
* **Risk management**: Monitor recent market activity for risk assessment and position management
* **Arbitrage detection**: Identify price discrepancies and trading opportunities across markets
* **Market research**: Study trading behavior, market microstructure, and execution patterns
* **Performance benchmarking**: Compare execution prices against recent market trades
* **Compliance monitoring**: Track trading activity for regulatory compliance and reporting
* **News impact analysis**: Assess market reaction to news events through trading activity
* **Volatility analysis**: Study price volatility and trading intensity patterns
* **Market timing**: Identify optimal entry and exit points based on recent trading activity
* **Quantitative analysis**: Perform statistical analysis on recent trading data
* **Academic research**: Study market dynamics, price formation, and trading behavior
* **Customer analytics**: Analyze customer trading patterns relative to market activity

This endpoint provides essential real-time market data, enabling comprehensive market analysis and trading decision-making on the Hyperliquid platform.


## OpenAPI

````yaml openapi/hyperliquid_node_api/hypercore_info/info_recent_trades.json post /info
openapi: 3.0.0
info:
  title: Hyperliquid Node API - Recent Trades
  version: 1.0.0
servers:
  - url: https://api.hyperliquid.xyz
security: []
paths:
  /info:
    post:
      summary: Retrieve recent trades
      description: >-
        Retrieve the most recent public trades for a specific asset. This
        endpoint provides real-time trade data including price, size, and timing
        information for market analysis.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - coin
              properties:
                type:
                  type: string
                  enum:
                    - recentTrades
                  default: recentTrades
                  description: >-
                    The request type. Must be 'recentTrades' to retrieve recent
                    trades.
                coin:
                  type: string
                  default: BTC
                  description: >-
                    Asset identifier (simple names like 'BTC', 'ETH' for
                    perpetuals; spot format like '@107' for spot trades)
            example:
              type: recentTrades
              coin: BTC
      responses:
        '200':
          description: Successful response with recent trades data
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    px:
                      type: string
                      description: Trade price as a string for precision
                    sz:
                      type: string
                      description: Trade size (quantity traded)
                    side:
                      type: string
                      enum:
                        - A
                        - B
                      description: 'Trade side: ''A'' for Ask/Sell, ''B'' for Bid/Buy'
                    time:
                      type: integer
                      format: int64
                      description: Trade timestamp in milliseconds
                    tid:
                      type: integer
                      format: int64
                      description: Unique trade ID
                  required:
                    - px
                    - sz
                    - side
                    - time
                    - tid
              example:
                - px: '43250.5'
                  sz: '0.1234'
                  side: B
                  time: 1681924499999
                  tid: 118906512037719
                - px: '43248.0'
                  sz: '0.5678'
                  side: A
                  time: 1681924489999
                  tid: 118906512037718

````