> ## 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.

# Prepare Unstake Transaction

> Construct a serialized transaction to initiate the unstaking process from the vault.



## OpenAPI

````yaml POST /api/v1/staking/pool/{network}/staking/unstake
openapi: 3.0.0
info:
  title: Staking API
  description: API used for staking
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.p2p.org/api
security:
  - bearer: []
tags:
  - name: Aptos
    description: Aptos staking operations (stake, unstake, withdraw, claim).
  - name: Celestia
    description: Celestia staking operations (stake, unstake, redelegate, claim).
  - name: Cosmos
    description: Cosmos Hub staking operations (stake, unstake, redelegate, claim).
  - name: EigenLayer
    description: EigenLayer restaking operations.
  - name: Ethereum
    description: Ethereum staking operations (direct, SSV, pooled).
  - name: Hyperliquid
    description: Hyperliquid staking operations.
  - name: Monad
    description: Monad staking operations (delegate, undelegate, withdraw).
  - name: P2P SSV
    description: P2P-managed SSV validator operations (deposit, claim, withdraw).
  - name: Polkadot
    description: Polkadot staking and nomination pool operations.
  - name: Polygon
    description: Polygon staking operations.
  - name: Pooled Staking
    description: Pooled staking vault operations (deposit, unstake, withdraw).
  - name: Sei
    description: Sei staking operations (stake, unstake, redelegate, claim).
  - name: Solana
    description: Solana staking operations (stake, split, merge, deactivate, withdraw).
  - name: SSV
    description: SSV network validator operations.
  - name: Story
    description: Story network staking operations.
  - name: Sui
    description: Sui staking operations.
  - name: TON
    description: TON staking operations (single nominator, whales pool).
  - name: TRON
    description: TRON staking operations (freeze, delegate, vote, withdraw).
  - name: Unified
    description: Unified multi-chain staking interface.
paths:
  /api/v1/staking/pool/{network}/staking/unstake:
    post:
      tags:
        - Pooled Staking
      summary: Prepare Unstake Transaction
      description: >-
        Construct a serialized transaction to initiate the unstaking process
        from the vault.
      operationId: eth-pool-staking-unstake
      parameters:
        - name: network
          required: true
          in: path
          description: >-
            <p>Ethereum pool network:</p><ul><li>`mainnet` — Ethereum
            mainnet.</li><li>`hoodi` — Ethereum testnet.</li></ul>
          schema:
            enum:
              - mainnet
              - hoodi
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StakingPoolUnstakeRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      result:
                        $ref: '#/components/schemas/StakingPoolUnstakeResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionResponse'
                  - type: object
                    properties:
                      error:
                        oneOf:
                          - $ref: >-
                              #/components/schemas/StakingPoolGasUnitPriceTooLowException
                          - $ref: >-
                              #/components/schemas/StakingPoolInsufficientAvailableStakeException
                          - $ref: >-
                              #/components/schemas/StakingPoolInvalidDelegatorAddressException
                          - $ref: >-
                              #/components/schemas/StakingPoolInvalidVaultAddressException
                          - $ref: >-
                              #/components/schemas/StakingPoolMaxGasAmountTooLowException
              examples:
                GasUnitPriceTooLowException:
                  value:
                    error:
                      code: 127107
                      message: >-
                        The specified gas unit price is too low to be accepted
                        by the network.
                      name: GasUnitPriceTooLowException
                      type: client
                    result: null
                InsufficientAvailableStakeException:
                  value:
                    error:
                      code: 127103
                      message: >-
                        Requested unstake amount exceeds the currently available
                        staked balance for the delegator.
                      name: InsufficientAvailableStakeException
                      type: client
                    result: null
                InvalidDelegatorAddressException:
                  value:
                    error:
                      code: 127106
                      message: >-
                        The provided delegator address is invalid or not
                        properly formatted.
                      name: InvalidDelegatorAddressException
                      type: client
                    result: null
                InvalidVaultAddressException:
                  value:
                    error:
                      code: 127101
                      message: >-
                        The provided vault address is invalid or not properly
                        formatted.
                      name: InvalidVaultAddressException
                      type: client
                    result: null
                MaxGasAmountTooLowException:
                  value:
                    error:
                      code: 127105
                      message: >-
                        The estimated gas limit exceeds the allowed maximum.
                        Consider increasing the gas limit.
                      name: MaxGasAmountTooLowException
                      type: client
                    result: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionResponse'
                  - type: object
                    properties:
                      error:
                        oneOf:
                          - $ref: '#/components/schemas/AuthNoTokenException'
                          - $ref: '#/components/schemas/AuthWrongTokenException'
              examples:
                NoTokenException:
                  value:
                    error:
                      code: 101111
                      message: >-
                        No Bearer token has been provided. To obtain an
                        authentication token, follow the instructions at
                        https://docs.p2p.org/docs/authentication.
                      name: NoTokenException
                      type: authentication
                    result: null
                WrongTokenException:
                  value:
                    error:
                      code: 101109
                      message: >-
                        An invalid Bearer token has been provided. Please
                        specify the correct authentication token.
                      name: WrongTokenException
                      type: authentication
                    result: null
        '404':
          description: Not found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionResponse'
                  - type: object
                    properties:
                      error:
                        $ref: '#/components/schemas/StakingPoolVaultNotFoundException'
              examples:
                StakingPoolVaultNotFoundException:
                  value:
                    error:
                      code: 127116
                      message: >-
                        The provided vault address is not found. Try with
                        another vault address.
                      name: StakingPoolVaultNotFoundException
                      type: not_found
                    result: null
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ExceptionResponse'
                  - type: object
                    properties:
                      error:
                        $ref: >-
                          #/components/schemas/StakingPoolSimulateTransactionException
              examples:
                SimulateTransactionException:
                  value:
                    error:
                      code: 127108
                      message: >-
                        Failed to simulate the transaction. Please try again
                        later or contact support if the issue persists.
                      name: SimulateTransactionException
                      type: server
                    result: null
      security:
        - bearer: []
components:
  schemas:
    StakingPoolUnstakeRequest:
      type: object
      properties:
        delegatorAddress:
          type: string
          description: Account address of the delegator initiating the transaction.
          example: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb'
          pattern: ^0x[a-fA-F0-9]{40}$
        vaultAddress:
          type: string
          description: Ethereum address of the vault which keeps the tokens.
          example: '0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb'
          pattern: ^0x[a-fA-F0-9]{40}$
        amount:
          type: string
          description: >-
            Amount of tokens in ETH, as a decimal string (e.g.
            "0.925413332702449273"). Send it as a JSON string to preserve full
            18-decimal precision; a JSON number loses precision before it
            reaches the server. Must be a plain positive decimal of at least
            0.01 ETH with no more than 18 fractional digits; exponential
            notation (e.g. "1e-2") and signs are rejected with a 400 validation
            error.
          pattern: ^\d+(\.\d+)?$
          example: '0.01'
      required:
        - delegatorAddress
        - vaultAddress
        - amount
    SuccessResponse:
      type: object
      properties:
        error:
          type: object
          nullable: true
          default: null
          description: Error object. Always null on successful responses.
        result:
          type: object
          description: Response payload containing the requested data.
      description: Standard API success response envelope wrapping the result payload.
      required:
        - error
        - result
    StakingPoolUnstakeResponse:
      type: object
      properties:
        amount:
          type: number
          format: double
          description: Amount of tokens in ETH.
          nullable: false
          example: 0.01
        vaultAddress:
          type: string
          description: Ethereum address of the vault which keeps the tokens.
          nullable: false
          pattern: ^0x[a-fA-F0-9]{40}$
          example: '0xba447498dc4c169f2b4f427b2c4d532320457e89'
        delegatorAddress:
          type: string
          description: Account address of the delegator initiating the transaction.
          nullable: false
          pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x092Af80778ff3c3D27Fd2744C39f6e9326d9AaEe'
        unsignedTransaction:
          description: >-
            Unsigned transaction in the serialized format. Sign the transaction
            and submit it to the blockchain to perform the called action.
          allOf:
            - $ref: '#/components/schemas/StakingPoolUnsignedTransaction'
        createdAt:
          type: string
          format: date-time
          description: Timestamp of the transaction in the ISO 8601 format.
          nullable: false
          example: '2025-07-12T12:34:56.789Z'
      required:
        - amount
        - vaultAddress
        - delegatorAddress
        - unsignedTransaction
        - createdAt
    ExceptionResponse:
      type: object
      properties:
        error:
          type: object
          description: Error object containing exception details. Null on success.
        result:
          type: object
          nullable: true
          default: null
          description: Result payload. Always null on error responses.
        requestId:
          type: string
          description: >-
            Identifier of the request (the `x-request-id` header). Quote this
            value to correlate the response with server logs.
          example: 90c16e9e-6e99-4651-a033-60290356df2f
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the error response was generated.
          example: '2026-05-20T22:29:03.126Z'
      description: Standard API error response envelope wrapping the exception details.
      required:
        - error
        - result
        - timestamp
    StakingPoolGasUnitPriceTooLowException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 127107
          example: 127107
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            The specified gas unit price is too low to be accepted by the
            network.
          example: >-
            The specified gas unit price is too low to be accepted by the
            network.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: GasUnitPriceTooLowException
          example: GasUnitPriceTooLowException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    StakingPoolInsufficientAvailableStakeException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 127103
          example: 127103
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Requested unstake amount exceeds the currently available staked
            balance for the delegator.
          example: >-
            Requested unstake amount exceeds the currently available staked
            balance for the delegator.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: InsufficientAvailableStakeException
          example: InsufficientAvailableStakeException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    StakingPoolInvalidDelegatorAddressException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 127106
          example: 127106
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: The provided delegator address is invalid or not properly formatted.
          example: The provided delegator address is invalid or not properly formatted.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: InvalidDelegatorAddressException
          example: InvalidDelegatorAddressException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    StakingPoolInvalidVaultAddressException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 127101
          example: 127101
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: The provided vault address is invalid or not properly formatted.
          example: The provided vault address is invalid or not properly formatted.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: InvalidVaultAddressException
          example: InvalidVaultAddressException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    StakingPoolMaxGasAmountTooLowException:
      type: object
      properties:
        type:
          type: string
          default: client
          example: client
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 127105
          example: 127105
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            The estimated gas limit exceeds the allowed maximum. Consider
            increasing the gas limit.
          example: >-
            The estimated gas limit exceeds the allowed maximum. Consider
            increasing the gas limit.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: MaxGasAmountTooLowException
          example: MaxGasAmountTooLowException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    AuthNoTokenException:
      type: object
      properties:
        type:
          type: string
          default: authentication
          example: authentication
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 101111
          example: 101111
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            No Bearer token has been provided. To obtain an authentication
            token, follow the instructions at
            https://docs.p2p.org/docs/authentication.
          example: >-
            No Bearer token has been provided. To obtain an authentication
            token, follow the instructions at
            https://docs.p2p.org/docs/authentication.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: NoTokenException
          example: NoTokenException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    AuthWrongTokenException:
      type: object
      properties:
        type:
          type: string
          default: authentication
          example: authentication
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 101109
          example: 101109
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            An invalid Bearer token has been provided. Please specify the
            correct authentication token.
          example: >-
            An invalid Bearer token has been provided. Please specify the
            correct authentication token.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: WrongTokenException
          example: WrongTokenException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    StakingPoolVaultNotFoundException:
      type: object
      properties:
        code:
          type: integer
          format: int32
          default: 127116
          example: 127116
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            The provided vault address is not found. Try with another vault
            address.
          example: >-
            The provided vault address is not found. Try with another vault
            address.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: StakingPoolVaultNotFoundException
          example: StakingPoolVaultNotFoundException
          description: Exception class name for runtime error identification.
      required:
        - code
        - message
        - name
    StakingPoolSimulateTransactionException:
      type: object
      properties:
        type:
          type: string
          default: server
          example: server
          description: Exception category.
        code:
          type: integer
          format: int32
          default: 127108
          example: 127108
          description: Numeric error code identifying the exception type.
        message:
          type: string
          default: >-
            Failed to simulate the transaction. Please try again later or
            contact support if the issue persists.
          example: >-
            Failed to simulate the transaction. Please try again later or
            contact support if the issue persists.
          description: Human-readable error message describing what went wrong.
        name:
          type: string
          default: SimulateTransactionException
          example: SimulateTransactionException
          description: Exception class name for runtime error identification.
      required:
        - type
        - code
        - message
        - name
    StakingPoolUnsignedTransaction:
      type: object
      properties:
        serializeTx:
          type: string
          description: Unsigned transaction in the hexadecimal format.
          example: >-
            0x02f9011c82001384059682d78585059682f7008302bc6894ba447498dc4c169f2b4f427b2c4d532320457e89...
        to:
          type: string
          description: Recipient address for this transaction.
          nullable: false
          pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x4Dd92880f7EF2270b2B7dd67e1DfC27D752311d3'
        data:
          type: string
          description: Transaction data payload in the hexadecimal format.
        value:
          type: string
          description: Amount this transaction is sending in Wei.
          example: '0'
        nonce:
          type: integer
          format: int64
          description: Nonce of the sender account.
          example: 15
        chainId:
          type: integer
          format: int64
          description: Chain ID this transaction is authorized on, as specified by EIP-155.
          example: 560048
        gasLimit:
          type: string
          description: Maximum gas limit for the transaction.
          example: '207957'
        maxFeePerGas:
          type: string
          description: >-
            Maximum price per unit of gas this transaction will pay for the
            combined EIP-1559 block's base fee and this transaction's priority
            fee in Wei.
          example: '3545182006'
        maxPriorityFeePerGas:
          type: string
          description: >-
            Price per unit of gas in Wei, which is added to the EIP-1559 block's
            base fee. This added fee is used to incentivize miners to prioritize
            this transaction.
          example: '1500000000'
      required:
        - serializeTx
        - to
        - data
        - value
        - nonce
        - chainId
        - gasLimit
        - maxFeePerGas
        - maxPriorityFeePerGas
  responses:
    TooManyRequests:
      description: >-
        Too Many Requests — the client exceeded its rate limit. The response
        advertises when to retry and the active quota via headers.
      headers:
        Retry-After:
          description: Number of seconds to wait before retrying the request.
          schema:
            type: integer
            example: 60
        RateLimit-Limit:
          description: >-
            The request quota (maximum number of requests) for the most
            restrictive applicable window.
          schema:
            type: integer
            example: 120
        RateLimit-Reset:
          description: >-
            Number of seconds until the rate-limit window resets and requests
            are accepted again.
          schema:
            type: integer
            example: 60
        RateLimit-Policy:
          description: >-
            The active rate-limit policy as `<limit>;w=<window-seconds>`,
            comma-separated when multiple windows apply.
          schema:
            type: string
            example: 120;w=60
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: integer
                  name:
                    type: string
                    example: ThrottlerException
                  message:
                    type: string
                    example: ThrottlerException
                  errors:
                    type: array
                    nullable: true
                    items:
                      type: object
              result:
                type: object
                nullable: true
                example: null
              requestId:
                type: string
                description: >-
                  Identifier of the request (the `x-request-id` header). Quote
                  this value to correlate the response with server logs.
                example: 90c16e9e-6e99-4651-a033-60290356df2f
              timestamp:
                type: string
                format: date-time
                description: ISO 8601 timestamp of when the error response was generated.
                example: '2026-05-20T22:29:03.126Z'
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````

## Related topics

- [Sign and Broadcast Transaction](/docs/signing-transaction-ton.md)
