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

# Pre-Pectra staking

# Overview

Anchorage Digital now supports ETH staking operations initiated via API.

> 📘 ETH staking API notes
>
> * Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis.
> * The staked ETH - validator public key is listed as the `stakingPositionId` in the list staked positions endpoint.

### Key concepts

* **New validator provisioning:** requires at least **32 ETH**.
* **Pectra vs pre‑Pectra:** use `validatorType` to distinguish validator types.
* Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis
* The staked ETH - validator public key is listed as the `stakingPositionId` in the list staking positions endpoint.

### Relevant endpoints

* **[Stake](https://developers.anchorage.com/reference/createstake):** `POST /v2/transactions/stake`
* **[Unstake](https://developers.anchorage.com/reference/createunstake):** `POST /v2/transactions/unstake`
* **[List transactions](https://developers.anchorage.com/reference/gettransactions):** `GET /v2/transactions`
* **[List wallet balances](https://developers.anchorage.com/reference/getwallets):** `GET /v2/wallets`, `GET /v2/vaults/{vaultId}/wallets`, `GET /v2/wallets/{walletId}`
* **[Get staking positions](https://developers.anchorage.com/reference/getwalletpositions):** `GET /v2/wallets/{walletId}/staking/positions`

***

# Workflows

### Initiate staking operation

1. **Funding wallet**
   1. Fund the wallet in increments of 32 ETH and ensure you have sufficient gas to cover the on-chain movement of funds. Only staking operations in multiples of 32 will be approved.
   2. Current minimum gas requirement per staking operation = 0.03 ETH.
2. [**Create a stake request (API)**](https://developers.anchorage.com/reference/createstake)
   1. Initiate ETH staking operation API from your ethereum source wallet.
   2. e.g. 32 ETH + gas
      1. For more information about API gas fee requirements - See [Network and gas fees](https://developers.anchorage.com/docs/network-gas-fees).
   3. Identifying destination address.
      1. This is the source wallet, which can be identified by hitting the [List wallets API](https://developers.anchorage.com/reference/getwallets) endpoint.
3. **Quorum approval**
4. **Anchorage Digital - Risk review**
5. **Anchorage Digital sends ETH to the validator**
   1. Transaction Type = `OTHER`
      1. Status = `PENDING` until confirmed staked balance.
      2. This can take \~12 hours to provision the validator plus however long the [queue](https://www.validatorqueue.com/) is at that time to actually activate the staking validator.
6. **Assets successfully staked**
   1. [Staking position for a wallet API](https://developers.anchorage.com/reference/getwalletpositions)
      1. Status of the position will now reflect that it is `ACTIVE`.
   2. [ List vaults](https://developers.anchorage.com/reference/getvaults) (See `assets` balances)
      1. `stakedBalance`Your current staked position balance for a specific wallet.
      2. `unclaimedBalance`The amount of unclaimed staking rewards. Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis.
   3. [List wallets](https://developers.anchorage.com/reference/getwallets) (See `assets` balances)
      1. `stakedBalance`Your current staked position balance for a specific wallet.
      2. `unclaimedBalance`The amount of unclaimed staking rewards. Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis.

***

### View claimed and unclaimed rewards

1. [List staking position for a given wallet ID (API)](https://developers.anchorage.com/reference/getwalletpositions)
   1. Staking rewards begin accruing as soon as the staking position is `ACTIVE`.
2. **Daily reward snapshot**
   1. Staking rewards are updated daily after our daily snapshot process runs.
3. [**List staking rewards for a given walletId (API)**](https://developers.anchorage.com/reference/getwalletrewards)
   1. The rewards will be in a state of `UNCLAIMED` until they are swept back to the source wallet.
   2. Also view staked ETH and reward positions in vaults and wallet balances:
      1. [ List Vaults](https://developers.anchorage.com/reference/getvaults)
         * `stakedBalance`Your current staked position balance for a specific wallet.
         * `unclaimedBalance`The amount of unclaimed staking rewards. Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis.
      2. [List wallets](https://developers.anchorage.com/reference/getwallets)
         * `stakedBalance`Your current staked position balance for a specific wallet.
         * `unclaimedBalance`The amount of unclaimed staking rewards. Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis.
4. **Automatic staking rewards sweep to source wallet (Anchorage Digital)**
   1. This will be listed as a `STAKING_REWARD` transaction when hitting our [List transactions API](https://developers.anchorage.com/reference/gettransactions). Once this occurs, these rewards will be updated to `CLAIMED`.
5. [**List transactions (API)**](https://developers.anchorage.com/reference/gettransactions)
   1. Once the deposit of rewards hits the wallet, they will be reflected by a Transaction type of `STAKING_REWARD`.

***

### Initiate unstaking operation

1. [**Create an unstake request (API)**](https://developers.anchorage.com/reference/createunstake)
2. **Quorum approval**
3. **Anchorage Digital risk review**
4. **Unstake operation auccessfully Initiated**
   1. Transaction type = `OTHER`
   2. Status = `INPROGRESS`
      1. Unstake operations take place in two major phases:
         * Exit the active validator set: Once a request to "exit" has been made, the validator is added to the exit queue. If there are no other validators in the exit queue, this part will take \~35 minutes. If there are other validators in the exit queue, this part can take several days as a maximum of 2,000 validators can exit per day.
         * Withdraw balance back to the execution layer: Once exited, a validator must wait a minimum of 27 hours to be considered eligible to be withdrawn. At this point, the ETH able to be withdrawn will be transferred in the next recurring withdrawal sweep. Given normal network behavior, you can expect full staking withdrawal to take about one week on average.
      2. We broadcast the Unstake message as soon as it is approved. ETH stake unbonding time is determined by the protocol. It takes between 1-10 days for funds to return back into the wallet's available balance
      3. Position will update to `Exited` once your unbonding or unstaking operation completes.
5. **Funds returned to source wallet**
   1. All funds, including unclaimed rewards will land in the source wallet.
   2. Transaction type = `OTHER`
   3. Staking positions and rewards will return to 0.

***

### Consolidate Stake from Pre-Pectra to Pectra

See instructions on [ETH Pectra staking API page](https://developers.anchorage.com/docs/ethereum-pectra-staking-api)

Note: you may consolidate across wallets and vaults but not across different validator providers (e.g. do NOT consolidate a Figment validator to a BlockDaemon validator)

***

# API endpoints

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Endpoint
      </th>

      <th>
        Required permissions
      </th>

      <th>
        Overview
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        [Create a stake request](https://developers.anchorage.com/reference/createstake)
      </td>

      <td>
        Initiate staking and unstaking
      </td>

      <td>
        Initiate a staking operation of 32+ ETH (increments of 32) via API. After this, you will need to complete an iOS-based quorum approval on the app and pass Anchorage Digital risk review before the funds are moved.
      </td>

      <td>
        You will need sufficient wallet and gas balance to initiate the staking operation. For ETH, the Anchorage Digital gas minimum required balance is 0.03 ETH per API staking operation, however this will likely not all be used, as this is just a conservative buffer to ensure the transaction does not fail on-chain due to insufficient gas fees available.
      </td>
    </tr>

    <tr>
      <td>
        [Create an unstake request](https://developers.anchorage.com/reference/createunstake)
      </td>

      <td>
        Initiate staking and unstaking
      </td>

      <td>
        Initiate an unstaking request, also to be confirmed via quorum approval and Anchorage risk review. Once this is completed, the unstaking request will be submitted.
      </td>

      <td>
        The funds will be sent back to your `source` wallet.
      </td>
    </tr>

    <tr>
      <td>
        [List transactions](https://developers.anchorage.com/reference/gettransactions)
      </td>

      <td>
        Read vault activity
      </td>

      <td>
        `transactionType` for Staking Transactions:

        1: Staking and unstaking operations: `transactionType` = `OTHER`

        2: Staking rewards Received: `transactionType` = `STAKING_REWARD`
      </td>

      <td>
        * *Note*\*: Stake and unstake will be updated from `OTHER` in the coming months to it's own unique transaction type.
        * *Transaction Status*\*:
          `SUCCESS` - This transaction has succeeded.\\

        `NEEDS_APPROVAL` - This transaction has begun but is awaiting approval by members of the quorum.

        `INPROGRESS` - This transaction is currently in progress.

        `FAILURE` - This transaction has failed.

        `REJECTED` - This transaction has been rejected.

        `EXPIRED` - This transaction has expired due to lack of quorum approval within specified approval window.
      </td>
    </tr>

    <tr>
      <td>
        [Staking rewards for a wallet](https://developers.anchorage.com/reference/getwalletrewards)
      </td>

      <td>
        Read vault activity
      </td>

      <td>
        Get staking rewards (in aggregate) for a specific source wallet.
      </td>

      <td>
        **Reward Type**

        `UNCLAIMED` Rewards that have accrued but have not yet been sent back to the Anchorage Digital source wallet.

        `CLAIMED`These are the total claimed rewards for this wallet.
      </td>
    </tr>

    <tr>
      <td>
        [Staking position for a wallet](https://developers.anchorage.com/reference/getwalletpositions)
      </td>

      <td>
        Read vault activity
      </td>

      <td>
        Each staking operation will result in a unique `StakingPositionId` with an `ACTIVE` staking status, once the staking operation is completed.
      </td>

      <td>
        * \*Staking validator public key
          \*\*
          The `stakingPositionId`represents the ETH validator's unique public key for this operation.\\

        **Status**

        `PENDING` Positions will be in a pending state form when they are
        `ACTIVE` Once the position is officially Staked, the position will reflect an ACTIVE state
        `EXITED`
      </td>
    </tr>

    <tr>
      <td>
        [Get vault by ID](https://developers.anchorage.com/reference/getvault)
      </td>

      <td>
        Read vault activity
      </td>

      <td>
        Get your staked balances within wallets for a specific vault
      </td>

      <td>
        **Position Asset Balances**
        `stakedBalance` Your current staked position balance for a specific wallet.

        `unclaimedBalance`An amount of a unclaimed staking rewards. Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis.
      </td>
    </tr>

    <tr>
      <td>
        [List wallet by ID](https://developers.anchorage.com/reference/getwallet)
      </td>

      <td>
        Read vault activity
      </td>

      <td>
        Get your staked balances within wallets for a specific vault
      </td>

      <td>
        **Position Asset Balances**

        `stakedBalance` Your current staked position balance for a specific wallet.

        `unclaimedBalance`An amount of a unclaimed staking rewards. Unclaimed rewards are claimed and deposited back to your source wallet on a regular basis.
      </td>
    </tr>
  </tbody>
</Table>

***

### Additional metadata

You may provide a description with each staking operation, that will be visible within your organization in the Anchorage Digital iOS app.

***

### Unsuccessful staking request

A stake request may fail for any of the following reasons:

* An ongoing stake already exists.
* The specified asset does not exist.
* The specified amount exceeds the available funds for this asset (insufficient funds).
* The provided API key does not have permissions to initiate staking from this vault.

If the initiated stake is approved by the quorum, the transaction may fail for any of the following reasons:

* There are insufficient funds to pay the blockchain network fee at the time of this transaction.
* There is a failure on the blockchain.
