Getting started with staking API
To get started, ensure you have the correct API permission group, API key, and a sufficiently funded wallet. End-to-end staking via API is available for ETH and SOL only. Stake other assets in the iOS app or web dashboard.- Create the API permission group - including the following permissions:
- Read vaults.
- Initiate staking and unstaking,
- Quorum approval
- Admins must confirm operation via quorum on iOS device.
- Create an API key with staking permission group
- Once you’ve created your permission group, create an API key tied to this permission group to use for staking operations.
- See API permission groups and API keys
When the staking position ID becomes available
The transaction hash and the staking position ID for a stake request become available at different times. Once a stake request clears quorum approval and Anchorage Digital risk review, we sign and broadcast the deposit. At that point List transactions returns the transaction’sblockchainTxId, before the deposit is included in a block.
The stakingPositionId is assigned later. Anchorage Digital waits for the deposit to be mined, confirmed, and detected by our blockchain indexer, then creates the staking position from the confirmed on-chain state. This typically takes a few minutes. We assign the position ID only once the position exists on-chain, so the ID never needs to be reconciled against later on-chain changes.
Until the position is created, Get staking positions returns an empty data array for that transaction.
Poll for the position by transaction ID
Each staking position carries thetransactionId of the stake request that created it, and the endpoint accepts the same value as a filter.
- Store the transaction ID returned by
POST /v2/transactions/stake. - Poll
GET /v2/wallets/{walletId}/staking/positions?transactionId={transactionId}on an interval untildatais non-empty. - Read
stakingPositionIdandstatusfrom the returned position.
status set to PENDING before it’s ACTIVE. PENDING means the deposit is confirmed and the position exists but isn’t yet active on-chain, for example while an ETH validator waits in the activation queue. Rewards begin accruing once the position is ACTIVE.
If your monitoring expects
stakingPositionId and blockchainTxId to arrive together, it will see an empty positions response for a few minutes after every stake request. Treat the position ID as available only when the positions endpoint returns it.