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

# Asset contexts

> Hyperliquid's metaAndAssetCtxs with history: mark, oracle and mid prices, funding and open interest for every coin in a dex, one snapshot per minute

This endpoint serves Hyperliquid's `metaAndAssetCtxs` from Allium's realtime store and adds history. Each snapshot holds every coin in the dex with its mark price, oracle price, mid price, funding, open interest, premium, previous-day price and 24-hour notional volume.

<Info>
  **Drop-in with history**

  The body Hyperliquid accepts, `{"type": "metaAndAssetCtxs", "dex": ""}`, returns the latest complete snapshot, typically two to three minutes behind the exchange. Add `startTime` and `endTime` to get one snapshot per `interval` across the window. The Snowflake table `hyperliquid.raw.perpetual_market_asset_contexts` carries the same data 30 to 60 minutes later.

  The `universe` half of Hyperliquid's response is not included, so each asset context carries `coin` and `timestamp`, and `maxLeverage` is folded in. `impactPxs` is `null` for now.
</Info>

<Warning>
  **Limits**

  `startTime` and `endTime` must be given together and may span at most 30 days. Without a `coin` filter a request may cover at most 60 snapshots, about one hour at `1m`; with `coin` it may cover 2000. Requests over the limit are rejected with `400`, never truncated.

  History is available from 14 January 2026. Earlier windows return an empty array.
</Warning>

## Response shape

An array of snapshots ascending by `timestamp`. Each snapshot is an array of asset contexts ascending by `coin`, one per coin in the dex, or a single element when `coin` is given.

## Buckets and paging

Both `startTime` and `endTime` are rounded down to `interval` boundaries, so every returned snapshot is a complete bucket holding each coin's last sample in it. The bucket in progress is never returned; for the freshest value use `1m` or omit the times. A window that contains no complete bucket after rounding is rejected with `400`. To page a long range, pass the previous request's `endTime` as the next request's `startTime`; consecutive pages tile exactly, with identical values to a single request.

HIP-3 builder markets can be addressed with `"dex": "xyz"` for the whole dex, or filtered with `"coin": "xyz:XYZ100"` or `"coin": "XYZ100", "dex": "xyz"`. The response always uses the prefixed form, matching Hyperliquid.


## OpenAPI

````yaml _openapi/go-src-api.json POST /api/v1/developer/trading/hyperliquid/info/assetctxs
openapi: 3.0.3
info:
  title: Hyperliquid API Server
  description: API server for Hyperliquid trading data including orders and fills
  version: 1.0.0
servers:
  - url: https://api.allium.so
    description: Production server
security: []
paths:
  /api/v1/developer/trading/hyperliquid/info/assetctxs:
    post:
      summary: Asset contexts (metaAndAssetCtxs) with history
      description: >-
        Hyperliquid's metaAndAssetCtxs served from Allium's realtime store, with
        history. The same body Hyperliquid accepts
        ({"type":"metaAndAssetCtxs","dex":""}) returns the latest snapshot; add
        startTime and endTime for a series of snapshots at the chosen interval.
        Each snapshot is an array of per-coin asset contexts in Hyperliquid's
        field names plus timestamp and coin; the universe half of Hyperliquid's
        response is not included. This is the realtime counterpart of the
        Snowflake table hyperliquid.raw.perpetual_market_asset_contexts.
      operationId: getAssetCtxs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HyperliquidGetAssetCtxsRequest'
            example:
              type: metaAndAssetCtxs
              dex: ''
              startTime: 1757340000000
              endTime: 1757340180000
              interval: 1m
      responses:
        '200':
          description: >-
            Array of snapshots ascending by timestamp; each snapshot is an array
            of asset contexts ascending by coin. Empty array when there is no
            data.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: array
                  items:
                    $ref: '#/components/schemas/HyperliquidAssetCtx'
        '400':
          description: >-
            Bad request - unknown type, startTime without endTime (or vice
            versa), startTime not before endTime, span over 30 days, a window
            with no complete bucket after rounding, more than 60 snapshots
            without a coin filter or more than 2000 buckets with one, or
            unsupported interval
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Internal server error
          content:
            text/plain:
              schema:
                type: string
      security:
        - APIKeyBearer: []
components:
  schemas:
    HyperliquidGetAssetCtxsRequest:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - metaAndAssetCtxs
          description: Request type. Same as Hyperliquid's.
        dex:
          type: string
          description: >-
            Builder DEX name for HIP-3 markets, e.g. xyz. Omit or pass an empty
            string for core perps.
        coin:
          type: string
          description: >-
            Optional filter to one market. Hyperliquid's prefixed form for HIP-3
            markets, e.g. xyz:XYZ100, or the bare coin with dex set. Omit for
            every coin in the dex.
        startTime:
          type: integer
          format: int64
          description: >-
            Window start, inclusive (Unix ms). Rounded down to the bucket
            boundary of the chosen interval. Omit both times for the latest
            snapshot.
        endTime:
          type: integer
          format: int64
          description: >-
            Window end, exclusive (Unix ms). Rounded down to the bucket
            boundary, so only complete buckets are returned. Span at most 30
            days; at most 60 snapshots without a coin filter, 2000 with one; the
            rounded window must contain at least one bucket.
        interval:
          type: string
          enum:
            - 1m
            - 5m
            - 15m
            - 1h
            - 4h
            - 1d
          default: 1m
          description: >-
            Snapshot spacing. Each coin's last sample in the bucket is returned.
            Ignored when times are omitted.
    HyperliquidAssetCtx:
      type: object
      description: >-
        One coin's asset context at one snapshot. Field names match
        Hyperliquid's metaAndAssetCtxs; timestamp and coin are added because the
        universe half of Hyperliquid's response is not included. Prices are
        decimal strings.
      properties:
        timestamp:
          type: integer
          format: int64
          description: Snapshot time (Unix ms, UTC).
        coin:
          type: string
          description: >-
            Coin in Hyperliquid's form, e.g. BTC, or xyz:XYZ100 for HIP-3
            markets.
        dayNtlVlm:
          type: string
          nullable: true
          description: Rolling 24-hour notional volume.
        funding:
          type: string
          nullable: true
          description: Current funding rate.
        impactPxs:
          type: array
          items:
            type: string
          nullable: true
          description: '[bid, ask] impact prices. Currently always null; not yet persisted.'
        markPx:
          type: string
          description: Mark price.
        midPx:
          type: string
          nullable: true
          description: Mid price. Null for bookless markets.
        openInterest:
          type: string
          nullable: true
          description: Open interest in base units.
        oraclePx:
          type: string
          nullable: true
          description: Oracle price.
        premium:
          type: string
          nullable: true
          description: Premium of mark over oracle.
        prevDayPx:
          type: string
          nullable: true
          description: Price 24 hours earlier.
        maxLeverage:
          type: integer
          nullable: true
          description: Maximum leverage for the market (from Hyperliquid's universe).
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````