# Trade Idea

The Trade Ideas endpoint surfaces pair trading baskets from three sources: actively traded pairs, user watchlists, and AI-generated picks from statistical arbitrage analysis.

#### Endpoint

`GET /markets/v2`

Returns baskets enriched with live market data (open interest, 24h volume) for each asset.

#### Basket Categories

| Category    | Source            | Description                                                                  |
| ----------- | ----------------- | ---------------------------------------------------------------------------- |
| `active`    | Platform activity | Pairs traded in the last 24 hours or held in open positions across all users |
| `watchlist` | User-specific     | Pairs saved to the authenticated user's watchlist                            |
| `ai-picks`  | AI                | AI-generated trade ideas                                                     |

#### Response

```json
{
  "baskets": [
    {
      "longAssets": [
        { "asset": "BTC", "weight": 0.6, "oi": 1500000000, "volume": 800000000 },
        { "asset": "ETH", "weight": 0.4, "oi": 900000000, "volume": 500000000 }
      ],
      "shortAssets": [
        { "asset": "SOL", "weight": 0.5, "oi": 300000000, "volume": 200000000 },
        { "asset": "AVAX", "weight": 0.5, "oi": 50000000, "volume": 30000000 }
      ],
      "category": "active"
    },
    {
      "longAssets": [{ "asset": "ETH", "weight": 1, "oi": 900000000, "volume": 500000000 }],
      "shortAssets": [{ "asset": "BTC", "weight": 1, "oi": 1500000000, "volume": 800000000 }],
      "category": "watchlist"
    },
    {
      "longAssets": [{ "asset": "LINK", "weight": 1, "oi": 120000000, "volume": 80000000 }],
      "shortAssets": [{ "asset": "UNI", "weight": 1, "oi": 40000000, "volume": 25000000 }],
      "category": "ai-picks",
      "name": "DeFi Divergence"
    }
  ]
}
```

#### Asset Fields

| Field    | Description                                                   |
| -------- | ------------------------------------------------------------- |
| `asset`  | Asset ticker symbol                                           |
| `weight` | Weight allocation within its side (weights per side sum to 1) |
| `oi`     | Current open interest in USD                                  |
| `volume` | 24-hour trading volume in USD                                 |

#### How Baskets Are Built

**Active baskets** are derived from two sources:

* Recent fills (last 24 hours) — unique long/short pairs extracted from order fills
* All open positions — pairs currently held by any user on the platform

Duplicate pairs across these sources are deduplicated.

**Watchlist baskets** are loaded from the authenticated user's saved watchlist. Only included when the request has a valid user session.

**AI picks** are fetched from an external statistical arbitrage service. Asset names are resolved against supported Hyperliquid assets (including cross-exchange tickers like `xyz:ASSET`). Baskets with unsupported assets are filtered out.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pearprotocol.io/api-integration/trade-idea.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
