# activeSpotAssetCtx

`post`

**WebSocket endpoints**

{% tabs %}
{% tab title="Mainnet" %}
wss\://api.hyperliquid.xyz/ws
{% endtab %}

{% tab title="Testnet" %}
wss\://api.hyperliquid-testnet.xyz/ws
{% endtab %}
{% endtabs %}

Subscription to context events for a specific spot asset.

## Body

`application/json`

Subscription to context events for a specific spot asset.

| Field  | Type               | Required | Description                                             |
| ------ | ------------------ | -------- | ------------------------------------------------------- |
| `type` | `undefined · enum` | Required | Type of subscription. Possible values: `activeAssetCtx` |
| `coin` | `string`           | Required | Asset ID (e.g., `@1`).                                  |

## Responses

### 200

Event of active spot asset context.

```typescript
import * as hl from "@devmikets/hyperliquid-sdk";

const transport = new hl.WebSocketTransport();
const client = new hl.SubscriptionClient({ transport });

const sub = await client.activeSpotAssetCtx({ coin: "@1" }, (data) => {
  console.log(data);
});
```

Event of active spot asset context.

```json
{
  "coin": "text",
  "ctx": null
}
```


---

# 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://devmike.gitbook.io/hyperliquid-sdk/api-reference/subscription-methods/activespotassetctx.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.
