# scheduleCancel - Schedule Order Cancellation

Schedule automatic cancellation of all open orders at a specified future time. Acts as a dead-man's switch for trading systems, ensuring orders are cancelled if the system stops responding.

## Sample Data

```json
{
  "signature": {
    "r": "0x716e2f7591f552ba784c39fa3198c71a83fc13d93d206aa650571206149cb747",
    "s": "0x6e021299550e2b71871f3e98acf02c45c4fe5c0a09b4fc1e613db585eb9d0150",
    "v": 28
  },
  "action": {
    "type": "scheduleCancel",
    "time": 1768146928010
  },
  "nonce": 1768146913010
}
```

[View this transaction on Hypurrscan →](https://hypurrscan.io/tx/0x6af694b1b999c8a06c7004332644bd0201680097549ce7720ebf4004789da28b)

## Field Reference

### Action Fields

| Field | Type | Description |
|-------|------|-------------|
| `type` | string | Always `"scheduleCancel"` |
| `time` | number | UTC timestamp (milliseconds) when orders should be cancelled |

## Dead-Man's Switch Pattern

Trading systems typically:

1. Submit orders with `scheduleCancel` set to T+N seconds
2. Continuously extend the cancellation time while operating normally
3. If the system fails, orders automatically cancel at the scheduled time

This prevents orphaned orders from remaining on the book if a trading bot crashes.

## Use Cases

### Risk Management Monitoring

Track how traders implement fail-safes:

```python
def process_scheduleCancel_action(action):
    cancel_time = action.get('time')
    if cancel_time:
        from datetime import datetime
        cancel_dt = datetime.fromtimestamp(cancel_time / 1000)
        print(f"Orders scheduled to cancel at {cancel_dt}")
```

### Bot Health Detection

Monitor schedule cancel extensions as a proxy for bot health.

### Market Stability Analysis

Track how many orders have dead-man switches configured.

## Related Action Types

- [order](https://www.dwellir.com/docs/hyperliquid/order) - Submit orders
- [cancel](https://www.dwellir.com/docs/hyperliquid/cancel) - Immediate order cancellation
- [cancelByCloid](https://www.dwellir.com/docs/hyperliquid/cancelByCloid) - Cancel by client order ID
