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

# ticker@BASE_QUOTE

> Subscribe to real-time 24-hour ticker statistics for a trading pair

This topic delivers notifications for 24 hour window statistics for a pair (BASE\_QUOTE), and this will happen whenever an order is opened, canceled or a trade happens for the given pair. By default, the system notifies the topic every 30 seconds, even if a transaction has not taken place.

## Subscription Request

<ParamField body="method" type="string" required>
  Subscribe method. Must be `subscribe`
</ParamField>

<ParamField body="topics" type="array" required>
  Array of topics to subscribe to. Format: `ticker@BASE_QUOTE`

  Example: `["ticker@ETH_BRL"]`
</ParamField>

## Stream Response

<ResponseField name="id" type="integer">
  Each WebSocket message includes a sequential numeric id. Each topic has its own unique sequence, and for private topics, the sequence is unique to each topic and user. It's important to note that some topics will send a "welcome message", which will have an id value of -1. Additionally, this sequence may be reset between connections, so be sure to update this value locally whenever you reconnect.
</ResponseField>

<ResponseField name="topic" type="string">
  Topic name (format: `ticker@BASE_QUOTE`)
</ResponseField>

<ResponseField name="timestamp" type="integer">
  Timestamp in milliseconds
</ResponseField>

<ResponseField name="body" type="object">
  Ticker details object

  <Expandable title="Ticker Details">
    <ResponseField name="pair" type="string">
      Trading pair code (e.g., ETH\_BRL)
    </ResponseField>

    <ResponseField name="price_change_percent_24h" type="string">
      24-hour price change percentage (as string)
    </ResponseField>

    <ResponseField name="ask" type="number">
      Current best ask price (lowest sell order)
    </ResponseField>

    <ResponseField name="bid" type="number">
      Current best bid price (highest buy order)
    </ResponseField>

    <ResponseField name="high" type="number">
      Highest price in the last 24 hours
    </ResponseField>

    <ResponseField name="low" type="number">
      Lowest price in the last 24 hours
    </ResponseField>

    <ResponseField name="first" type="number">
      First trade price in the last 24 hours
    </ResponseField>

    <ResponseField name="last" type="number">
      Last trade price (most recent)
    </ResponseField>

    <ResponseField name="volume" type="number">
      Total volume in base currency (24h)
    </ResponseField>

    <ResponseField name="quote_volume" type="number">
      Total volume in quote currency (24h)
    </ResponseField>

    <ResponseField name="trades_quantity" type="integer">
      Total number of trades in the last 24 hours
    </ResponseField>

    <ResponseField name="date" type="string">
      Ticker calculation datetime (ISO 8601 format)
    </ResponseField>

    <ResponseField name="base_code" type="string">
      Base currency code (e.g., ETH)
    </ResponseField>

    <ResponseField name="base_id" type="string">
      Base currency ID (UUID)
    </ResponseField>

    <ResponseField name="quote_code" type="string">
      Quote currency code (e.g., BRL)
    </ResponseField>

    <ResponseField name="quote_id" type="string">
      Quote currency ID (UUID)
    </ResponseField>

    <ResponseField name="conversions" type="array">
      Array of price conversions to other currencies

      <Expandable title="Conversion">
        <ResponseField name="currency_code" type="string">
          Target currency code for conversion
        </ResponseField>

        <ResponseField name="volume" type="number">
          Volume in the target currency
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Subscription Example

```json theme={null}
{
  "method": "subscribe",
  "topics": [
    "ticker@ETH_BRL"
  ]
}
```

## Stream Response Example

```json theme={null}
{
  "id": 6,
  "topic": "ticker@ETH_BRL",
  "timestamp": 1672856683447,
  "body": {
    "ask": 4.01,
    "base_code": "ETH",
    "base_id": "27698137-8178-4395-9841-C1B1505C9352",
    "bid": 5,
    "conversions": [
      {
        "currency_code": "BRL",
        "volume": 0
      },
      {
        "currency_code": "BTC",
        "volume": 0
      },
      {
        "currency_code": "ETH",
        "volume": 0
      },
      {
        "currency_code": "USD",
        "volume": 0
      }
    ],
    "date": "2022-09-28T19:13:40.887Z",
    "first": 10,
    "high": 20,
    "last": 20,
    "low": 20,
    "pair": "ETH_BRL",
    "price_change_percent_24h": "-16.66",
    "quote_code": "BRL",
    "quote_id": "48898138-8623-4555-9468-B1A1505A9352",
    "quote_volume": 600,
    "trades_quantity": 10,
    "volume": 124
  }
}
```

## Multiple Pairs Example

```json theme={null}
{
  "method": "subscribe",
  "topics": [
    "ticker@ETH_BRL",
    "ticker@BTC_BRL",
    "ticker@BTC_USD"
  ]
}
```

## Update Frequency

* **Default**: Every 30 seconds
* **On Change**: Immediately when a trade happens, order is opened/canceled
* **Time Window**: All statistics are for the last 24 hours

## Key Metrics

| Metric             | Description                            |
| ------------------ | -------------------------------------- |
| **Ask/Bid**        | Current market price levels            |
| **Spread**         | Difference between ask and bid         |
| **High/Low**       | Price extremes in 24h period           |
| **First/Last**     | Opening and closing prices (24h)       |
| **Volume**         | Total quantity traded in base currency |
| **Quote Volume**   | Total value traded in quote currency   |
| **Trades Qty**     | Number of individual trades            |
| **Price Change %** | Percentage change from first to last   |

## Calculation Examples

```javascript theme={null}
// Bid-Ask Spread
const spread = ticker.ask - ticker.bid;

// Price Change Percentage
const percentChange = parseFloat(ticker.price_change_percent_24h);

// Average Trade Price
const averagePrice = ticker.quote_volume / ticker.volume;

// Price Range
const priceRange = ticker.high - ticker.low;

// Volatility (simple)
const volatility = priceRange / ticker.last;
```

## Usage Notes

* **24-hour Window**: All metrics reset every 24 hours
* **Real-time Updates**: Statistics update as new trades execute
* **Conversions**: Multiple currency conversions included
* **Volume Metrics**: Both base and quote currency volumes provided
* **Price Stability**: Compare high/low to assess price stability

## Use Cases

* **Real-time Ticker Display**: Show current market prices and 24h stats
* **Technical Analysis**: Use high/low/open/close for candlestick charts
* **Market Overview**: Display key statistics for pair comparison
* **Alert Triggers**: Alert when price change exceeds threshold
* **Trading Decisions**: Use volume and volatility for entry/exit signals
