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

> ## Agent Instructions
> API requests use the base URL https://api.unusualwhales.com and require a bearer token in the `Authorization` header (`Authorization: Bearer <API_KEY>`). Create and manage API tokens at https://unusualwhales.com/dashboard/api.
> For live market data inside an AI tool, use the Unusual Whales MCP server at https://unusualwhales.com/public-api/mcp.
> Instructions for agents using Unusual Whales tools: https://unusualwhales.com/skill.md

# live-gex

> Live gamma exposure keyed by different aggregation levels: ticker, strike, strike+expiry

Topic
messages**3**
routing**message key**
encoding**protobuf**

## Messages on this topic

[gex-strike-expiry-v2
GexStrikeExpiry
Greek exposures for a single strike and expiry.
33 fields→](/docs/kafka/types/GexStrikeExpiry.md)

[gex-strike-v2
GexStrike
Greek exposures for a single strike, aggregated across all expiries.
32 fields→](/docs/kafka/types/GexStrike.md)

[gex-ticker-v2
Gex
Ticker-level greek exposures, expressed as the \$ value of hedging required when the underlying moves one percent.
14 fields→](/docs/kafka/types/Gex.md)

The message type is determined by the Kafka message key.

## Consume the topic

```python Python theme={null}
from confluent_kafka import Consumer
from unusualwhales.schema_pb2 import Gex, GexStrike, GexStrikeExpiry

# The record key selects the message type.
BY_KEY = {
    b"gex-strike-expiry-v2": GexStrikeExpiry,
    b"gex-strike-v2": GexStrike,
    b"gex-ticker-v2": Gex,
}

# CONFIG comes from the Connecting section of the Kafka overview.
consumer = Consumer(CONFIG | {"group.id": "my-live-gex-consumer"})
consumer.subscribe(["live-gex"])

while True:
    msg = consumer.poll(1.0)
    if msg is None or msg.error():
        continue

    message_type = BY_KEY.get(msg.key())
    if message_type is None:
        continue

    event = message_type()
    event.ParseFromString(msg.value())
    print(event)
```
