# metaAndAssetCtxs - HyperCore Info Endpoint

Get the perpetual market metadata and one live asset context per market in a single request. The response uses the public Hyperliquid API shape: `[meta, assetCtxs]`.

Authenticate by including your Dwellir API key in the URL path: `https://api-hyperliquid-mainnet-info.n.dwellir.com/YOUR_API_KEY/info`.

## When to Use This Endpoint

- **Market dashboards**: Show funding, open interest, mark price and 24h volume for every perp in one call.
- **Funding monitors**: Read the current funding rate of each market.
- **HIP-3 markets**: Read the same data for a builder-deployed perp DEX, such as `xyz`.

A raw Hyperliquid node does not serve this type. Dwellir builds the response from node data, so it does not count against the public API's rate limits. Each request is billed as one response.

## Select a DEX

| Request                                   | Response            |
| ----------------------------------------- | ------------------- |
| `{"type":"metaAndAssetCtxs"}`             | Default perp DEX    |
| `{"type":"metaAndAssetCtxs","dex":""}`    | Default perp DEX    |
| `{"type":"metaAndAssetCtxs","dex":"xyz"}` | The HIP-3 DEX `xyz` |

The `dex` value is case-sensitive. Use a name exactly as [perpDexs](https://www.dwellir.com/docs/hyperliquid/perp-dexs) lists it. Every DEX the node lists is served. A name the node does not list returns HTTP 400 `{"error":"unknown dex"}`. The public API answers 500 `null` in that case.

HIP-3 `dex` requests need Hyperliquid L1 gateway 1.14.0 or later. An earlier version answers HTTP 400 for any non-empty `dex`.

With a HIP-3 `dex`, `meta` is that DEX's `meta` response. Its universe names carry the `<dex>:` prefix, such as `xyz:NVDA`, and it includes `marginTables` and `collateralToken`. `assetCtxs` has one context per universe entry of that DEX.

For spot markets, `spotMetaAndAssetCtxs` returns `[spotMeta, spotAssetCtxs]` and ignores `dex`, as the public API does.

## Request Parameters

- `type` (`string, required`): parameter: Must be `"metaAndAssetCtxs"`
- `dex` (`string, optional`): parameter: HIP-3 perp DEX name, case-sensitive, as `perpDexs` lists it. Omit it or send `""` for the default perp DEX.

## Request Example

```bash
curl -X POST "https://api-hyperliquid-mainnet-info.n.dwellir.com/YOUR_API_KEY/info" \
  -H "content-type: application/json" \
  -d '{
  "type": "metaAndAssetCtxs"
}'
```

## Response Fields

- `[0] meta` (`object, required`): The `meta` response for the selected DEX, with `universe`, `marginTables` and `collateralToken`.
- `[1] assetCtxs` (`array, required`): One context per `meta.universe` entry, in universe order.
- `[1] assetCtxs.funding` (`string, required`): Current funding rate. `"0.0"` for a delisted perp.
- `[1] assetCtxs.openInterest` (`string, required`): Open interest. `"0.0"` for a delisted perp.
- `[1] assetCtxs.prevDayPx` (`string, required`): Price 24 hours ago.
- `[1] assetCtxs.dayNtlVlm` (`string, required`): 24h notional volume.
- `[1] assetCtxs.premium` (`string | null, required`): Premium of the impact prices against the oracle price. `null` for a delisted perp, or when impact prices are unavailable.
- `[1] assetCtxs.oraclePx` (`string, required`): Oracle price.
- `[1] assetCtxs.markPx` (`string, required`): Mark price.
- `[1] assetCtxs.midPx` (`string | null, required`): Book midpoint. `null` when the book is not two-sided, for example for a delisted perp.
- `[1] assetCtxs.impactPxs` (`string[] | null, required`): `[bid impact, ask impact]` prices. `null` for a delisted perp, or when impact prices are unavailable.
- `[1] assetCtxs.dayBaseVlm` (`string, required`): 24h volume in base units.

## Successful Response

```json
[
  {
    "universe": [
      {
        "szDecimals": 5,
        "name": "BTC",
        "maxLeverage": 40,
        "marginTableId": 56
      }
    ],
    "marginTables": [
      [
        56,
        {
          "description": "tiered 40x",
          "marginTiers": [
            {
              "lowerBound": "0.0",
              "maxLeverage": 40
            },
            {
              "lowerBound": "150000000.0",
              "maxLeverage": 20
            }
          ]
        }
      ]
    ],
    "collateralToken": 0
  },
  [
    {
      "funding": "0.0000125",
      "openInterest": "39062.57064",
      "prevDayPx": "86411.0",
      "dayNtlVlm": "4178910130.6173682213",
      "premium": "-0.0003196817",
      "oraclePx": "84459.0",
      "markPx": "84431.0",
      "midPx": "84431.5",
      "impactPxs": ["84431.0", "84432.0"],
      "dayBaseVlm": "48990.785"
    }
  ]
]
```

## Error Responses

### Unknown DEX

- Code: `400`
- Description: The node does not list the requested `dex`.

```json
{"error":"unknown dex"}
```

### Invalid JSON body

- Code: `400`
- Description: The request body is not valid JSON.

```json
{"error":"invalid JSON body"}
```

### Not ready

- Code: `503`
- Description: The endpoint is warming up, an input is stale, or the requested HIP-3 DEX is not ready yet. Retry with backoff.

```json
{"error":"asset contexts not ready"}
```

## Availability

The endpoint answers HTTP 503 `{"error":"asset contexts not ready"}` while it warms up after a restart, or while one of its inputs is stale. A HIP-3 DEX that the node lists but that is not ready yet gets the same 503. A HIP-3 DEX never delays the default DEX's response. Retry a 503 with backoff.

## Related Endpoints

- [**meta**](https://www.dwellir.com/docs/hyperliquid/meta): Perpetual market metadata only
- [**perpDexs**](https://www.dwellir.com/docs/hyperliquid/perp-dexs): All deployed perpetual DEXs and their names
- [**activeAssetData**](https://www.dwellir.com/docs/hyperliquid/active-asset-data): Leverage and trade limits for one user and coin
- [**StreamActiveAssetCtx**](https://www.dwellir.com/docs/hyperliquid/stream_active_asset_ctx): Stream the context of one perp over gRPC

***

*Access real-time Hyperliquid market data with Dwellir's HyperCore Info Endpoint. [Get your API key →](https://dashboard.dwellir.com/register)*
