ETH Liquid Staking API
To integrate with ETH Liquid Staking, use the smart contract functions and examples below.
Stake ETH and claim ankrETH
stakeAndClaimAethC()
Stakes the msg.value
of ETH and claims ankrETH for it.
Smart contract
- Mainnet GlobalPool Proxy — 0x84db6eE82b7Cf3b47E8F19270abdE5718B936670 (opens in a new tab) (0x84db6ee82b7cf3b47e8f19270abde5718b936670)
- Goerli Testnet GlobalPool Proxy — 0x5ea4C3a6CA22B38a1D6776329bb8b4073C157B27 (opens in a new tab) (0xaee23129160daa54970a540089def8c6dee4e615)
- Holesky Testnet GlobalPool Proxy — 0xb2f5B45Aa301fD478CcffC93DBD2b91C22FDeDae (opens in a new tab) (0xb2f5B45Aa301fD478CcffC93DBD2b91C22FDeDae)
Example
- Mainnet live transaction example (opens in a new tab)
- Goerli live transaction example (opens in a new tab)
- Holesky live transaction example (opens in a new tab)
Unstake ETH and get ETH
unstakeAETH()
Unstakes ankrETH and gets the corresponding amount of ETH.
Parameters
shares
(uint256, required) — amount of ankrETH to be unstaked.
Smart contract
- Mainnet GlobalPool Proxy — 0x84db6eE82b7Cf3b47E8F19270abdE5718B936670 (opens in a new tab) (0x84db6ee82b7cf3b47e8f19270abde5718b936670)
- Goerli Testnet GlobalPool Proxy — 0x5ea4C3a6CA22B38a1D6776329bb8b4073C157B27 (opens in a new tab) (0xaee23129160daa54970a540089def8c6dee4e615)
- Holesky Testnet GlobalPool Proxy — 0xb2f5b45aa301fd478ccffc93dbd2b91c22fdedae (opens in a new tab) (0xb2f5b45aa301fd478ccffc93dbd2b91c22fdedae)
Example
- Mainnet live transaction example (opens in a new tab)
- Goerli live transaction example (opens in a new tab)
- Holesky live transaction example (opens in a new tab)
Get staking metrics
To integrate Ankr Staking metrics into your dashboards or use metrics like APY in your products, read Liquid Staking Metrics.