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

# Hyperliquid

> Unified API + Hyperliquid Integration Workflow

In the following guide, the integration process for the `hyperliquid` chain is covered. The Hyperliquid integration aligns with the general Unified API process but with network-specific parameters.

[Get an authentication token](/docs/authentication) to start using the Unified API.

Request examples are provided using [cURL](https://curl.se/).

> To check the integration guides for other chains, refer to the [Networks Supported](/docs/unified-api-networks) section.

<Note>
  **Key Hyperliquid-specific details**

  * `chain` — always set to `hyperliquid` for Hyperliquid-related requests.
  * `network` — environment in which the transaction is processed: `testnet` or `mainnet`.
  * `stakerAddress` — 0x-prefixed account address initiating delegation, undelegation, or withdrawal operations.
  * `amount`— amount of tokens in HYPE.
  * `signature` — delegator account signature, required for broadcasting transactions.
</Note>

## Staking flow

### 1. Create staking request

To delegate HYPE tokens from the staking balance to the P2P validator, send a POST request to [/api/v1/unified/staking/stake](/reference/unified-create-stake-transaction). Note that delegations have a lock-up period of 1 day, which means that delegations can be partially or fully undelegated only after this period expiration.

Example request (for `testnet` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/staking/stake \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "hyperliquid",
      "network": "testnet",
      "stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
      "amount": 10
  }'
  ```
</CodeGroup>

* `chain`— blockchain network, always set to `hyperliquid` for Hyperliquid-related requests.
* `network` — environment in which the transaction is processed: `testnet` or `mainnet`.
* `stakerAddress` — 0x-prefixed account address initiating the delegate transaction.
* `amount` — amount of tokens to delegate in HYPE.

Example response:

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "amount": 10,
          "stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
          "unsignedTransactionData": "eyJhY3Rpb24iOnsidHlwZSI6InRva2VuRGVsZWdhdGUiLCJoeXBlcmxpcXVpZENoYWluIjoiVGVzdG5ldCIsInNpZ25hdHVyZUNoYWluSWQiOiIweDY2ZWVlIiwid2VpIjoxMDAwMDAwMCwibm9uY2UiOjE3NTUwOTQ3MTQ1OTMsInZhbGlkYXRvciI6IjB4YTAxMmI5MDQwZDgzYzVjYmFkOWU2ZWE3M2M1MjUwMjdiNzU1ZuU5NiIsImlzVW5kZWxlZ2F0ZSI6ZmFsc2V9LCJub25jZSI6MTc1NTA5NDcxNDU5Mywic2lnbmF0dXJlIjp7fX0=",
          "createdAt": "2025-08-01T00:00:00.000Z"
      }
  }
  ```
</CodeGroup>

* `amount` — amount of tokens to delegate in HYPE.
* `stakerAddress` — staking account address receiving the delegated tokens.
* `unsignedTransactionData` — unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action.
* `createdAt` — timestamp of the transaction in the ISO 8601 format.

### 2. Sign and send transaction

Use `unsignedTransactionData` to [sign](/docs/unified-api-signing-transaction) the transaction using the Hyperliquid-specific signing logic.

To broadcast the signed transaction to the Hyperliquid network, send a POST request to [/api/v1/unified/transaction/broadcast](/reference/unified-transaction-send).

Example request (for `testnet` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/transaction/broadcast \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "hyperliquid",
      "network": "testnet",
      "signedTransaction": "eyJhY3Rpb24iOnsidHlwZSI6InRva2VuRGVsZWdhdGUiLCJoeXBlcmxpcXVpZENoYWluIjoiVGVzdG5ldCIsInNpZ25hdHVyZUNoYWluSWQiOiIweDY2ZWVlIiwid2VpIjoxMDAwMDAwMCwibm9uY2UiOjE3NTUwOTQ3MTQ1OTMsInZhbGlkYXRvciI6IjB4YTAxMmI5MDQwZDgzYzVjYmFkOWU2ZWE3M2M1MjUwMjdiNzU1ZuU5NiIsImlzVW5kZWxlZ2F0ZSI6ZmFsc2V9LCJub25jZSI6MTc1NTA5NDcxNDU5Mywic2lnbmF0dXJlIjp7fX0=",
      "stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88"
      }'
  ```
</CodeGroup>

* `chain`— blockchain network.
* `network` — environment in which the transaction is processed.
* `signedTransaction` — signed transaction in Base64 encrypted format, which contains all transaction details (e.g., accounts, instructions, and signatures) required to broadcast the transaction to the network.
* `stakerAddress` — account address initiated the delegate transaction.

Example response:

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "status": "success"
      }
  }
  ```
</CodeGroup>

* `status` — transaction status: `success`, `pending` or `failed`.

## Unstaking flow

### 1. Create unstaking request

To undelegate the HYPE tokens from the P2P validator to the staking balance, send a POST request to [/api/v1/unified/staking/unstake](/reference/unified-create-unstake-transaction).

Example request (for `testnet` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/staking/unstake \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "hyperliquid",
      "network": "testnet",
      "stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
      "extra":{
          "amount": 10
      }
  }'
  ```
</CodeGroup>

* `chain` — blockchain network.
* `network` — environment in which the transaction is processed.
* `stakerAddress` — 0x-prefixed account address initiated the delegate transaction.
* `extra` — additional parameters:
  * `amount` — amount of tokens to undelegate in HYPE.

Example response:

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "unsignedTransactionData": "eyJhY3Rpb24iOnsidHlwZSI6InRva2VuRGVsZWdhdGUiLCJoeXBlcmxpcXVpZENoYWluIjoiVGVzdG5ldCIsInZhbGlkYXRvciI6IjB4YTAxMmI5MDQwZDgzYzVjYmFkOWU2ZWE3M2M1MjUwMjdiNzU1ZjU5NiIsImlzVW5kZWxlZ2F0ZSI6dHJ1ZSwic2lnbmF0dXJlQ2hhaW5JZCI6IjB4NjZlZWUiLCJ3ZWkjOjEwMDAwMDAwLCJub25jZSI6MTc1NDQ3MjU5NDQyMX0sIm5vbmNlIjoxNzU0NDcyNTk0NDIxLCJzaWduYXR1cmUiOnt9fQ==",
          "createdAt": "2025-08-06T09:29:54.168Z",
          "extraData": {
              "amount": 10
          }
      }
  }
  ```
</CodeGroup>

* `unsignedTransactionData` — unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action.
* `createdAt` — timestamp of the transaction in the ISO 8601 format.
* `extraData` — additional transaction details:
  * `amount` — amount of tokens to undelegate in HYPE.

### 2. Sign and send transaction

Use `unsignedTransactionData` to [sign and send](/docs/unified-api-signing-transaction) the transaction following the Hyperliquid-specific signing logic.

### 3. Create withdrawal request

<Note>
  Note that it takes 7 days to withdraw tokens from the staking balance to the spot balance on Hyperliquid network.
</Note>

Send a POST request to [/api/v1/unified/staking/withdraw](/reference/unified-create-withdraw-transaction).

Example request (for `testnet` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/staking/withdraw \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "hyperliquid",
      "network": "testnet",
      "stakerAddress": "0x2588942932015ae61b7e9b77d41f8ed053dde2b341ccaca57bf6a6ecb4fa511a",
      "extra":{
          "amount": 10
      }
  }'
  ```
</CodeGroup>

* `chain` — blockchain network.
* `network` — environment in which the transaction is processed.
* `stakerAddress` — account address initiated the delegate transaction.
* `extra` — additional parameters:
  * `amount` — amount of tokens to withdraw in HYPE.

Example response:

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
          "unsignedTransactionData": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad8802000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c0877697468647261770002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d28086300000000000000e80300000000000064000000000000007f06f587970100000200",
          "createdAt": "2025-06-19T10:31:11.615Z",
          "extraData": {
              "amount": 10
          }
      }
  }
  ```
</CodeGroup>

* `stakerAddress` — account address initiating the withdrawal transaction.
* `unsignedTransactionData` — unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action.
* `createdAt` — timestamp of the transaction in the ISO 8601 format.
* `extraData` — additional transaction details:
  * `amount` — amount of tokens to withdraw in HYPE.

### 4. Sign and send transaction

Use `unsignedTransactionData` to [sign and send](/docs/unified-api-signing-transaction) the transaction following the Hyperliquid-specific signing logic.


## Related topics

- [Unified API Reference](/reference/unified-create-stake-transaction.md)
- [Integration Workflow Example](/docs/unified-api-getting-started.md)
- [Networks Supported](/docs/unified-api-networks.md)
