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

# Schedule cancel | Hyperliquid exchange

> Schedules an automatic cancel-all operation at a future time, acting as a dead man's switch for risk management. On Hyperliquid exchange.

<Info>
  You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

<Note>
  This endpoint requires signature authentication. See our comprehensive [Authentication via Signatures guide](/docs/hyperliquid-authentication-guide) for implementation details.
</Note>

Schedules an automatic cancel-all operation at a future time, acting as a dead man's switch for risk management. This safety feature ensures all open orders are canceled if your trading system becomes unresponsive.

## Parameters

### Required parameters

* `action` (object, required) — The schedule cancel action object containing:
  * `type` (string) — Must be `"scheduleCancel"`
  * `time` (number, optional) — Unix timestamp in milliseconds when to cancel all orders. Omit to remove existing scheduled cancel

* `nonce` (number, required) — Current timestamp in milliseconds (must be recent)

* `signature` (object, required) — EIP-712 signature of the action

### Optional parameters

* `vaultAddress` (string, optional) — Address when trading on behalf of a vault or subaccount
* `expiresAfter` (number, optional) — Timestamp in milliseconds after which the request is rejected

## Returns

Returns an object with scheduling status:

* `status` — `"ok"` if request processed
* `response` — Contains operation details:
  * `type` — `"scheduleCancel"`

## Scheduling rules

* **Minimum delay** — Scheduled time must be at least 5 seconds in the future
* **Daily limit** — Maximum 10 triggers per day (resets at 00:00 UTC)
* **Cancel operation** — Omit the `time` parameter to remove an existing scheduled cancel
* **Auto-execution** — When triggered, cancels all open orders for the user

## Example request

<CodeGroup>
  ```shell cURL theme={"system"}
  # Schedule cancel in 60 seconds
  curl -X POST https://api.hyperliquid.xyz/exchange \
    -H "Content-Type: application/json" \
    -d '{
      "action": {
        "type": "scheduleCancel",
        "time": 1234567950123
      },
      "nonce": 1234567890123,
      "signature": {...}
    }'

  # Remove scheduled cancel
  curl -X POST https://api.hyperliquid.xyz/exchange \
    -H "Content-Type: application/json" \
    -d '{
      "action": {
        "type": "scheduleCancel"
      },
      "nonce": 1234567890123,
      "signature": {...}
    }'
  ```

  ```python Python theme={"system"}
  from hyperliquid.exchange import Exchange
  from hyperliquid.utils import constants
  import eth_account
  import time

  # Initialize with your private key
  account = eth_account.Account.from_key("0x...")
  exchange = Exchange(account, constants.MAINNET_API_URL)

  # Schedule cancel in 60 seconds
  future_time = int((time.time() + 60) * 1000)
  schedule_result = exchange.schedule_cancel(time=future_time)

  # Remove scheduled cancel
  remove_result = exchange.schedule_cancel(time=None)

  print(schedule_result)
  ```

  ```typescript TypeScript theme={"system"}
  import { ExchangeClient, HttpTransport } from "@nktkas/hyperliquid";
  import { privateKeyToAccount } from "viem/accounts";

  // Initialize with your private key
  const wallet = privateKeyToAccount("0x...");
  const transport = new HttpTransport();
  const exchange = new ExchangeClient({ transport, wallet });

  // Schedule cancel in 60 seconds
  const scheduleResult = await exchange.scheduleCancel({ time: Date.now() + 60_000 });

  // Remove scheduled cancel
  const removeResult = await exchange.scheduleCancel();

  console.log(scheduleResult);
  ```
</CodeGroup>

## Response example

```json theme={"system"}
{
  "status": "ok",
  "response": {
    "type": "scheduleCancel"
  }
}
```

## Use cases

* **System failure protection** — Automatically cancel orders if your trading system crashes
* **Connection loss safety** — Protect against network disconnections
* **Daily trading limits** — Schedule end-of-day order cleanup
* **Risk management** — Implement automatic position closure during maintenance

## Best practices

1. **Regular heartbeats** — Continuously push the scheduled cancel forward while your system is healthy
2. **Buffer time** — Set cancellation time with enough buffer (e.g., 30-60 seconds)
3. **Monitor triggers** — Track your daily trigger count to avoid hitting the limit
4. **Graceful shutdown** — Remove scheduled cancels when intentionally stopping your system

<Note>
  The dead man's switch is a critical safety feature. Always implement it in production trading systems to prevent orders from remaining open during system failures.
</Note>

<Warning>
  Remember the 10 triggers per day limit. If you hit this limit, you won't be able to use the scheduled cancel feature until 00:00 UTC. Plan your heartbeat intervals accordingly.
</Warning>


## OpenAPI

````yaml openapi/hyperliquid_node_api/hypercore_exchange/exchange_schedule_cancel.json post /exchange
openapi: 3.0.0
info:
  title: Hyperliquid Exchange API
  version: 1.0.0
  description: >-
    API for trading operations on Hyperliquid exchange requiring authentication.
    ⚠️ WARNING: These endpoints require EIP-712 signatures for authentication.
    The example values provided will NOT work without proper cryptographic
    signing. You must implement EIP-712 signing to use these endpoints
    successfully.
servers:
  - url: https://api.hyperliquid.xyz
security: []
paths:
  /exchange:
    post:
      tags:
        - hyperliquid exchange
      summary: Schedule cancel (dead man's switch)
      operationId: scheduleCancel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: object
                  properties:
                    type:
                      type: string
                      default: scheduleCancel
                      enum:
                        - scheduleCancel
                      description: Action type for scheduling automatic cancellation
                    time:
                      type: integer
                      description: >-
                        Unix timestamp in milliseconds when to cancel all
                        orders. Omit to remove existing scheduled cancel
                  required:
                    - type
                nonce:
                  type: integer
                  description: Current timestamp in milliseconds
                signature:
                  type: object
                  description: EIP-712 signature of the action with r, s, v components
                  properties:
                    r:
                      type: string
                      description: ECDSA signature r component (hex string)
                      example: >-
                        0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
                    s:
                      type: string
                      description: ECDSA signature s component (hex string)
                      example: >-
                        0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321
                    v:
                      type: integer
                      description: ECDSA recovery id (27 or 28)
                      example: 27
                  required:
                    - r
                    - s
                    - v
                vaultAddress:
                  type: string
                  description: >-
                    Address when trading on behalf of a vault or subaccount
                    (optional)
                  nullable: true
                expiresAfter:
                  type: integer
                  description: >-
                    Timestamp in milliseconds after which the request is
                    rejected (optional)
              required:
                - action
                - nonce
                - signature
            example:
              action:
                type: scheduleCancel
                time: 1705234867890
              nonce: 1705234567890
              signature:
                r: >-
                  0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
                s: >-
                  0xfedcba0987654321fedcba0987654321fedcba0987654321fedcba0987654321
                v: 27
              vaultAddress: null
      responses:
        '200':
          description: Schedule cancel result
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Request status
                  response:
                    type: object
                    properties:
                      type:
                        type: string
                        default: scheduleCancel
                example:
                  status: ok
                  response:
                    type: scheduleCancel

````