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 to start using the Unified API.

Request examples are provided using cURL.

To check the integration guides for other chains, refer to the Networks Supported section.

📘

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.

Staking Flow

1. Create Delegate Request

To delegate HYPE tokens from the staking balance to the P2P validator, send a POST request to /api/v1/unified/staking/stake. 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):

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
}'
  • 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:

{
    "error": null,
    "result": {
        "amount": 10,
        "stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
        "unsignedTransactionData": "eyJhY3Rpb24iOnsidHlwZSI6InRva2VuRGVsZWdhdGUiLCJoeXBlcmxpcXVpZENoYWluIjoiVGVzdG5ldCIsInNpZ25hdHVyZUNoYWluSWQiOiIweDY2ZWVlIiwid2VpIjoxMDAwMDAwMCwibm9uY2UiOjE3NTUwOTQ3MTQ1OTMsInZhbGlkYXRvciI6IjB4YTAxMmI5MDQwZDgzYzVjYmFkOWU2ZWE3M2M1MjUwMjdiNzU1ZuU5NiIsImlzVW5kZWxlZ2F0ZSI6ZmFsc2V9LCJub25jZSI6MTc1NTA5NDcxNDU5Mywic2lnbmF0dXJlIjp7fX0=",
        "createdAt": "2025-08-01T00:00:00.000Z"
    }
}
  • 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 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.

Example request (for testnet network):

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"
    }'
  • 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:

{
    "error": null,
    "result": {
        "status": "success"
    }
}
  • status — transaction status: success, pending or failed.

Unstaking Flow

1. Create Undelegate Request

To undelegate the HYPE tokens from the P2P validator to the staking balance, send a POST request to /api/v1/unified/staking/unstake.

Example request (for testnet network):

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
    }
}'
  • chain — blockchain network.
  • network — environment in which the transaction is processed.
  • stakerAddress — 0x-prefixed account address initiated the delegate transaction.
  • extra — additional request parameters:
    • amount — amount of tokens to undelegate in HYPE.

Example response:

{
    "error": null,
    "result": {
        "unsignedTransactionData": "eyJhY3Rpb24iOnsidHlwZSI6InRva2VuRGVsZWdhdGUiLCJoeXBlcmxpcXVpZENoYWluIjoiVGVzdG5ldCIsInZhbGlkYXRvciI6IjB4YTAxMmI5MDQwZDgzYzVjYmFkOWU2ZWE3M2M1MjUwMjdiNzU1ZjU5NiIsImlzVW5kZWxlZ2F0ZSI6dHJ1ZSwic2lnbmF0dXJlQ2hhaW5JZCI6IjB4NjZlZWUiLCJ3ZWkjOjEwMDAwMDAwLCJub25jZSI6MTc1NDQ3MjU5NDQyMX0sIm5vbmNlIjoxNzU0NDcyNTk0NDIxLCJzaWduYXR1cmUiOnt9fQ==",
        "createdAt": "2025-08-06T09:29:54.168Z",
        "extraData": {
            "amount": 10
        }
    }
}
  • 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 the transaction following the Hyperliquid-specific signing logic.

3. Create Withdrawal Request

📘

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

Send a POST request to /api/v1/unified/staking/withdraw.

Example request (for testnet network):

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
    }
}'
  • chain — blockchain network.
  • network — environment in which the transaction is processed.
  • stakerAddress — account address initiated the delegate transaction.
  • extra — additional request parameters:
    • amount — amount of tokens to withdraw in HYPE.

Example response:

{
    "error": null,
    "result": {
        "stakerAddress": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad88",
        "unsignedTransactionData": "0x717b869e7c8d0d29a5065073df84513d373df54ae7ff85775979c9c9f4d2ad8802000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c0877697468647261770002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d28086300000000000000e80300000000000064000000000000007f06f587970100000200",
        "createdAt": "2025-06-19T10:31:11.615Z",
        "extraData": {
            "amount": 10
        }
    }
}
  • 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 the transaction following the Hyperliquid-specific signing logic.

What's Next?