POST https://api.hyperliquid.xyz/exchange. Use cDeposit to move native tokens from the userโs spot account into staking, then use tokenDelegate to delegate or undelegate those staked tokens to or from a specific validator. The agent-signed variant cDeposit2 is the agent-signed version of the staking deposit action.
The examples below are request shapes based on the official Hyperliquid exchange endpoint documentation, not live test outputs. As of 2026-11-16, the docs describe these actions as follows.
Endpoint and common fields
All three actions use the same endpoint:
POST https://api.hyperliquid.xyz/exchange
Required header:
| Header | Value |
|---|---|
Content-Type | application/json |
| Field | Type | Notes |
|---|---|---|
action | Object | Action-specific object described below. |
nonce | Number | Recommended value is the current timestamp in milliseconds. |
signature | Object | Required. The docs point to the Python SDK for signature generation. |
expiresAfter | Number | Optional timestamp in milliseconds where supported. cDeposit2 lists this field. |
cDeposit and tokenDelegate, the nonce inside the action object must match the outer nonce.
cDeposit: deposit native tokens into staking
cDeposit transfers native tokens from the userโs spot account into staking for delegating to validators. It does not select a validator; use tokenDelegate afterward.
Required action fields
| Field | Type | Description |
|---|---|---|
type | String | cDeposit. |
hyperliquidChain | String | Mainnet on mainnet, or Testnet on testnet. |
signatureChainId | String | Chain ID used when signing, in hexadecimal format. Example: 0xa4b1 for Arbitrum. |
wei | Number | Amount of wei to transfer. |
nonce | Number | Current timestamp in milliseconds; must match the outer nonce. |
Example request shape
{
"action": {
"type": "cDeposit",
"hyperliquidChain": "Mainnet",
"signatureChainId": "0xa4b1",
"wei": 1000000000000000000,
"nonce": 1763300000000
},
"nonce": 1763300000000,
"signature": "<generated signature object>"
}
cDeposit2: agent-signed staking deposit
cDeposit2 is similar to cDeposit, but can be signed by an agent. The action object is smaller: it includes only type and wei.
Required action fields
| Field | Type | Description |
|---|---|---|
type | String | cDeposit2. |
wei | Number | Amount of wei to transfer. |
nonce and signature, and may include optional expiresAfter.
Example request shape
{
"action": {
"type": "cDeposit2",
"wei": 1000000000000000000
},
"nonce": 1763300000000,
"signature": "<generated signature object>",
"expiresAfter": 1763300060000
}
If you are using an agent wallet, see the Hyperliquid API Agent Wallet Setup & Permissions guide for the broader agent-wallet setup context.
Like what you're reading? Try it yourself โ this link supports ChartedTrader at no cost to you.
Create a Hyperliquid account โtokenDelegate: delegate or undelegate to a validator
tokenDelegate delegates or undelegates native tokens to or from a validator. The docs state that delegations to a particular validator have a lockup duration of 1 day.
Required action fields
| Field | Type | Description |
|---|---|---|
type | String | tokenDelegate. |
hyperliquidChain | String | Mainnet on mainnet, or Testnet on testnet. |
signatureChainId | String | Chain ID used when signing, in hexadecimal format. Example: 0xa4b1 for Arbitrum. |
validator | String | Validator address in 42-character hexadecimal format. |
isUndelegate | Boolean | false to delegate, true to undelegate. |
wei | Number | Amount of wei to delegate or undelegate. |
nonce | Number | Current timestamp in milliseconds; must match the outer nonce. |
Example request shape
{
"action": {
"type": "tokenDelegate",
"hyperliquidChain": "Mainnet",
"signatureChainId": "0xa4b1",
"validator": "0x0000000000000000000000000000000000000000",
"isUndelegate": false,
"wei": 1000000000000000000,
"nonce": 1763300000000
},
"nonce": 1763300000000,
"signature": "<generated signature object>"
}
Deposit into staking vs delegate to a validator
| Action | Purpose | Validator selected? | Main fields |
|---|---|---|---|
cDeposit | Move native tokens from spot into staking. | No. | wei, hyperliquidChain, signatureChainId, nonce. |
cDeposit2 | Agent-signed version of the staking deposit. | No. | wei. |
tokenDelegate | Delegate or undelegate staked native tokens to/from a validator. | Yes. | validator, isUndelegate, wei, hyperliquidChain, signatureChainId, nonce. |
cDeposit or cDeposit2 first makes native tokens available in staking, and tokenDelegate then assigns or removes delegation to a chosen validator.
Expected response shape
The docs show the same successful response shape for these actions:
{
"status": "ok",
"response": {
"type": "default"
}
}
The documentation examples use Python-style single-quoted dictionaries; the JSON equivalent is the same structure with double-quoted keys and string values.
Related staking action
To move native tokens from staking back into the userโs spot account, use cWithdraw. The docs note that transfers from staking to the spot account go through a 7-day unstaking queue. See Hyperliquid cWithdraw: Withdraw Native Tokens From Staking for that action.
Affiliate disclosure
This article includes a Hyperliquid referral link. If you sign up through the link, supa.is may receive a commission. The linked account may receive a 4% fee discount on the first $25M of volume; Vaults and sub-accounts are excluded.
Continue with Hyperliquid
Browse the Hyperliquid guide hub for the complete user journey.