Withdrawal

The withdrawal process in the Aptos network using the Staking API can be done in a few steps:

  1. Create an unlock request.

It takes up to 30 days to unlock tokens on Aptos network. During this waiting period, unlocked tokens continue earning rewards.

  1. Create a withdrawal request.

Get an authentication token to start using Staking API.

Request examples are provided using cURL.

1. Create Unstake Transaction

  1. Send a POST request to /api/v1/aptos/{network}/staking/delegated/unlock endpoint.

    Example request (for mainnet network):

    curl --request POST \
         --url https://api.p2p.org/api/v1/aptos/mainnet/staking/delegated/unlock \
         --header 'accept: application/json' \
         --header 'authorization: Bearer <token>' \
         --header 'content-type: application/json' \
         --data '
    {
      "amount": 1100000000,
      "delegatorAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
      "gas": {
        "unitPrice": 100,
        "maxGasLimit": 100,
        "used": 100
      }
    }
    '
    • amount — amount of tokens to unlock in Octas.
    • delegatorAddressdelegator account address which keeps tokens.
    • gas — computational effort required to execute the transaction, measured in gas units.
      • unitPrice — price per unit of gas in Octas for processing the Aptos transaction.
      • maxGasLimit — maximum gas limit for the transaction.
      • used — amount of gas spent for the transaction.

    Example response:

    {
      "result": {
        "amount": 1100000000,
        "delegatorAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
        "unsignedTransaction": "0xa571a5bc9b1bfd5fe58e6e09a5be251a3299985494d022959ce206f1f23f752e21000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c096164645f7374616b650002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d28080100000000000000400d0300000000006400000000000000e5742068000000000200",
        "createdAt": "2023-08-24T08:14:50.455Z"
      },
      "error": {}
    }
    • amount — amount of tokens to unlock in Octas.
    • delegatorAddressdelegator account address which keeps tokens.
    • unsignedTransaction — unsigned transaction in hexadecimal 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. Use unsignedTransaction to sign and send the signed transaction to the Aptos network.

2. Create Withdrawal Request

  1. After the delegation pool period on Aptos expired, withdraw your tokens by sending a POST request to /api/v1/aptos/{network}/staking/delegated/withdraw endpoint.

    Example request (for mainnet network):

    curl --request POST \
         --url https://api.p2p.org/api/v1/aptos/mainnet/staking/delegated/withdraw \
         --header 'accept: application/json' \
         --header 'authorization: Bearer <token>' \
         --header 'content-type: application/json' \
         --data '
    {
      "amount": 1100000000,
      "delegatorAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
      "gas": {
        "unitPrice": 100,
        "maxGasLimit": 100,
        "used": 100
      }
    }
    '
    • amount — amount of tokens to withdraw in Octas.
    • delegatorAddressdelegator account address which keeps tokens.
    • gas — computational effort required to execute the transaction, measured in gas units.
      • unitPrice — price per unit of gas in Octas for processing the Aptos transaction.
      • maxGasLimit — maximum gas limit for the transaction.
      • used — amount of gas spent for the transaction.

    Example response:

    {
      "result": {
        "amount": 1100000000,
        "delegatorAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
        "unsignedTransaction": "0xa571a5bc9b1bfd5fe58e6e09a5be251a3299985494d022959ce206f1f23f752e21000000000000000200000000000000000000000000000000000000000000000000000000000000010f64656c65676174696f6e5f706f6f6c096164645f7374616b650002207a2ddb6af66beb0d9987c6c9010cb9053454f067e16775a8ecf19961195c3d28080100000000000000400d0300000000006400000000000000e5742068000000000200",
        "createdAt": "2025-08-24T08:14:50.455Z"
      },
      "error": {}
    }
    • amount — amount of tokens to withdraw in Octas.
    • delegatorAddressdelegator account address which keeps tokens.
    • unsignedTransaction — unsigned transaction in hexadecimal 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. Use unsignedTransaction to sign and send the signed transaction to the Aptos network.

To check the transaction status, send a GET request to /api/v1/aptos/{network}/transaction/status/{transactionHash}] endpoint.

Example request (for mainnet network):

curl --request GET \
     --url https://api.p2p.org/api/v1/aptos/mainnet/transaction/status/0x8d80b8ed85b578eeb873731101a926221701ee48218f6c9b83895f7ac1535641 \
     --header 'accept: application/json' \
     --header 'authorization: Bearer <token>' \
     --header 'content-type: application/json'
  • transactionHash — hash of the transaction.

Example response:

{
  "result": {
    "createdAt": "2025-06-24T08:14:50.455Z",
    "gas": {
      "unitPrice": 100,
      "maxGasLimit": 100,
      "used": 100
    },
    "senderAddress": "0xd890b1115b39c8d182aeac6cae313cc713cd93922135f8a5893c34fce4e0f32a",
    "sequenceNumber": 42,
    "status": "success",
    "transactionHash": "0x8d80b8ed85b578eeb873731101a926221701ee48218f6c9b83895f7ac1535641"
  },
  "error": {}
}
  • createdAt — timestamp of the transaction in the ISO 8601 format.
  • gas — computational effort required to execute the transaction, measured in gas units.
    • unitPrice — price per unit of gas in Octas for processing the Aptos transaction.
    • maxGasLimit — maximum gas limit for the transaction.
    • used — amount of gas spent for the transaction.
  • senderAddress — transaction sender address.
  • sequenceNumber — number of transactions that have been submitted and committed on chain from the sender account.
  • status — transaction status: success, failed.
  • transactionHash — hash of the transaction.

What's Next?